Hey guys,
I'm currently working on a special spawn-script for my game.
The idear is: There is a switch in a room.
If the player uses the switch, a mashine stops/starts or a door opens
but also an npc WON'T spawn, because he did everything right.
If he doesn't uses the switch, the npc will spawn when he pases the trigger-zone.
I'm working with the variable-system and I'm using globalvar#1 to test if the player used the switch or not.
this is what I've got so far:
triggerscript:
;Artificial Intelligence Script
;Header
desc = Plr In Zone, activate entity specified in IF USED when Globalvar#1 = 1
;Triggers
:state=0,plrwithinzone=1:globalvar=1
:state=0,varequal=0:state=1
:state=1,activateifused=1,sound=$0,state=1
:state=1,plrwithinzone=0:state=0
switch-script:
;Artificial Intelligence Script
;Header
desc = Use Switch (animated lever) an set globvar#1 to 1
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=100,plrusingaction=1:state=1,setframe=0,plrsound=$0,activateifused=1
:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=3
:state=3,plrdistwithin=100,plrusingaction=1:state=4,plrsound=$1,activateifused=0,globalvar=1,setvar=1
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0
:state=5,plrusingaction=0:state=10
;End of Script
But it is not working.
If I don't use the switch and pass the trigger-zone,
nothing happens.
Any idears?