tango.zh
#151
Posted 16 September 2015 - 01:02 AM
For animated combo backdrops, you need either TANGO_BACKDROP_COMBO or TANGO_BACKDROP_COMPLEX with TANGO_DRAW_COMBO.
There isn't a way to detect when a string is finished printing using documented functions, but
__Tango_GetSlotState(slot)==__TANGO_STATE_FINISHED
should work. I'll add something public for the next version, which is something that probably will actually happen eventually.
#152
Posted 16 September 2015 - 11:10 AM
Yep, the talking functions are in tangoDemo/common.zh.
For animated combo backdrops, you need either TANGO_BACKDROP_COMBO or TANGO_BACKDROP_COMPLEX with TANGO_DRAW_COMBO.
There isn't a way to detect when a string is finished printing using documented functions, but
__Tango_GetSlotState(slot)==__TANGO_STATE_FINISHED
should work. I'll add something public for the next version, which is something that probably will actually happen eventually.
I was able to find combine the code in tangoDemo; common.zh and style.zh had the functions, struts, and constants I needed to test zelda.z, npc.z etc...in my quest.I played around with it all day yesterday (BRILLIANT WORK BTW), but I didn't see anywhere I could change the size of TANGO_DRAW_COMBO. Correct me if I'm wrong, but didn't it say in one of the *.txt files that it could only be 1 frame and 1 combo. I have a 2x2 head of Dr. Light (Megaman) which I have as part of the backdrop in my tiles. I want it to be the combo because its animated but cant' figure out of to make it big or position it.
And what exactly stop links movements? I see in the tangoDemo that zelda.z and pickAColor.z will stop link, but the other scripts do not.
Edited by xenomicx, 16 September 2015 - 12:09 PM.
#153
Posted 16 September 2015 - 05:01 PM
The style flag TANGO_FLAG_BLOCK_INPUT is the one that stops Link from moving.
If you're using TANGO_STYLE_BACKDROP_COMBO, the TANGO_STYLE_BACKDROP_WIDTH and TANGO_STYLE_BACKDROP_HEIGHT settings control the size. For TANGO_DRAW_COMBO in a complex backdrop, the fifth and sixth arguments set the size.
I really need to improve the documentation. It's thorough, but you have to know what you're looking for. Maybe an FAQ would help.
#154
Posted 16 September 2015 - 08:56 PM
I really need to improve the documentation. It's thorough, but you have to know what you're looking for. Maybe an FAQ would help.
No, it reads just fine...and with the examples in tangoDemo they were easy to set up (after some work LOL). My issue was using both a TANGO_STYLE_BACKDROP_COMBO
and TANGO_STYLE_BACKDROP_TILE. I wasn't setting up a type TANGO_BACKDROP_COMPLEX. I do see an issue with setting the width and height for my combo. Here is what I had before.
So when I set the width/height to 2, 2...I would get the same Combo in all for places. I solved it simply by making 4 TANGO_DRAW_COMBO, 1X1...and then offsetting them 16pixels accordingly like this.
Now I have a 2x2 Combo that is animated. Maybe I was doing something wrong...but for now it works. Also, I have my NPC give link an item like you had in "ojiisan.z". How do I stop him from continuing to give Link the item.
#155
Posted 16 September 2015 - 11:23 PM
I really need to improve the documentation. It's thorough, but you have to know what you're looking for. Maybe an FAQ would help.
Actually, both would be fantastic. I started working on that a while back, but I've been sidetracked by everything under moon and stars; and it's on my 'unfinished' heap. I was planning to finish it, I really was; and possibly still shall...but...If you want to work together on a full, good set of user docs (and annotated code examples), I'll make the time for it.
Edited by ZoriaRPG, 16 September 2015 - 11:24 PM.
#156
Posted 05 October 2015 - 11:20 AM
So far I've been able to set up 2 different styles; both of which show a 2x2 animated combo of the character talking, next to the displayed text. Question; Let's say I have 50 NPC's throughout the quest and want each one to use the same 10x5 background, but use a different 2x2 combo to show them talking. Would I have to increase __TANGO_NUM_STYLES = 50? Then int __Tango_Styles[1300]?
Do I have to create a constants for each style, functions, frame arrays etc for all 50? Because as I'm discovering that when I set up 2 functions for my NPC's ( SetUpNPC1Style() & SetUpNPC2Style() ) both have to use different Style constant numbers in the attributes in order to display correctly; STYLE_NPC1 = 0 STYLE_NPC2 = 1. If I make a STYLE_PLAIN = 3 and try to pass that in the Tango_SetStyleAttribute...both NPC's will show the same frame. Even though I have TANGO_BACKDROP_COMPLEX set to two different frames; int npc1Frame[] & int npc2Frame[].
Tell me I don't have to set up 50...because I'm being modest with that number!
#157
Posted 05 October 2015 - 01:05 PM
#158
Posted 05 October 2015 - 02:11 PM
If you're using complex backdrops, you can just change the combo number in the backdrop array as needed. In other cases, you can modify the style attributes. The only time you're required to have multiple styles is when you use more than one at the same time.
You confused me there...I'm pretty sure I'm using more than one at the same time, but I don't know what you mean by that. I have 2 NPC's on screen. Let me show you the code:
When I do this, both NPC's are correct. They use the same tile black background, but then have different combos positioned at the bottom right.
...but if I do this, they are not correct. Only the function SetUpDrLightStyle(); is used.
This is because I have 2 different style constants at the top of my code. I don't want to do this 50+ times.
Edited by xenomicx, 05 October 2015 - 02:24 PM.
#159
Posted 05 October 2015 - 04:17 PM
void SetUpPlainStyle()
{
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_TYPE,TANGO_BACKDROP_COMPLEX);
// skip backdrop data
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_FONT, TANGO_FONT_ORACLE);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_X, 8);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_Y, 6);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_WIDTH, 144);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_HEIGHT, 52);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_CSET, 0);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_COLOR, 1);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SPEED, 5);
// skip SFX
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_FLAGS,
TANGO_FLAG_ENABLE_SPEEDUP | TANGO_FLAG_ENABLE_SUPER_SPEED | TANGO_FLAG_BLOCK_INPUT);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_COMBO, 155);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_CSET, 6);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_WIDTH, 10);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_MOVE_SFX, 66);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_SELECT_SFX, 67);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CANCEL_SFX, 68);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_COMBO, 155);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_CSET, 6);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_X, 168);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_Y, 0);
}And modify ShowMessage() to modify the style each time it's used:int ShowMessage(int message, int type, int frame, int sfx, float x, float y)
{
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_DATA, frame);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SFX, sfx);
int slot=Tango_GetFreeSlot(type);
if(slot==TANGO_INVALID)
return TANGO_INVALID;
Tango_ClearSlot(slot);
Tango_LoadMessage(slot, message, '%');
Tango_SetSlotStyle(slot, STYLE_PLAIN);
Tango_SetSlotPosition(slot, x, y);
Tango_ActivateSlot(slot);
return slot;
}Then Dr. Light would call the function asint slot=ShowMessage(message, TANGO_SLOT_NORMAL, lightFrame, 91, 32, 32);
And Pikachu would use
int slot=ShowMessage(message, TANGO_SLOT_NORMAL, pikachuFrame, 18, 32, 32);
#160
Posted 05 October 2015 - 04:41 PM
In the second case, what you're doing is setting up STYLE_PLAIN in Pikachu's style, then immediately changing it to Dr. Light's. You can replace those functions with one that just sets up the common elements:
void SetUpPlainStyle() { Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_TYPE,TANGO_BACKDROP_COMPLEX); // skip backdrop data Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_FONT, TANGO_FONT_ORACLE); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_X, 8); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_Y, 6); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_WIDTH, 144); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_HEIGHT, 52); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_CSET, 0); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_COLOR, 1); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SPEED, 5); // skip SFX Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_FLAGS, TANGO_FLAG_ENABLE_SPEEDUP | TANGO_FLAG_ENABLE_SUPER_SPEED | TANGO_FLAG_BLOCK_INPUT); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_COMBO, 155); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_CSET, 6); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_WIDTH, 10); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CURSOR_MOVE_SFX, 66); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_SELECT_SFX, 67); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MENU_CANCEL_SFX, 68); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_COMBO, 155); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_CSET, 6); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_X, 168); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_MORE_Y, 0); }And modify ShowMessage() to modify the style each time it's used:
int ShowMessage(int message, int type, int frame, int sfx, float x, float y) { Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_DATA, frame); Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SFX, sfx); int slot=Tango_GetFreeSlot(type); if(slot==TANGO_INVALID) return TANGO_INVALID; Tango_ClearSlot(slot); Tango_LoadMessage(slot, message, '%'); Tango_SetSlotStyle(slot, STYLE_PLAIN); Tango_SetSlotPosition(slot, x, y); Tango_ActivateSlot(slot); return slot; }Then Dr. Light would call the function as
int slot=ShowMessage(message, TANGO_SLOT_NORMAL, lightFrame, 91, 32, 32);
And Pikachu would use
int slot=ShowMessage(message, TANGO_SLOT_NORMAL, pikachuFrame, 18, 32, 32);
Changing this is fine and makes things easier for NPC that are going to be using the same Tile Background and Different Combo Animations. Now all I have to do is create the frame and call it the FFC Script. This will work for several NPC I have...However, when I want to create another Style...I'll have to create another function to call instead of ShowMessage right??
#161
Posted 05 October 2015 - 05:04 PM
If your other styles are similar, you can expand on the idea a bit. If there are more than two or three attributes different between them, you might do something along these lines:
void SetSubStyle(int ss)
{
if(ss==SS_DRLIGHT)
{
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_DATA, lightFrame);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SFX, 91);
}
else if(ss==SS_PIKACHU)
{
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_BACKDROP_DATA, pikachuFrame);
Tango_SetStyleAttribute(STYLE_PLAIN, TANGO_STYLE_TEXT_SFX, 18);
}
}
All you really need to do is have the correct set of data loaded up when the string is displayed. It doesn't matter if you do it once at the start of the quest, every time a message appears, or something in between.
#162
Posted 05 October 2015 - 06:17 PM
All you really need to do is have the correct set of data loaded up when the string is displayed. It doesn't matter if you do it once at the start of the quest, every time a message appears, or something in between.
I think I got a hold of it now....how do I create a line break with Tango code?
#163
Posted 05 October 2015 - 06:22 PM
#164
Posted 05 October 2015 - 06:28 PM
@26 or @(26). You can also use the string control code \25 in ZC messages.
Where is 26 coming from? I'm trying to use @char(10) because I thought the ASCII code for a new line was 10.
#165
Posted 05 October 2015 - 06:41 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users

