Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#211 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 December 2015 - 03:20 PM

See if any errors are logged in allegro.log, first of all. Also, is it just blocking the controls, or does the game hang? If it's the former, the slot's active, but not visible for some reason. If it hangs, that would suggest an array handling error somewhere.

The Navi style uses TANGO_FLAG_AUTO_ADVANCE, and the timing is controlled by __TANGO_AUTO_ADVANCE_TIME. You could also use TANGO_FLAG_PERSISTENT and clear the slot to close it whenever.

#212 C-Dawg

C-Dawg

    Magus

  • Members

Posted 21 December 2015 - 03:24 PM

It just blocks the controls.  My own scripted movement stuff (handled in a global script) still works just fine.  It just turns off the engine's ability to see the input, leading me to believe that Tango somewhere sets Link->Input* to false.

 

The more bizarre thing to me is that it didn't display a window or text at all.  I'll check the log when I get home.

 

EDIT: Which reminds me... at the moment, I'm just calling ShowString() and nothing else other than setup.  Should I be tracking slots in use more specifically?  Or can I just ignore that and call ShowString() when I want something to pop up, leaving it to Tango to manage the slots?


Edited by C-Dawg, 21 December 2015 - 03:32 PM.


#213 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 December 2015 - 03:43 PM

If you copied the styles from the demo, the one you're using presumably has TANGO_FLAG_BLOCK_INPUT set.

You can probably just call ShowString(). You generally don't need to keep track of the slot unless you plan to do something with it beyond just displaying a string.

#214 C-Dawg

C-Dawg

    Magus

  • Members

Posted 21 December 2015 - 03:54 PM

Alright, I'll dig into it a little more tonight.  Thanks!



#215 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 December 2015 - 05:02 PM

Hey, Saffith.
 
Do you know of a reason why a call to the ShowString function (the one that displays a zQuest string int[]) you wrote for the Demo Quest might result in the player's movement input being locked but no string appearing?  I haven't delved deeply into your code to see specifically.  I took your demo and made a few Styles based on the Navi style you did, the only differences being one Style makes a tiny little speech bubble and the other makes a full size one.  The tiny one works fine, but the larger one just locks the player permanently without displaying anything.
 
Anywhere I should start looking on this?
 
EDIT: Also, for a Style like Navis, where a character talks but does not interrupt the action, how do I tell Tango how long to leave the message displayed once it triggers?


Are you certain that your freeze flag is using the correct combo-- 'Screen Freeze (except ffcs)' --and not 'Screen Freeze (ffcs only)'. That's what controls freezing all action, normally.

 

If you have verified that, are you using return values to control the flow? It's possible that you have an error that is refusing to pass control to who is talking, and is setting up an infinite loop. You might want to post your tango code, including your style settings, to use to debug this. check the combo type you are using first though.

 

ordinarily Tango messages use button input to advance, or exit.


Edited by ZoriaRPG, 21 December 2015 - 05:02 PM.


#216 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 21 December 2015 - 06:32 PM

I have a question. If I set up tango to freeze both the screen and ffcs will it unfreeze when the player exits a text box or menu selection?

#217 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 December 2015 - 06:47 PM

Yes. __Tango_FreezeScreen() is called when a slot with the freeze flag is activated, and __Tango_UnfreezeScreen() is called when the last one becomes inactive.

#218 C-Dawg

C-Dawg

    Magus

  • Members

Posted 21 December 2015 - 07:12 PM

Are you certain that your freeze flag is using the correct combo-- 'Screen Freeze (except ffcs)' --and not 'Screen Freeze (ffcs only)'. That's what controls freezing all action, normally.

 

If you have verified that, are you using return values to control the flow? It's possible that you have an error that is refusing to pass control to who is talking, and is setting up an infinite loop. You might want to post your tango code, including your style settings, to use to debug this. check the combo type you are using first though.

 

ordinarily Tango messages use button input to advance, or exit.

 

I have no delved too deeply into Tango.  I imported the proper libraries, included a font, and then looked at how Saffith set up his ShowMessage() function in the example quest.  Then, I just tried to modify that function to create two text bubbles that pop up above the heads of enemies during the action -- a large one for longer discussions, and a short one for exclamations like "Ouch!."  When my enemy enters the "damaged" state, I have it call ShowMessage() on one frame.  This works fine for the small bubble but doesn't show a message for the large one.  

 

Otherwise, I didn't mess with any of the internals of Tango.  If it ain't broke, don't mess with it...



#219 C-Dawg

C-Dawg

    Magus

  • Members

Posted 23 December 2015 - 11:05 PM

