Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#106 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 15 April 2015 - 07:44 PM

Assuming you're using Saffith's functions, ShowString() will display a string (int array). If you want to show a string (AKA message) defined in ZQ, you'll want to use ShowMessage() instead.

 

If your own ShowString() actually does use a message, then I don't know what your problem is.



#107 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 15 April 2015 - 08:15 PM

Derp. Now that little function works perfectly.



#108 Unames

Unames

    Newbie

  • Members

Posted 19 April 2015 - 07:18 AM

I'm trying to use a menu in a function called from an item script. The menu displays correctly, but selecting an option does not run the code in the if statements at the bottom.

int choice = 0;
Tango_InitializeMenu();
Tango_AddMenuChoice(1, 80, 100);
Tango_AddMenuChoice(2, 120, 100);
Tango_AddMenuChoice(0, 160, 100);
Tango_SetMenuCursor(75, 8);
Tango_SetMenuSFX(6, 25, 40);
Tango_ActivateMenu(true);
while(Tango_MenuIsActive())
{
    choice = Tango_GetCurrentMenuChoice();
    Waitframe();
}
if(choice==1)
{
    ...            
}
else if(choice==2)
{
    ...
}


#109 justin

justin

    Adept

  • Members

Posted 19 April 2015 - 08:40 AM

Item scripts and functions called by then only last one frame. You can create an ffc from an item script though.

#110 Dwarlen

Dwarlen

    Experienced Forumer

  • Members

Posted 28 April 2015 - 11:25 AM

I'm trying to implement tango into my quest but I have a problem. While the text box is showing up properly, no text is being displayed. Though I can hear the sound of it getting printed out, I never see a thing.

 

Spoiler

 

I'm probably just not setting something up right, but I don't know what.

According to allegro Tango is properly loading the text. But, despite what allegro says, for some reason no text is showing.

 

Thanks in advance!



#111 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 28 April 2015 - 01:13 PM

You forgot to set TANGO_STYLE_TEXT_CSET and TANGO_STYLE_TEXT_COLOR for your style.



#112 Dwarlen

Dwarlen

    Experienced Forumer

  • Members

Posted 28 April 2015 - 01:18 PM

Ah! Thought it'd be something simple like that. Thanks MoscowModder, works perfectly now :D.



#113 nyrox

nyrox

    Doyen(ne)

  • Members
  • Location:Québec

Posted 30 April 2015 - 07:45 PM

you have a tutorial to include tango in a quest??



#114 Saffith

Saffith

    IPv7 user

  • Members

Posted 05 May 2015 - 04:28 PM

It's not trivial. The easiest way is to use tangoQuickStart.zh, but you'll also need some scripts that actually use it. I don't think there are any in the database, but you can use the ShowMessage() function to create or modify some fairly easily.

#115 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 09 May 2015 - 08:46 AM

I'm trying to use a menu in a function called from an item script. The menu displays correctly, but selecting an option does not run the code in the if statements at the bottom.

[ ... ]

Item scripts and functions called by then only last one frame. You can create an ffc from an item script though.

He means...



Like that.

Saffith: Is any of this code is no longer viable in recent Tango builds?

You could also probably turn it into a global function with some blood, and sweat, to save FFC slots.

Edited by ZoriaRPG, 09 May 2015 - 08:48 AM.


#116 Saffith

Saffith

    IPv7 user

  • Members

Posted 11 May 2015 - 12:50 PM

Nothing's changed lately that should break anything. The most likely issue in future releases is that saving and restoring a slot's state may require a larger array. That's unlikely to happen any time soon, though.

#117 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 May 2015 - 09:25 PM

Nothing's changed lately that should break anything. The most likely issue in future releases is that saving and restoring a slot's state may require a larger array. That's unlikely to happen any time soon, though.


As long as new indices are implemented in addition to old (expansion, rather than supplication), that's not going to be a problem.

I'll eventually need to do an update, transfer over all of my custom stuff, and see if it works.

#118 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 June 2015 - 01:26 PM

Post Beta 1.0.0 Integration...

Errors...

I managed to integrate Tango beta 1.0.0 into a side project, in place of the build that I was using, but now I'm puzzled at some errors that I'm seeing oin Allegro.log, as follows:
 

tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
tango.zh error 5
Script created lweapon 40 with UID = 3378
Script created lweapon 40 with UID = 3379
Script created lweapon 40 with UID = 3380
Script created lweapon 40 with UID = 3381
Invalid index (274) to local array of size 274
Invalid index (275) to local array of size 274
Enabled Max HP & MP

What I've Done

This is coming off a base Tango Beta 1.0.0 buold, in which I've modified the following in Tango.zh:

Changed the slotdefs to what I use by default:



I also import my custom styles:



and last, add a single menu:



Clearly, my slotstate[ ] array, and menustate[ ] arrays are the wrong sizes... I increased them to 278, and 61 respectively, and errors relating to them went away, for the present...

What are the correct sizes (min, and max) now, and in what file are they defined?

Aside from that, what is Tango Error 5?

Nothing that I do seems to quash that.

 

When running one of the menu functions (DrawString), I also receive this:

tango.zh error 6

...thus, I'm entirely lost. Is there a list of the internal error code numbers, lurking in the docs?

 

Update: I enabled full logging, and that gives these errors some definition:

 

Error 5:

Style was 2.0000; valid styles are integers from 0 to 1
tango.zh error: Invalid style specified.

Error 6:

tango.zh error: Invalid slot specified.
Slot was 3.0000; valid slots are integers from 0 to 1

Would someone please remind me, in what file of the Tango code, these values are set, so that I can re-patch them with all five slots that I use, and the expanded style numbers?

 

 

Found them. Here's what I had to do, to fix all of this:

 

In tango.zh:

 

Note that I also had to increase my buffer size, to accommodate things.

 

In the script:

 

 

menuState[ ] needed to be the same index size as float __Tango_Data[ ] .

 

I'm not sure if this is intended, or if I'm simply using it in an inappropriate manner, (or just that I'm doing things that weren't planned for standard use) but whatever function is doing a SizeOfArray() on menuState here, is using float __Tango_Data as its base size.


Edited by ZoriaRPG, 03 June 2015 - 02:01 PM.


#119 Saffith

Saffith

    IPv7 user

  • Members

Posted 03 June 2015 - 02:07 PM

tango.txt gives the array size each function requires. Passing in a larger array than necessary doesn't hurt, mind, and would provide some future-proofing. I'll make sure to add some validation to those for the next version.

#120 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 June 2015 - 02:37 PM

I'll look through it again. I'm also going to hack together a 'logging_medium.zh' that uses the string-based errors from logging_full, but doesn't log every single string that tango displays. I'd suggest that as a good default, as numbered errors as the default, are pretty meaningless.

 

I'm going with this, for the present:

 

loggingIntermediate.zh

 

I may need to add some custom errors for array size mismatches though...


Edited by ZoriaRPG, 03 June 2015 - 02:39 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users