Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Strings in ZScript...?

5 replies · 1,900 views · Started 16 May 2008

I saw a mysterious reference to strings and arrays in the release notes for one of the last few builds (776/777), and decided to experiment a bit. I got the following to compile:

ffc script StringTest{

void run(){
int myChar = 'a'; // A single character.
int myUserName[11] = "ScaryBinary"; // An array of characters, proper length.
int myBadExample[5] = "Overflow?"; // An array of characters, wrong length.

// Dump some stuff to the log file.
Trace(myChar);
Trace(myUserName[0]);
Trace(myBadExample[0]);
}

}

The script dumped the following to the log file:
97.0000
83.0000
79.0000

The numbers dumped to the log file are the ASCII codes for the individual characters in the arrays. However, myBadExample[4] returned the question mark (I was expecting "f"...).

At any rate, I couldn't do much else (anything, actually) with the strings/character arrays...will we be getting some special string functions soon :naughty: ....or are there some secret ones implemented already? Ones that might let us draw whatever text we want, where we want on the screen? :giggle:

We're getting there. The string support in ZScript is very preliminary, and its only real use right now is to provide some sort of string data storage that you can screw around with on your own to do crap.

Which we appreciate. Still, it's not too much of a pain in the ass to use the regular string editor in Zquest for now.

I thought of returning the hour in Zelda Classic with a sign ffc script but it's impossible without making strings... Unless making 24 different strings, and it doesn't even include the minutes. O_0