It's been awhile since I've posted any new scripts, so I figured I'd post my latest four that were developed mainly as experiments with the new variable system.
automed.fpi - An auto-med script that slowly heals you up to a certain amount (Default: 50). Loops sound $0 as you are healing (try using "audiobank\atmos\teleporthum.wav") and plays sound $1 if it is empty (try using "audiobank\scifi\scenery\doors\lock.wav").
;Artificial Intelligence Script
;Header
desc = Limited Health Station by Airslide
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=usemedprompt,hudhide=1,hudmake=display
;change this line to modify how much health the automed can provide
:state=0:localvar=1,setvar=50,state=1
:state=1:localvar=1
:state=1,plrdistwithin=100,vargreater=0:hudshow=usemedprompt,hudfadeout=usemedprompt
:state=1,plrdistwithin=100,plrusingaction=1,vargreater=0:loopsound=$0,state=2
:state=1,plrdistwithin=100,plrusingaction=1,varequal=0:sound=$1,state=3
:state=2:localvar=1
:state=2,vargreater=0,plrusingaction=1:decvar=1,plraddhealth=1,state=5
:state=2,varless=1:stopsound,sound=$1,state=3
:state=2,plrusingaction=0:stopsound,state=1
:state=2,plrdistfurther=100:stopsound,state=1
:state=3,plrusingaction=0:state=1
;change this line to modify how fast the automed provides health
:state=5:localvar=2,setvar=5,state=6
:state=6:localvar=2,decvar=1
:state=6,varless=1:state=2
;End of Script
plrhurtinzoneslow.fpi - Slowly damages the player in the zone, rather than every loop. Easily modifiable, good for radiation or something when you don't want it constantly hurting. You could even loop a sound like a geiger counter.
;Artificial Intelligence Script
;Header
desc = Plr Hurt In Zone Slowly by Airslide
;Triggers
:state=0,plrwithinzone=1:state=1
:state=1:plraddhealth=-1,state=2
;change this line to modify how fast it hurts the player
:state=2,plrwithinzone=0:state=0
:state=2:localvar=1,setvar=10,state=3
:state=3:localvar=1,decvar=1
:state=3,varless=1:state=1
;End of Script
medichealvar.fpi - A medic script for model pack 4's medic. You could easily add it to any other character and remove the hud if you don't have MP4. Gives you full health up to two times, then shakes his head when he has no more medkits.
;Artificial Intelligence Script
;Header
desc = Medic by Airslide
;Triggers
::animate=1
:state=0:localvar=1,setvar=2
:state=0:hudreset,hudx=50,hudy=70,hudimagefine=gamecore\huds\medicheal.tga,hudname=medicheal,hudhide=1,hudmake=display,state=1
:state=1:localvar=1
:state=1,plrdistwithin=80,vargreater=0:hudshow=medicheal,hudfadeout=medicheal
:state=1,plrdistwithin=80,plrusingaction=1,vargreater=0:state=2
:state=1,plrdistwithin=80,plrusingaction=1,varless=1:state=4
:state=2:plraddhealth=500,plrsound=audiobank\items\healthup.wav,localvar=1,decvar=1,state=3
:state=3,plrusingaction=0:state=1
:state=4:localvar=2,setvar=14,rotatehead=30,state=5
:state=5:localvar=2,decvar=1
:state=5,varless=1:rotatehead=-60,setvar=18,state=6
:state=6:localvar=2,decvar=1
:state=6,varless=1:resethead,state=3
;End of Script
medichealvar2.fpi - Same as above, but he'll start following you once you get close enough.
;Artificial Intelligence Script
;Header
desc = Medic by Airslide
;Triggers
:state=0:localvar=1,setvar=2,activate=1
:state=0:hudreset,hudx=50,hudy=70,hudimagefine=gamecore\huds\medicheal.tga,hudname=medicheal,hudhide=1,hudmake=display,state=1
:state=1:localvar=1
:state=1,plrdistwithin=80,vargreater=0:hudshow=medicheal,hudfadeout=medicheal
:state=1,plrdistwithin=80,plrusingaction=1,vargreater=0:state=2
:state=1,plrdistwithin=80,plrusingaction=1,varless=1:state=4
:state=1,activated=1,plrdistwithin=200:activate=2
:state=1,plrdistwithin=100:animate=1,rotatetoplr,freeze
:activated=1:animate=1
:activated=2,plrdistfurther=100:followplr=3,animate=5
:state=2:plraddhealth=500,plrsound=audiobank\items\healthup.wav,localvar=1,decvar=1,state=3
:state=3,plrusingaction=0:state=1
:state=4:localvar=2,setvar=14,rotatehead=30,state=5
:state=5:localvar=2,decvar=1
:state=5,varless=1:rotatehead=-60,setvar=18,state=6
:state=6:localvar=2,decvar=1
:state=6,varless=1:resethead,state=3
;End of Script
Well there you are. 4 simple scripts demonstrating the use of variables (mainly to time things
). I'll start messing with global variables next. I want to do something like RTCW where you can collect treasure and find secrets, and then it will tell you how many you got at the end of the level.