Hey Saffith:

 

"TANGO_AUTO_ADVANCE_TIME" doesn't appear anywhere in Tango.txt and it's not recognized as an attribute by Tango.  Did I download an old version?



#220 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2015 - 01:30 AM

The main tango.zh file is used for global settings. It's in there, on line 23.

#221 C-Dawg

C-Dawg

    Magus

  • Members

Posted 24 December 2015 - 01:46 AM

That's weird.  I wonder why my "find" function wasn't getting it.  Eh, whatever. 

 

Is there a way to make text windows automatically close, or do they always wait for a player to hit A or B before closing?

 

Also, check your PMs in a minute.



#222 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2015 - 01:49 AM

If the auto advance flag is set, they'll close automatically. You can also use @close() or Tango_ClearSlot().

#223 C-Dawg

C-Dawg

    Magus

  • Members

Posted 24 December 2015 - 11:07 AM

So, I can't seem to fix my problems.

 

PROBLEM 1 - My "large" style just freezes the player without actually displaying any text.  L and R Small styles work fine.  What gives?

 

void SetUpLargeStyle()
{
    // This is Saffith's suggestion on how to set up minimal, working Tango.
    // Patterend after his NAVI style.

    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_TILE);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_BACKDROP_TILE, 869);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_BACKDROP_CSET, 0);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_BACKDROP_WIDTH, 6);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_BACKDROP_HEIGHT, 5);
    
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_FONT, TANGO_FONT_GUI_NARROW);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_X, 6);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_Y, 6);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_WIDTH, 34);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_HEIGHT, 16);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_CSET, 0);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_COLOR, 15);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_SPEED, 2);
    Tango_SetStyleAttribute(STYLE_LARGE, TANGO_STYLE_TEXT_SFX, 63);
    
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_FLAGS, TANGO_FLAG_AUTO_ADVANCE);
}

void SetUpSmallLStyle()
{
    // This is Saffith's suggestion on how to set up minimal, working Tango.
    // Patterend after his NAVI style.

    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_TILE);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_BACKDROP_TILE, 949);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_BACKDROP_CSET, 0);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_BACKDROP_WIDTH, 3);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_BACKDROP_HEIGHT, 3);
    
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_FONT, TANGO_FONT_GUI_NARROW);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_X, 6);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_Y, 6);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_WIDTH, 34);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_HEIGHT, 16);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_CSET, 0);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_COLOR, 15);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_SPEED, 2);
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_TEXT_SFX, 63);
    
    Tango_SetStyleAttribute(STYLE_LSMALL, TANGO_STYLE_FLAGS, TANGO_FLAG_AUTO_ADVANCE);
}

 

PROBLEM 2 - Neither of the text bubbles goes away on their own; they persist until the player pushes a button when they're done scrolling.



#224 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2015 - 12:49 PM

There's a mistake in there - SetUpLargeStyle() is setting flags for the small style. The version you sent me isn't like that, but that one sets LSMALL's flags instead of RSMALL's.

The large style isn't working because there isn't space allocated for it. You've got three different styles, but it's only set up to allow two. You need to set __TANGO_NUM_STYLES to 3 and increase the size of __Tango_Styles[] to 78.
(I should probably increase some of the default limits next update...)

I don't think this is a factor, but in your global script, you've got:
Tango_Update1();
Waitframe();
Tango_Update2();
That should be:
Tango_Update1();
Waitdraw();
Tango_Update2();
Waitframe();

One other thing you may want to do is add more slots, since it looks like you could potentially have several active at once. That would involve increasing __TANGO_NUM_SLOTS, making __Tango_SlotData[] bigger, adding to __Tango_SlotDefs[], and probably increasing the size of __Tango_Buffer[]. I know it's a bit complicated, so I'd be glad to help out with that.
You don't have to do that, though. ShowString() might fail occasionally, but you're not doing anything with the slot afterward, so it won't cause any problems.

#225 C-Dawg

C-Dawg

    Magus

  • Members

Posted 24 December 2015 - 04:57 PM

I can foresee needing at least four styles:

 

1. Small text bubble, on the left of the speaker;

2. Small text bubble, on the right of the speaker;

3. Large text bubble, pointing up;

4. Large text bubble, pointing down.

 

The former two are for short interactions or exclamations, the latter two being for longer exposition.  So, if I want four, I increase ___TANGO_NUM_STYLES to 4 and increase __Tango_Styles[] to... something?  Not sure how the two relate.

 

EDIT: Figured it out.  Perhaps I should read your comments before I complain, hm?


Edited by C-Dawg, 24 December 2015 - 05:23 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users