Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#16 Saffith

Saffith

    IPv7 user

  • Members

Posted 15 July 2013 - 02:52 PM

Since I already made the Tango and Cache joke, I guess I gotta be the one to say it: Why not just put some of this stuff directly into zc?

If there's a 2.60, I may put in what I can of it. You know how hard it is to add new stuff, though...
 

I expect that your goal here is to streamline all of the functions as well as resolve any game-breaking bugs?

That, and there are still a few more features I want to add, too.
 

I assume that Tango uses TTFs, and that I don;t need to re-draw each symbol as a tile?

No, has to be tiles, I'm afraid. There's no way to load external files like that.
 

Explain Gleeok, cause I have no idea what your talking aboout

This.

#17 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 16 July 2013 - 03:30 AM

Oh, rats. I had hoped that this would import a TTF and use it, as I believe that the in-built fonts are all embedded TTFs anyway. Would there be no way to replace something like 'Hylian' with another font? I know that ZScript can make external file calls via the import function, and ZC can compile game with .mid nd .mp3 files, so why not .ttf; perhaps replacing an in-build font with a different one.

 

Other than that, I thin this is brill! I will gl through the demo .qst in detail when I get some free time, but as this is an early Alpha, I am hesitant to start making anything rely on it.

 

Do you think you could work out a streamlined dialogue box and context menu as you perfect this? I'm sure you've played the original DQ games, with Yes/No/Etc dialogue and with the actions menu. A basic set-up with those kinds of functions would IMHO add a lot to a game in ZC. I think that would be my initial focus with this, along with some custom string messages in Zlraec; the only problem there is that only those who have read my stories or participated in my RPGs will know anything about the language. :P



#18 Saffith

Saffith

    IPv7 user

  • Members

Posted 18 July 2013 - 08:38 PM

Updated. Not a huge update as far as functionality, but it's less buggy now. Documentation still sucks.

 

Oh, rats. I had hoped that this would import a TTF and use it, as I believe that the in-built fonts are all embedded TTFs anyway. Would there be no way to replace something like 'Hylian' with another font?

Not really. They're stored in an external file, and ZC doesn't have any other way of getting font definitions. You can certainly edit the file; I know Japanese players commonly use an modified version that provides kana. That's currently the only way to do it.
 

I know that ZScript can make external file calls via the import function, and ZC can compile game with .mid nd .mp3 files, so why not .ttf; perhaps replacing an in-build font with a different one.

Yeah, but those are for certain data types that ZC handles certain ways. You can't import arbitrary data.
 

Do you think you could work out a streamlined dialogue box and context menu as you perfect this? I'm sure you've played the original DQ games, with Yes/No/Etc dialogue and with the actions menu.

I haven't implemented all the necessary functions yet, but I'm thinking a menu would look something like this:
int line1[]="@choice(1)Talk@tab(40)@choice(2)Equip";
int line2[]="@choice(3)Check@tab(40)@choice(4)Items";
int menu[]={ line1, line2 };

Tango_ClearString(menuID);
Tango_SetStringStyle(menuID, STYLE_MENU);
Tango_SetStringArray(menuID, menu);
Tango_ShowTextMenu(menuID);

while(Tango_MenuIsActive())
    Waitframe();

int choice=Tango_GetLastMenuChoice();

if(choice==M_TALK)
    Talk();
else if(choice==M_CHECK)
    Check();
else if(choice==M_EQUIP)
    Equip();
else if(choice==M_ITEMS)
    Items();
That's only slightly simpler than how you'd do it with the current version, though.

#19 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 18 July 2013 - 10:40 PM

And I thought Ghost.zh was awesome.

 

15/5. Way2go. I must use this in Solaris. This is awesome.

 

(Yes, I heard you when you said it was in Alpha. Maybe I can give you some helpful feedback.)



#20 Saffith

Saffith

    IPv7 user

  • Members

Posted 21 October 2013 - 10:52 PM

Finally, another update. Aside from bug fixes and more validation, here's the major new stuff:
  • New functions: Tango_Sync(), @sync(), @else(), @elseif(), @goto(), @close(), @pressa(), @menuwait()
  • New variable: @style
  • Persistent string style flag
  • Complex backdrops can now have text
  • It's possible (optionally) to cancel from menus now
  • New input functions allow you to change what buttons are used
  • String control code \25 works in messages now
I might've missed a few things there.

If you're already using it, a couple of things will need updated. The newline character is now 26 (since that's how \25 is stored), @domenu() now takes an argument, and @waituntil(@chosen) is no longer needed afterward. @menuwait() is used when something other than the string creates the menu.

Edit: And now I've found a couple of problems. :P If you don't want errors in allegro.log, change these bits, both in tango/common.zh.
At the end of __Tango_SetCurrentString(), replace
    __Tango_Data[__TCS_FONT]=
      __Tango_Styles[styleStart+TANGO_STYLE_TEXT_FONT];
with
    if(style!=TANGO_INVALID)
        __Tango_Data[__TCS_FONT]=
          __Tango_Styles[styleStart+TANGO_STYLE_TEXT_FONT];
    else
        __Tango_Data[__TCS_FONT]=TANGO_INVALID;
And in __Tango_GetStringFlags(), add a bit after the first line:
    int dataStart=stringID*__TANGO_SIZEOF_DATA;
    if(__Tango_StringData[dataStart+__TSDIDX_STYLE]==TANGO_INVALID)
        return 0;


