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

Umm, we DO have global variables, you know...

4 replies · 2,382 views · Started 16 January 2007

I've seen suggestions for global variables, and I just want to clear this up: We already have them.

gd0-255 Global variables used throughout the quest, yes, they are saved in .sav

sd0-7 Screen variables. These are independent on a screen by screen, dmap by dmap basis.

However, do be very, very careful with these, as they are used internally by the Zscript compiler, so I would reccomend only using them if you only use Zasm stuff in your quest.

Thanks to Jman for explaining this to me...

It is, however, possible but unlikely that gd255 would ever be used, right? And the one below it?

Actually, _L_, after looking through a couple of Zscripts in the compiler output, I have only seen gd0 used, but it's still not too safe, as I don't know wether the compiler uses the others or not, as I am not a developer.

The compiler will only use up global variables if the ZScript asks for one, and will always allocate global variables starting at gd0 and working up.

Note that the above should be considered an informal tip and not part of the ZScript compiler specification; it's how the compiler currently works but not necessarily how it will always work.