E.g. Press switch, one barrel spawns.
Press switch, barrel spawns again
press switch, barrel spawns again
etc etc. I am trying to make an item dispenser with the cash script but this seems to be the first step. Sadly the current scripts mean that you press the button and if your barrel is set to "can spawn 100 times", it will spawn 100 times all at once and the switch becomes useless after one use.
As a
workaround I have been using this:
;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=object2,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=object3,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
This is pix3d's multiple entity spawning script, but I am using it to just spawn 3 of the same item.
I have extended the script to 10 items in my game. The problem is I would like 100 and pasting and changing the states is horrible, not to mention I would need to have 100 barrel entities on one square waiting to spawn.
tl;dr: does anyone know how to make a resuable entity spawning switch