Quote: "Thanks for the response. I have tried to accomplish what I need with a script and the scancode key pressed. I think however because the health hud is part of the global script I have to edit the levelsetupini which I have tried and I can't seem to get it to work. I just thought id pose the question and see if there was something I was missing."
The huds defined in the script are only controlled by that script. If the "setuplevel.fpi" defines the huds, then only that script will control it. You can't control huds in a script that does not define them.
However, I have a development where we can enable/disable the health and numeric huds via key. In order for it to work, I had to remove them from the "setuplevel.fpi" script, then put in a script in the level(s).
Here is the "setuplevel.fpi" script for the development. Notice I've commented out the health, weapon, and numeric huds.
;AIScript from Wizard
;Header
desc = Setup Wizard
; Setup Level Stats
:state=0:sky=skybank\natural\ngt
:state=0:music=audiobank\music\generic\main.wav,musicvolume=50,soundscale=25
:state=0:fog=0,fogred=0,foggreen=0,fogblue=0
:state=0:ambience=25,ambiencered=255,ambiencegreen=255,ambienceblue=255
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1024,hudsizey=768,hudimage=gamecore\huds\fader.tga,hudhide=1,hudtype=3,hudmake=internal
:state=0:hudreset,hudx=50,hudy=50,hudred=128,hudgreen=0,hudblue=0,hudsizex=1024,hudsizey=768,hudimage=gamecore\huds\eyehud.tga,hudhide=1,hudtype=2,hudmake=internal
:state=0:hudreset,hudx=50,hudy=50,hudred=128,hudgreen=128,hudblue=128,hudsizex=1024,hudsizey=768,hudimage=gamecore\huds\zoom.tga,hudhide=1,hudtype=4,hudmake=internal
;:state=0:hudreset,hudx=10,hudy=90,hudimage=gamecore\huds\Kube\Kube_Health_HUD.png,hudtype=1,hudmake=display
;:state=0:hudreset,hudx=13.75,hudy=85,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\blacknumeric.dds,hudtype=1,hudmake=numeric
;:state=0:hudreset,hudx=,hudy=,hudimage=,hudtype=2,hudmake=display
;:state=0:hudreset,hudx=12.50,hudy=94.75,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\blacknumeric.dds,hudtype=2,hudmake=numeric
; Setup Game Menu
:state=0:hudreset,hudx=50,hudy=10,hudimage=languagebank\english\gamecore\backdrops\Kube\Kube_Menu.png,hudname=gamemenutitle,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=40,hudimage=languagebank\english\gamecore\backdrops\Kube\Kube_button_load.png,hudtype=2,hudname=loadgame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=50,hudimage=languagebank\english\gamecore\backdrops\Kube\Kube_button_save.png,hudtype=3,hudname=savegame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=60,hudimage=languagebank\english\gamecore\backdrops\Kube\Kube_button_exit.png,hudtype=5,hudname=quitgame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=70,hudimage=languagebank\english\gamecore\backdrops\Kube\Kube_button_return.png,hudtype=4,hudname=returngame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=50,hudimage=gamecore\huds\Kube_pointer.png,hudname=pointer,hudhide=1,hudmake=pointer
:state=0:state=1
; Main Game
:state=1,escapekeypressed=1:pausegame,state=2
:state=1,scancodekeypressed=197:pausegame,state=11
:state=1,scancodekeypressed=64:hudshow=savingprompt,quicksavegame,pausegame,state=21
:state=1,scancodekeypressed=67:quickloadgame,state=31
:state=11,scancodekeypressed=0:state=12
:state=12,scancodekeypressed=197:resumegame,state=13
:state=13,scancodekeypressed=0:state=1
:state=21,scancodekeypressed=0:hudunshow=savingprompt,resumegame,state=1
:state=31,scancodekeypressed=0:state=1
; Game Menu
:state=2,escapekeypressed=0:state=3
:state=3:hudshow=gamemenutitle,hudshow=loadgame,hudshow=savegame,hudshow=quitgame,hudshow=returngame,hudshow=pointer,state=4
:state=4,hudselectionmade=2:loadgame
:state=4,hudselectionmade=3:savegame,state=6
:state=4,hudselectionmade=5:continuegame,destroy
:state=4,hudselectionmade=4:state=6
:state=4,escapekeypressed=1:state=5
:state=5,escapekeypressed=0:state=6
:state=6:hudunshow=gamemenutitle,hudunshow=loadgame,hudunshow=savegame,hudunshow=quitgame,hudunshow=returngame,hudunshow=pointer,resumegame,state=1
Here is the script I use to show/hide the health hud via "H" key. It is attached to a trigger in each level we design.
;Artificial Intelligence Script
;Header
desc = Health and Numeric Hud Control
;Triggers
:state=0:hudreset,hudx=10,hudy=90,hudimage=gamecore\huds\Kube\Kube_Health_HUD.png,hudtype=1,hudname=health,hudhide=1,hudmake=display
:state=0:hudreset,hudx=13.75,hudy=85,hudsizex=16,hudsizey=16,hudimage=gamecore\huds
\blacknumeric.dds,hudtype=1,hudname=healthnum,hudhide=1,hudmake=numeric
:state=0:hudreset,hudx=12.50,hudy=94.75,hudsizex=16,hudsizey=16,hudimage=gamecore\huds
\blacknumeric.dds,hudtype=2,hudname=lifenum,hudhide=1,hudmake=numeric
:state=0:state=1
:state=1,scancodekeypressed=35:hudshow=health,hudshow=healthnum,hudshow=lifenum,etimerstart,state=2
:state=2,etimergreater=500,scancodekeypressed=35:hudunshow=health,hudunshow=healthnum,hudunshow=lifenum,etimerstart,state=3
:state=3,etimergreater=500:state=1
;End of Script
This works for us in the current version we run. I can toggle the health, lives, and numeric hud at any time and toggle off. Feel free to modify it to your needs, but it gives you a starting point.
There's no problem that can't be solved without applying a little scripting.