Global Arrays

Discuss all aspects related to modding Zandronum here.
Post Reply
Professor Pants
New User
Posts: 12
Joined: Sun Sep 23, 2012 4:29 am
Contact:

Global Arrays

#1

Post by Professor Pants » Sat Oct 06, 2012 10:47 pm

Is it possible to change the value of an element in a global array, from a script executed through a particular map?

EDIT: I mean specifically with an array of strings, not integers. Integers seem to work, but strings seem to get cleared out. (From the declaration in the global script maybe?: global str 1:weapons[]; But how else would I do it? Besides, when defining an integer array the same way, THAT seems to work. Are dynamic global string arrays just not possible?)


EDIT2 (More clear): Is it possible to change the value of an element in a global array through a script run from a map's BEHAVIOR lump, and maintain that same value until a new game is started? I already made this work with integers, but strings always reset whenever exiting a level.
Last edited by Professor Pants on Sun Oct 07, 2012 1:56 pm, edited 1 time in total.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Global Arrays

#2

Post by Ijon Tichy » Sun Oct 07, 2012 2:05 am

"str" is an alias for "int" in ACS
and my guess would be that the strings, despite being in a global array, are not kept in the string table (which would make sense) - after all, they are just integers

Professor Pants
New User
Posts: 12
Joined: Sun Sep 23, 2012 4:29 am
Contact:

RE: Global Arrays

#3

Post by Professor Pants » Sun Oct 07, 2012 2:06 am

So basically it can't be done?

Post Reply