PDA

View Full Version : tango.zh



Saffith
07-12-2013, 05:31 PM
tango.zh 1.2.0 and demo (http://www.purezc.net/index.php?page=scripts&id=247)

"Tango" is derived from "text augmentation." Shut up, it does too make sense.
tango.zh provides:

A simple way to display strings with any font, backdrop, sounds, etc.
The ability to extend built-in fonts with new characters or create entirely new fonts
An easy way to create menus
Extensible string scripting capabilities


The documentation is admittedly pretty daunting. If you're new to this, I'd suggest looking over the overview and basic usage sections of tangoUsage.txt, then tangoQickStart.zh.


In addition, here are a couple of related utilities:
Character list quest (https://www.dropbox.com/s/dnjl6z0opediny2/CharacterList.qst) - use this to browse all printable characters in the built-in fonts
Tile font helper quest (https://www.dropbox.com/s/adagef51ru1gch5/TileFontSizer.qst) - use this to create custom fonts
PC font converter (http://saffith.homestead.com/files/zc/other/ttftozc.zip)

Majora
07-13-2013, 12:59 PM
This header is currently in alpha. It is buggy and poorly documented, and any part of it may change without warning in future releases.


Have you considered a career with bethesda?

SUCCESSOR
07-14-2013, 01:58 AM
Is this what became of you trying to add font to ZC? I don't envy the effort in this. I'll definitely be checking it out though!

Saffith
07-18-2013, 09:40 PM
Yeah, it's a lot of work, but it's the fun sort.
Updates, anyway. Not a huge update as far as functionality, but it's less buggy now. Documentation still sucks.

Saffith
10-21-2013, 11: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;

Saffith
11-28-2013, 12:53 PM
Updated to beta 1. At this point, I'd consider it suitable for general use. I can't promise there won't be any compatibility-breaking changes before 1.0, but I don't expect any.

There have been several since alpha 3, however. Lots of things have been renamed, the font format has changed, and extended font characters now start at 256 instead of 127.

Also, it turns out a lot of built-in fonts have useful characters all the way up to 255. I made a character list utility quest to browse them with.

I have more to say, but I keep getting errors... I'll add more if I can.

Saffith
05-28-2014, 05:52 PM
Finally, another update. Sorry it's taken so long.
This will invalidate existing saved games.

Added optional support for string control codes
Added functions to save and restore state
Added functions to suspend a text slot indefinitely
Functions can take up to four arguments now
@domenu() takes a second argument specifying the initially selected choice
Several bug fixes

In addition, there's a new file included: tangoQuickStart.zh. This serves as both an easy way to try using Tango and a simple example of how to set it up.

There haven't been any big compatibility breaking changes. @domenu() no longer adds a line break automatically; I think that's the only thing you might have to update for.

There are a few more things I'd like to add, but they can wait until after 1.0. For now, I just plan to fix bugs and clean up.

Saffith
01-11-2015, 10:42 PM
Hey, it's finally done! Sorry it took so long. Again.

Saves using the last beta will be invalidated, but there shouldn't be any compatibility issues. The array sizes have changed again.

It's mostly bug fixes and cleanup, but there's one big new feature. You can now create custom variables. Tango_D[] is included by default, but it can be removed.
There are a few other little things, too. When a string is so long that it has to scroll down, you can now control the scrolling. There's a function to get the current slot when running a custom function. The demo scripts have been cleaned up quite a bit, too.

Saffith
01-05-2016, 03:57 PM
New version. Updating will invalidate any existing saves. Array sizes have changed, and TANGO_STYLE_MENU_CURSOR_WIDTH has been renamed TANGO_STYLE_MENU_CHOICE_INDENT.


Menus can now scroll up and down if they're too big to fit in the textbox. This won't work correctly unless each menu item fits on one line, however.
Added menu scrolling indicator style attributes.
Menu cursors can now move smoothly between choices.
In non-text menus, menu items can now be moved after they're placed.
Added cursor size style attributes and reworked drawing to allow highlight-style cursors.
Added centered and right-aligned text options for complex backdrops.
Added Tango_SlotIsFinished(), which returns true as soon as text is finished printing.
Added an option to log all messages, errors only, or nothing.
Added an optional onscreen notification when an error is logged.
Added Tango_ValidateConfiguration(), which will look for common configuration errors and write a report to allegro.log.
Changed the default configuration to allow more styles and menu items and enable string control codes.
Added tangoFAQ.txt, which will hopefully address some common inquiries.

ZoriaRPG
01-07-2016, 12:01 PM
I'm receiving an internal server error ( HTTP/1.1 500 ), when trying to download that package.

Saffith
01-07-2016, 01:40 PM
Seems to be working again.

Saffith
07-01-2016, 08:28 PM
Here's another thing: ttftozc.zip (http://saffith.homestead.com/files/zc/other/ttftozc.zip)
It's a program that'll create tile sheets and tango.zh font definitions from PC font files (TTF, OTF, FON). Nothing too fancy, but it should work okay.
It requires SDL2 and SDL2_ttf, which aren't included (see the readme). Also, the Mac version is untested because my dinky VM can't run it.

Tamamo
07-02-2016, 08:09 AM
Speaking of SDL2 when are we goring to switch ZC over to that, (Yes Saffith, I am partly joking since I know the answer)

Saffith
09-16-2016, 02:21 PM
Updated, and now in the database: http://www.purezc.net/index.php?page=scripts&id=247

* Added Tango_SetMenuAutosaveDest(), which allows a menu's state to be saved automatically when a selection is made.
* Added Tango_SetMenuFlags() and Tango_DeactivateMenu().
* A menu can now be persistent (i.e. it won't close when a selection is made).
* Tango_ActivateMenu() no longer takes an argument. The functionality is now handled by setting the TANGO_MENU_CAN_CANCEL flag.
* @domenu()'s first argument is now menu flags rather than a simple "can cancel" bool.
* Fixed an error in scrolling menus.
* Added tangoZHChangelog.txt.

Saffith
09-10-2017, 09:39 PM
Updated. Not a big update, but whatever.

Added Tango_GetSlotX() and Tango_GetSlotY().
__Tango_PressAdvance() now takes an argument indicating how long the slot has been waiting. This allows the slot to advance if A or B are held for a period of time.
It's now possible to highlight text in alternate colors with [[double brackets]]. You can set different colors for (( )) [[ ]] << >> and {{ }}.