Hi,
Inspired by the recent posts on inventory systems I thought I'd have a go using the new GUI-X9 commands in FPSC v118.
I've head a little dead end, however, so i anyone can shead any light on the matter I'd be greatful.
So far I was simply trying to get three HUDs to appear, a background HUD, a Button HUD and a pointer. I've tried to implement my code in two ways and each way has a different problem.
Method 1: using a trigger zone
;Inventory System using GUI x9 by Ched Chetwood
desc = Inventory System
; Start GUI x9
:state=0:usegui=1,resetgui
; Load Images
:state=0:loadimage=Background myHUDs\background.tga
:state=0:loadimage=ButtonON myHUDs\buttonON.tga
:state=0:loadimage=ButtonOFF myHUDs\buttonOFF.tga
:state=0:loadimage=MousePointer gamecore\huds\pointer.dds
; Define HUDs
:state=0:makehud=InvBack Background Background 50 50
:state=0:makehud=Button ButtonOFF ButtonON 50 50,hudclickable=Button 1
:state=0:setcursor=MousePointer
; Hide all HUDs
:state=0:hideall,hidecursor
; Setup text for debugging
:state=0:fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtextfont=verdana,fpgcrawtextsize=18
; End of setup
:state=0:state=1
; Main Loop - Inventory access [I]
:state=1,keypressed=23 1:state=100
; Inventory Logic
:state=100:pausegame,showhud=InvBack,showhud=Button,showcursor,state=110
:state=110:updategui
:state=110,hudmouseup=Button 1:state=120
:state=120:hideall,hidecursor,resumegame,state=1
Problem: button does not acknowledge mouse click when "pausegame" is used - it does when "pausegame" isn't used, but then the moue pointer is locked.
Method 2:using the global level script
;AIScript from Wizard
;Inventory using GUI x9 added by Ched Chetwood
;Header
desc = Setup Wizard V117
; Start GUI x9
:state=0:usegui=1,resetgui
; Load Images
:state=0:loadimage=Background myHUDs\background.tga
:state=0:loadimage=ButtonON myHUDs\buttonON.tga
:state=0:loadimage=ButtonOFF myHUDs\buttonOFF.tga
:state=0:loadimage=MousePointer gamecore\huds\pointer.dds
; Define HUDs
:state=0:makehud=InvBack Background Background 50 50
:state=0:makehud=Button ButtonOFF ButtonON 50 50,hudclickable=Button 1
:state=0:setcursor=MousePointer
; Hide all HUDs
:state=0:hideall,hidecursor
; Setup text for debugging
:state=0:fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtextfont=verdana,fpgcrawtextsize=18
; Setup Level Stats
:state=0:sky=skybank\ww2\Gas
: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=5,hudy=5,hudimage=languagebank\english\gamecore\huds\lives.tga,hudtype=1,hudmake=display
:state=0:hudreset,hudx=4,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudtype=1,hudmake=numeric
:state=0:hudreset,hudx=15,hudy=5,hudimage=languagebank\english\gamecore\huds\health.tga,hudtype=2,hudmake=display
:state=0:hudreset,hudx=14,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudtype=2,hudmake=numeric
:state=0:hudreset,hudx=85,hudy=8,hudimage=gamecore\huds\ammo.tga,hudtype=3,hudmake=status
:state=0:hudreset,hudx=88,hudy=12,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudtype=3,hudmake=numeric
; Setup Game Menu
:state=0:hudreset,hudx=50,hudy=10,hudimage=languagebank\english\gamecore\backdrops\basic\gamemenu.tga,hudname=gamemenutitle,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=40,hudimage=languagebank\english\gamecore\backdrops\basic\loadgame.tga,hudtype=2,hudname=loadgame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=50,hudimage=languagebank\english\gamecore\backdrops\basic\savegame.tga,hudtype=3,hudname=savegame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=60,hudimage=languagebank\english\gamecore\backdrops\basic\exitgame.tga,hudtype=5,hudname=quitgame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=50,hudimage=languagebank\english\gamecore\backdrops\basic\saving.tga,hudname=savingprompt,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=70,hudimage=languagebank\english\gamecore\backdrops\basic\returntogame.tga,hudtype=4,hudname=returngame,hudhide=1,hudmake=button
:state=0:hudreset,hudx=50,hudy=50,hudimage=gamecore\huds\pointer.tga,hudname=pointer,hudhide=1,hudmake=pointer
:state=0:state=1
; Main Game
:state=1:fpgcrawtext=running
: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
; Main Loop - Inventory access [I]
:state=1,keypressed=23 1:state=100
; 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
; Inventory Logic
:state=100:showhud=InvBack,showhud=Button,showcursor,state=110,pausegame
:state=110:updategui
:state=110,hudmouseup=Button 1:state=120
:state=110,keypressed=23 1:hideall,hidecursor,resumegame,state=1
:state=120:hideall,hidecursor,resumegame,state=1
Problem: game pauses, but no HUD appears.
[url="http://raptr.com/No_Turn_Right?src=em_forum"]
[/url]