Quote: "You could put it in the script for HUD but that's not necessary.
Here's how I would do it.
1) Open notepad and type in the follow
:state=0,plrhealthless=60:loopsound=$0
2)Save it in the script folder as "plrhealthless_loopsound.fpi" or whatever is meaningful to you.
3) Place a trigger zone in your scene. Note: don't worry about the size of the zone, it does not matter; your script will be active across the whole level.
4) Right click on the trigger zone and change its main script to the script you made above. Change Sound0 in the trigger zone's properties to the sound you want to use.
"
There is an alternate method that will save you needing a trigger zone and just make it a permanent throughout the game..
First add the following to state=0 section of your levelsetup.fpi file
:state=0:hudreset,hudx=50,hudy=50,hudimage=gamecore\huds\lowhealth.png,hudtype=6,hudname=lowhealth,hudhide=1,hudmake=display
(make sure you have a hud image or icon for called lowhealth.png in the gamecore\huds folder of the FPDC X10 root folder
Also you will have to adjust the hudx and hudy numbers to make hud image line up on the screen where you want it to.)
And then add the following to the state=1 section of your levelsetup.fpi file
:state=1,plrhealthless=60:loopsound=audiobank\custom\yoursoundfile.ogg
:state=1,plrhealthless=60:hudshow=lowhealth
:state=1,plrhealthgreater=59:hudunshow=lowhealth
(make sure you added a custom folder to the audiobank folder in your Fpsc X10 root directory and place your sound file in it.)
that will save you having to add a trigger zone to every level and give you the desired hud and sound effect you are looking for.
the levelsetup.fpi file can be found at..
documents\fpsc x10 files\languagebank\english\gamebank\mygame
(OPEN it with notepad)
hope this helps
-Squalker