Hello everybody
I found a way here to make the "health head system" work without the hassle of editing the setup.fpi outside the FPSC-editor. I've only tested it in single player mode yet though but it works like a charm.
Put a trigger zone right ontop of the player start position. Set the following .fpi-script as the main script of the trigger zone:
;Artificial Intelligence Script
;Header
desc = Initializes The Player
;Setup Heads
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head0.dds,hudname=Health0,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head1.dds,hudname=Health1,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head2.dds,hudname=Health2,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head3.dds,hudname=Health3,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head4.dds,hudname=Health4,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head5.dds,hudname=Health5,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head6.dds,hudname=Health6,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head7.dds,hudname=Health7,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head8.dds,hudname=Health8,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head9.dds,hudname=Health9,hudhide=1,hudmake=display
:state=0:hudreset,hudx=76,hudy=20,hudimage=gamecore\huds\head10.dds,hudname=HealthA,hudhide=0,hudmake=display
;Triggers
:state=0,state=1
:state=1,plrwithinzone=1:state=10,activated=10
; Health Headimage Control
:state=10,plrhealthless=1:activate=1
:state=10,plrhealthless=11,plrhealthgreater=0:activate=2
:state=10,plrhealthless=21,plrhealthgreater=9:activate=3
:state=10,plrhealthless=31,plrhealthgreater=19:activate=4
:state=10,plrhealthless=41,plrhealthgreater=29:activate=5
:state=10,plrhealthless=51,plrhealthgreater=39:activate=6
:state=10,plrhealthless=61,plrhealthgreater=49:activate=7
:state=10,plrhealthless=71,plrhealthgreater=59:activate=8
:state=10,plrhealthless=81,plrhealthgreater=69:activate=9
:state=10,plrhealthless=91,plrhealthgreater=79:activate=10
:state=10,plrhealthgreater=99:activate=11
:state=10,activated=1:activate=0,hudreset,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health0
:state=10,activated=2:activate=0,hudreset,hudunshow=Health0,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health1
:state=10,activated=3:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health2
:state=10,activated=4:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health3
:state=10,activated=5:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health4
:state=10,activated=6:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health5
:state=10,activated=7:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health6
:state=10,activated=8:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health8,hudunshow=Health9,hudunshow=HealthA,hudshow=Health7
:state=10,activated=9:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health9,hudunshow=HealthA,hudshow=Health8
:state=10,activated=10:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=HealthA,hudshow=Health9
:state=10,activated=11:activate=0,hudreset,hudunshow=Health0,hudunshow=Health1,hudunshow=Health2,hudunshow=Health3,hudunshow=Health4,hudunshow=Health5,hudunshow=Health6,hudunshow=Health7,hudunshow=Health8,hudunshow=Health9,hudshow=HealthA
;End of Script
As the player spawns he/she will trigger the trigger zone and set off the script which will work in a kind of "global manner" handling the health heads through out the game. I use the
activated-variable to make sure the script doesn't turn on and off the huds all the time even when no change in health has occured. That slight bit of extra code will save performace. Should the health hud that is defined inside the setup.fpi-script give you trouble you can always just assign a blank image to it (an image with only transparent color).
This technique with the "in-game triggered global script" is also good if you want a global script for some other reason without having to mess with the setup.fpi-script or alike. You might forinstance want a mission task system telling the player what he/she has to do to progress in the game, or a conversation system or maybe a inventory hud system? You can put all your huds in the same "player init trigger script" - you will still be able to reach those huds (as in turning them on and off forinstance) from other scripts simply by using the hud name!