PDA

View Full Version : No ZScript command for GDD?



_L_
06-04-2007, 12:42 PM
I just noticed that the ZASM command "GDD" doesn't seem to have a matching ZScript function.

And while I'm at it, the method "NPCSymbols::addSymbolsCode()" in GlobalSymbols.cpp... doesn't seem to exist. Should it?

DarkDragon
06-04-2007, 08:17 PM
ZScript has built-in support for global variables and so direct access to GDD was never needed. Moreover providing such access would be dangerous, as by writing to GDD a user could unwittingly corrupt his global variables if he is not well-informed of ZScript's internal workings.
Only when ZASM and ZScript scripts need to intercommunicate do I see a need for explicit GDD access... unless this situation is coming up a lot I feel uneasy exposing more of the ZScript implementation than absolutely needs to be.

As for NPCSymbols::addSymbolsCode()... these methods give explicit ZASM bodies to the ZScript functions of that pointer type. Since NPC contains only variables, and no functions, I'm not sure what you'd put in there if you added it ;)

_L_
06-04-2007, 11:17 PM
Righto, then.

(I was wondering because I was asked if I could make a string control code (http://www.armageddongames.net/forums/showthread.php?t=95481) that refers to a global variable of some sort, and game->global_d[] seemed like a good bet. Evidently, though, I'll have to use something else!)

DarkDragon
06-06-2007, 12:16 AM
Hrm, good question. I suppose we could add a new set of variables for use in strings, or partition the global variables into those used by strings and those used by ZScript? I'm not sure; what do you think?