EDIT: IT WORKS. OH BOY YES. IGNORE ALL THAT STUPID POST BELOW. I TRIED IT ONCE AND IT FAILED. I TRIED IT AGAIN... AND IT WORKED! Dont know how... but Im not complaining!
Well a quick update, I've got a script that does the trick -
well, at least it's MEANT to!. it's linked to the Lift Button found in the sci-fi entitybank (I liked the look of that button!).
It happily spawns the first crate, but yeh you guys no I'm not much cop at scripting. I've tried my best here but unfortunately I fail to be terribly impressive at this thang.
Btw the script isn't finished yet, but I'm not gonna finish it obviously until I get it to work!
Oh yeah, the problem of course... It doesn't spawn the second crate. I didn't know what command to use to get it to change the "if used" field, and I didn't think there was one (or at least I didn't find it). So I thought the nearest thing was the "settargetname=" and "activatetarget=". Laugh at me if I misunderstood these commands and it doesn't work like that. And once your laughing stitch has gone... please give me a hand
I thought "settargetname=" would set the name for a target. Then "activatetarget=1" would activate the target. So, for example, settargetname=fall2, activatetarget=1 would activate fall 2 and make it spawn... come on, its only logical..
;Artificial Intelligence Script
;Header
desc = Switch for the puzzle game - spawn three different boxes
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=100,plrusingaction=1:state=20,setframe=0,plrsound=$0,activateifused=1
:state=20:settargetname=fall2,state=25
:state=25:incframe=0
:state=25,frameatend=0:state=30
:state=30,plrusingaction=0:state=35
:state=35:decframe=0
:state=35,frameatstart=0:state=40,setframe=0
:state=40:state=50
:state=50,plrdistwithin=100,plrusingaction=1:state=60,setframe=0,plrsound=$0,activatetarget=1
:state=60:settargetname=fall3,state=65
:state=65:incframe=0
:state=65,frameatend=0:state=70
:state=70,plrusingaction=0:state=75
:state=75:decframe=0
:state=75,frameatstart=0:state=80,setframe=0
:state=80:state=90
:state=90,plrdistwithin=100,plrusingaction=1:state=95,setframe=0,plrsound=$0,activatetarget=1
:state=95:incframe=0
:state=95,frameatend=0:state=100
:state=100,plrusingaction=0:state=105
:state=105:decframe=0
:state=105,frameatstart=0:state=110,setframe=0
:state=110:state=0
;End of script
If it's any help I even read through it in english, courtesy of X-Plain!
*** Switch for the puzzle game - spawn three different boxes ***
--- Begin ---
Repeat
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
If state is 0
Create a new HUD.
Put the HUD at 50 pixels to the right.
Put the HUD at 90 pixels from the top.
Load high quality HUD image "gamecoretextpressentertouse.tga".
Call this HUD "useswitchprompt".
Put the HUD away for now.
Create the HUD for display.
Set the state to 10.
End If
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
If player is within 100 units
Display useswitchprompt.
Fade HUD useswitchprompt away.
End If
:state=10,plrdistwithin=100,plrusingaction=1:state=20,setframe=0,plrsound=$0,activateifused=1
If state is 10 And player is within 100 units And is using this entity
Set the state to 20.
We'll start at the first frame of animation (Spawn).
Play the sound "$0" right where the player is standing.
Activate the entity specified in the "if used" property with a value of 1.
End If
:state=20:settargetname=fall2,state=25
If state is 20
Specify an entity by name to target.
Set the state to 25.
End If
:state=25:incframe=0
If state is 25
Get the next animation (Spawn) frame.
End If
:state=25,frameatend=0:state=30
If state is 25 And we are at the end of animation (Spawn)
Set the state to 30.
End If
:state=30,plrusingaction=0:state=35
If state is 30 And player is not using this entity
Set the state to 35.
End If
:state=35:decframe=0
If state is 35
Get the previous animation (Spawn) frame.
End If
:state=35,frameatstart=0:state=40,setframe=0
If state is 35 And we are at the beginning of animation (Spawn)
Set the state to 40.
We'll start at the first frame of animation (Spawn).
End If
:state=40:state=50
If state is 40
Set the state to 50.
End If
:state=50,plrdistwithin=100,plrusingaction=1:state=60,setframe=0,plrsound=$0,activatetarget=1
If state is 50 And player is within 100 units And is using this entity
Set the state to 60.
We'll start at the first frame of animation (Spawn).
Play the sound "$0" right where the player is standing.
Activate the entity that was earlier marked as the target.
End If
:state=60:settargetname=fall3,state=65
If state is 60
Specify an entity by name to target.
Set the state to 65.
End If
:state=65:incframe=0
If state is 65
Get the next animation (Spawn) frame.
End If
:state=65,frameatend=0:state=70
If state is 65 And we are at the end of animation (Spawn)
Set the state to 70.
End If
:state=70,plrusingaction=0:state=75
If state is 70 And player is not using this entity
Set the state to 75.
End If
:state=75:decframe=0
If state is 75
Get the previous animation (Spawn) frame.
End If
:state=75,frameatstart=0:state=80,setframe=0
If state is 75 And we are at the beginning of animation (Spawn)
Set the state to 80.
We'll start at the first frame of animation (Spawn).
End If
:state=80:state=90
If state is 80
Set the state to 90.
End If
:state=90,plrdistwithin=100,plrusingaction=1:state=95,setframe=0,plrsound=$0,activatetarget=1
If state is 90 And player is within 100 units And is using this entity
Set the state to 95.
We'll start at the first frame of animation (Spawn).
Play the sound "$0" right where the player is standing.
Activate the entity that was earlier marked as the target.
End If
:state=95:incframe=0
If state is 95
Get the next animation (Spawn) frame.
End If
:state=95,frameatend=0:state=100
If state is 95 And we are at the end of animation (Spawn)
Set the state to 100.
End If
:state=100,plrusingaction=0:state=105
If state is 100 And player is not using this entity
Set the state to 105.
End If
:state=105:decframe=0
If state is 105
Get the previous animation (Spawn) frame.
End If
:state=105,frameatstart=0:state=110,setframe=0
If state is 105 And we are at the beginning of animation (Spawn)
Set the state to 110.
We'll start at the first frame of animation (Spawn).
End If
:state=110:state=0
If state is 110
Set the state to 0.
End If
Forever
--- End ---