I've a question about using the variable system.
I've had some weird phenomenon with the variables lately but I think the error is in my understanding of load order.
I just started messing around with declaring and instantiating the variables in the setuplevel.fpi. I do nothing else other than that in the setup script.
In the game, I have the following entity script:
:state=0:coloff,incglobalvar=invasive 1,state=1
:state=1,plrdistwithin=100:state=2
:state=2,scancodekeypressed=19,objectinview=1:rundecal=2,floatrate=5,state=3
:state=3,plrdistfurther=101:rundecal=0,floatrate=0,state=1
:state=3,plrdistwithin=100,scancodekeypressed=0:state=4
:state=4:decglobalvar=invasive 1,runfpi=disappear1.fpi
My understanding of this script is that should increment the global variable "invasive" by 1 for every instance of this script. I have 55 invasive entities in the game, so the value should be 55 when the game loads. Everytime the player kills an invasive, the script should decrement the value by 1.
However, the opposite occurs. The game starts out with invasive equal to zero and with each entity you kill, the counter goes up.
HOWEVER, I put the following script in a trigger zone, just as a test:
:state=0,globalvarequal=invasive 10:quitgame=1
Well, guess what? That script executes as TRUE the second the game starts.
So anyway, that seems contradictory to the first example leaving me confused as to what is really going on here. Any help is greatly appreciated.