Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#376 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 26 August 2018 - 01:06 PM

Really? That actually surprises me a bit. But then again, Tango as a whole seems tragically underutilized. I guess it makes sense to an extent, seeing as the barrier for entry is a lot higher than with Ghost, but even so.

Documentation would be pretty great. I can hardly fault you for not wanting to put in even more work on top of making the header, but there's definitely a lot of learning through experimentation, and a bit of plugging my dose and diving into the actual header files to try to see what it's doing internally.

#377 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 01 September 2018 - 04:49 AM

Yeah, it's ultimately just plain old Screen->FastTile(). The various size values just tell it how to update the position.
I should probably document the details a bit better. I think it's never been an issue until now only because no one's actually tried to make a custom font before.

I made a custom font a couple weeks ago. Works like an absolute charm! As does everything I've done with tango, really; which includes a very fancy scripted shop (handled mostly by tango custom functions, and using only 3 ZQuest strings to handle all possible items; one for "Not enough rupees", one for "no empty bottles", and one with a call to @string for actually selling the item; the @string call inserting the name of the item, and inserting a numeric variable for the price.)

 

Now just to get a nice warp system in place... (Song of Soaring style, so gonna use a tango menu to allow you to select a location on the map that will be drawn).

 

Honestly, it may not be the EASIEST thing to use, but all the details ARE there. I may have modified a couple things to suit what I would like better (If you are waiting on a menu, scrolling up hides the menu cursor and prevents menu selecting; by default the menu cursor stays which draws over whatever text; also, I draw my own Up/Down scrolling arrows and my own "Press A to advance" because the built in ones weren't working as I would have expected. Wasn't difficult to modify at all, though.)

 

If you wanna see what I've done with tango, the latest demo of my quest has the stuff in it, including the fancy shop. Honestly, I don't know where this ques would be without it!



#378 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 06 September 2018 - 09:26 PM

Umm, quick help question: This ("@choice(1)Deposit@choice(2)Withdraw@choice(3)Nevermind@domenu()") in a string appears correctly, however choice 3 is unselectable? My "__TANGO_MAX_MENU_ITEMS" is set to 20. ???



#379 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 06 September 2018 - 11:38 PM

Nothing's obviously wrong there. The __Tango_Data array's also big enough, right? In 1.3, it should be 94 for 20 items. Any errors logged?
  • Emily likes this

#380 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 September 2018 - 07:24 AM

Nevermind, it's my custom crap.

 

Is there a way to get how many menu choices are set in the active menu?

Nevermind. There isn't a function, but I can read from the tango data. (In case you can't tell, I'm making my things VERY fancy. Now Right/Left will increment/decrement your menu choice pos regardless of where the pos's are on the screen, unless a bool param is passed as true, in which case it will handle default behavior.

Spoiler
Basically, I custom-draw a few things and have a scrolling behavior set up. By default, when scrolling while a menu is active, the menu cursor will not move even if the menu options are no longer on screen; so if you are not scrolled, I make the cursor invisible and prevent selecting from it. "waitingForA" is set when "@pressa()" is called, for the record. The "Advance Text" indicator by default wasn't quite working how I would expect, so I made my own, along with scroll up/down indicators.

 