#21 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 22 October 2013 - 12:03 PM

Sounds awesome! A few questions:

 

1. What are sync and Tango_Sync for?

2. What's the "Persistent string style flag" and how do I use it?

3. What's the difference between string control code \25 and the old char(25)?

4. Do you have an example for drawing text in the frame?



#22 Saffith

Saffith

    IPv7 user

  • Members

Posted 22 October 2013 - 01:14 PM

1. What are sync and Tango_Sync for?

Synchronizing two strings or a string and a script. The demo has an example of each. The first one to reach a sync point stops and waits for the other to reach the corresponding sync point. They're a lot like sync nodes in SpaceChem, if that helps.
You could do it before by setting a variable, the way the Link and Zelda example used to work. This way's just more convenient.
 

2. What's the "Persistent string style flag" and how do I use it?

Shoot, I completely forgot to document it. Sorry. :P
With the persistent flag, a string won't disappear and won't prompt you to press A when it's finished. It's a style flag, TANGO_FLAG_PERSISTENT; just OR it together with the others.
 

3. What's the difference between string control code \25 and the old char(25)?

The string control code only works in ZC messages, not ZScript strings. Aside from that, the only difference is a technical one.
Character 26 (previously 25) is interpreted as a line break. In the case of the control code, the code is actually stored as character 26. @char(26) is a function that inserts the character into the string when it runs.
I meant for \25 to work all along... I just forgot before that ZC stores control codes one higher than their values.
 

4. Do you have an example for drawing text in the frame?

I didn't include one, but the format is TANGO_DRAW_TEXT, string, font, CSet, color, x, y. The font is a Tango font, and the string pointer has to be valid as long as the string is displayed.
Added into Zelda's backdrop from the demo (in the ugliest possible color):
int zeldaStr[]="Zelda";

int zeldaFrame[]= {
    TANGO_DRAW_RECT_TRANS,
        0, 11,   // CSet, color
        4, 5,    // X, Y (pixels)
        216, 70, // Width, height (pixels)
    TANGO_DRAW_TILE,
        1420, // Tile
        9,    // CSet
        8, 8, // X, Y (pixels)
        4, 4, // Width, height (tiles)
    TANGO_DRAW_TILE,
        1300,
        1,
        0, 0,
        14, 5,
    TANGO_DRAW_TEXT,
        zeldaStr,             // String pointer
        FONT_ORACLE_EXTENDED, // Font
        11, 14,               // CSet, color
        27, 56,               // X, Y
    TANGO_DRAW_END
};


#23 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 22 October 2013 - 03:36 PM

Pasting that code over the existing ZeldaFrame causes ZC to freeze and need force-quitting.

 

My attempt to figure out the format for myself caused the exact same result.

 

Aaaaand.... removing the text part from the frame still makes ZC freeze. Uh oh.
 



#24 Saffith

Saffith

    IPv7 user

  • Members

Posted 22 October 2013 - 05:35 PM

Any chance it's an old save issue? I'm not having problems with it, so I don't know what else to say.

#25 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 22 October 2013 - 06:12 PM

No, I haven't been saving in either of them.



#26 Saffith

Saffith

    IPv7 user

  • Members

Posted 22 October 2013 - 08:33 PM

Try downloading everything again, maybe? If it were just your own quest, that'd be one thing; if even the demo scripts are causing problems, I think either something's wrong with your files or it's an issue with ZC.
If redownloading doesn't fix it, send me the hanging demo quest and I'll see if I can do anything with it.

#27 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 28 October 2013 - 11:05 PM

After returning from another ZC mini-hiatus, I tried re-downloading everything, fixing a couple of little errors, and... it all works fine. Thanks!

 

For my next trick, I'm going to try to center my chat labels without making ZC explode!



#28 Saffith

Saffith

    IPv7 user

  • Members

Posted 29 October 2013 - 01:07 PM

I'll add this for the next version:
 
int Tango_GetStringWidth(int str, int font)
{
    int width=0;
    int character;
    
    for(int i=0; str[i]!=0; i++)
    {
        character=str[i];
        
        if(character<TANGO_CHAR_SPACE)
            continue;
        
        if(font[__TANGO_FONT_PITCH]==TANGO_FONT_MONOSPACE)
            width+=font[__TANGO_FONT_WIDTH];
        else
            width+=font[character+__TANGO_FONT_ASCII_TO_TANGO];
    }
    
    return width;
}


#29 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 October 2013 - 04:18 PM

Oh, thanks. In the meantime I wrote my own using your GetCharWidth(), so it's working fine.



#30 Saffith

Saffith

    IPv7 user

  • Members

Posted 12 November 2013 - 05:54 PM

Because of the limited space in ZC's strings, I'm thinking of shortening the names of some functions. @equal to @eq, @greater to @gt, @increment to @inc, etc. Would that actually be helpful, or would it just make stuff less clear?

Also, there's an issue of terminology I've been failing to deal with. There are three significant things that might be called "strings": ZC strings (Quest -> Strings), ZScript strings (character arrays), and Tango strings (those loaded into Tango_StringBuffer). Currently, I'm using "message" for the first and "string" for the others. I'd rather use distinct names for all three, but I haven't been able to come up with anything I like. Any thoughts?


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users