The handleMessageSlot loop there is called right after I activate the slot. The main section of the loop will not run, unless either the message is fully displayed, waiting at a menu, or waiting at a @pressa() call. Otherwise, default tango behavior goes, aside from canceling any presses of start (don't want my scripted subscreen popping up in the middle of a message box!)


Edited by venrob, 07 September 2018 - 07:50 AM.


#381 cavthena

cavthena

    Apprentice

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

Posted 16 December 2018 - 08:00 PM

Not sure how to fix this error with Tango 1.3 and ZQ 2.53.

 

"Line 239: Syntax error, unexpected graphics, expecting identifier, on token bitmap tango.zh, line 264: error p01 : failure to parse imported file tango/1.3/user.zh."

 

Any help?



#382 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 16 December 2018 - 11:55 PM

"bitmap" must have been made a reserved word in 2.53. Just change the argument name to something else and it should be okay. There are four bits that'll need changed: user.zh lines 239, 251, 285, and 298.

#383 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 17 December 2018 - 07:38 AM

"bitmap" must have been made a reserved word in 2.53. Just change the argument name to something else and it should be okay. There are four bits that'll need changed: user.zh lines 239, 251, 285, and 298.

 

Hmm, that should only be in 2,55, unless I put it into the lexer unintentionally with an old commit. It is a reserved token in 2.55 though, as bitmap is a type, so it's not the worst thing to correct. I'll probably pull it out of 2.53 as it doesn't belong there.

 

P.S. The bitmap type is used to create user-defined bitmaps in a quest, beyond the extant rendertarget.h bitmaps.



#384 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 17 December 2018 - 09:52 AM

Not sure how to fix this error with Tango 1.3 and ZQ 2.53.

 

"Line 239: Syntax error, unexpected graphics, expecting identifier, on token bitmap tango.zh, line 264: error p01 : failure to parse imported file tango/1.3/user.zh."

 

Any help?

 

Are you certain that you are using 2.53 and not 2,55?

 

I checked the 2.53 source files, and the bitmap token is not reserved.



#385 cavthena

cavthena

    Apprentice

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

Posted 21 December 2018 - 09:14 PM

My bad according to the info it's version 2.54.

 

I'll give Saffith's method a try.



#386 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 December 2018 - 12:34 AM

My bad according to the info it's version 2.54.

 

I'll give Saffith's method a try.

 

You should advance to 2.55, as that has entirely replaced 2.54.

 

What is the build data of the version that you are using?



#387 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 07 May 2019 - 06:53 AM

Hi

 

Is there a way to get transparent rectangle backdrop into the dialog box like in Lttp?

 

here is what i have now:

--------------------------------------------------------------------------------------------------------------------------------------------

else if(size==STYLE_LTTP){
            Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_TILE, 26080);
            Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_CSET, 1);
            Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_WIDTH, 10);
            Tango_SetStyleAttribute(style, TANGO_STYLE_BACKDROP_HEIGHT, 5);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_FONT, TANGO_FONT_LTTP_OUTLINE);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_X, 24);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_Y, 12);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_WIDTH, 144);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_HEIGHT, 70);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_CSET, 9);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_COLOR, 2);
            Tango_SetStyleAttribute(style, TANGO_STYLE_TEXT_SPEED, 0);
            Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_COMBO, 8127);
            Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_CSET, 11);
            Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_CURSOR_MOVE_SFX, 66);
            Tango_SetStyleAttribute(style, TANGO_STYLE_MENU_SELECT_SFX, 67);
        }

-------------------------------------------------------------------------------------------------------------------------------------------

here is the FFC i use for it:

-------------------------------------------------------------------------------------------------------------------------------------------

ffc script Sign_TangoLTTP{
    void run(int message){
        while(true){
            if(StartTalking(this)){
                ShowMessage(message, TANGO_SLOT_NORMAL, WINDOW_STYLE_1, STYLE_LTTP,32, 32);
                while(Tango_SlotIsActive(TANGO_SLOT_NORMAL))
                        Waitframe();
                StopTalking();
            }
            Waitframe();
        }
    }
}

--------------------------------------------------------------------------------------------------------------------------------------------

And it looks like this now

zcSign.png


Edited by judasrising, 07 May 2019 - 06:54 AM.


#388 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 07 May 2019 - 09:46 AM

You need to use a complex backdrop for that. Create an array like this as a global variable:
int TextBox[]= {
    TANGO_DRAW_RECT_TRANS,
        0,       // CSet
        7,       // Color
        3, 3,    // X, Y offsets from slot position (pixels)
        144, 64, // Width, height (pixels)
    TANGO_DRAW_TILE,
        26080, // Tile
        1,     // CSet
        0, 0,  // X, Y (pixels)
        10, 5, // Width, height (tiles)
    TANGO_DRAW_END
};
The offsets and size may need tweaked a bit, and that's probably the wrong color.

Then change the TANGO_STYLE_BACKDROP_* settings to:
            Tango_SetStyleAttribute(STYLE_ZELDA, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_COMPLEX);
            Tango_SetStyleAttribute(STYLE_ZELDA, TANGO_STYLE_BACKDROP_DATA, TextBox);


#389 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 07 May 2019 - 09:51 AM

You need to use a complex backdrop for that. Create an array like this as a global variable:

int TextBox[]= {
    TANGO_DRAW_RECT_TRANS,
        0,       // CSet
        7,       // Color
        3, 3,    // X, Y offsets from slot position (pixels)
        144, 64, // Width, height (pixels)
    TANGO_DRAW_TILE,
        26080, // Tile
        1,     // CSet
        0, 0,  // X, Y (pixels)
        10, 5, // Width, height (tiles)
    TANGO_DRAW_END
};
The offsets and size may need tweaked a bit, and that's probably the wrong color.

Then change the TANGO_STYLE_BACKDROP_* settings to:
            Tango_SetStyleAttribute(STYLE_ZELDA, TANGO_STYLE_BACKDROP_TYPE, TANGO_BACKDROP_COMPLEX);
            Tango_SetStyleAttribute(STYLE_ZELDA, TANGO_STYLE_BACKDROP_DATA, TextBox);

Ah great thanks Saffith ,i think i got it now how it works.

 

Edit:Nope does not work now it shows what i have in WINDOW_STYLE 1

Edit2: now it works fine, i forgot to test with new savefile since i added things into global script

works.png

now just fix the offset and size


Edited by judasrising, 07 May 2019 - 04:12 PM.


#390 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 01 August 2019 - 04:38 PM

Hey, new update. No huge changes, but an important bugfix and some shiny new HTML documentation.
  • Lüt likes this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users