Hey everybody
I'm making a game with zombies in it and one of the levels has a long dark hallway in it with a few zombies which is intended to scare the **** out of the player.
Well, I thought it would have a greater dramatic effect if the player had a flashlight with a battery that ran out before the player got to the end. So, being the good forum-goer that I am, I did a search and found the official community guide which indeed has a flashlight script in it:
http://forum.thegamecreators.com/?m=forum_view&t=131868&b=21
Only one problem: the guide doesn't tell you how to implement it!
I'm not sure how to go about actually putting it into my game. The player start doesn't have a slot for a script, and there's no initGame method to put it in.
SO, I was wondering if anyoen knew where I could put the flashlight code to make it work.
For ease-of-use, here is the actual flashlight code:
(I have changed the key to press for the flashlight to CTRL because F is my game's Action key)
;Artificial Intelligence Script Flashlight script
;Header
desc = Flashlight Script
;Triggers
;HUDs to show
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\text\flash.dds,hudname=flash,hudhide=1,hudmake=display,state=9
:state=9:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\1.tag,hudname=1,hudhide=1,hudmake=display,state=10
:state=10:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\2.tag,hudname=2,hudhide=1,hudmake=display,state=11
:state=11:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\3.tag,hudname=3,hudhide=1,hudmake=display,state=12
:state=12:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\4.tag,hudname=4,hudhide=1,hudmake=display,state=13
:state=13:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\5.tag,hudname=5,hudhide=1,hudmake=display,state=14
:state=14:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\6.tag,hudname=6,hudhide=1,hudmake=display,state=15
:state=15:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\7.tag,hudname=7,hudhide=1,hudmake=display,state=16
:state=16:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\8.tag,hudname=8,hudhide=1,hudmake=display,state=17
:state=17:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\9.tag,hudname=9,hudhide=1,hudmake=display,state=18
:state=18:hudreset,hudx=11,hudy=90,hudimagefine=gamecore\text\flashlightv3\10.tag,hudname=10,hudhide=1,hudmake=display,state=1
:state=1,scancodekeypressed=29:hudshow=flash,sound=audiobank\flashswitch\flash.ogg,ambience=50,timerstart,state=2,fog=1,fogred=5,fogblue=5,foggreen=5
:state=2,scancodekeypressed=0:state=3
;Timers (battery life + recharge time)
:state=3,timergreater=1:hudshow=1
:state=3,timergreater=4000:ambience=48,hudunshow=1
:state=3,timergreater=4000:ambience=46,hudshow=2
:state=3,timergreater=8000:ambience=44,hudunshow=2
:state=3,timergreater=8000:ambience=42,hudshow=3
:state=3,timergreater=12000:ambience=40,hudunshow=3
:state=3,timergreater=12000:ambience=38,hudshow=4
:state=3,timergreater=16000:ambience=36,hudunshow=4
:state=3,timergreater=16000:ambience=34,hudshow=5
:state=3,timergreater=20000:ambience=32,hudunshow=5
:state=3,timergreater=20000:ambience=30,hudshow=6
:state=3,timergreater=24000:ambience=27,hudunshow=6
:state=3,timergreater=24000:ambience=24,hudshow=7
:state=3,timergreater=28000:ambience=21,hudunshow=7
:state=3,timergreater=28000:ambience=18,hudshow=8
:state=3,timergreater=32000:ambience=15,hudunshow=8
:state=3,timergreater=32000:ambience=12,hudshow=9
:state=3,timergreater=36000:ambience=9,hudunshow=9
:state=3,timergreater=36000:ambience=6,hudshow=10
:state=3,timergreater=37000:ambience=3,hudunshow=10
:state=3,timergreater=37000:hudunshow=flash,sound=audiobank\flashswitch\flash.ogg,ambience=0,state=1,fog=0,fogred=0,fogblue=0,foggreen=0
;HUDs to unshow
:state=3,scancodekeypressed=29:hudunshow=flash,sound=audiobank\flashswitch\flash.ogg,ambience=5,state=4,fog=0,fogred=0,fogblue=0,foggreen=0
:state=4:hudunshow=1
:state=4:hudunshow=2
:state=4:hudunshow=3
:state=4:hudunshow=4
:state=4:hudunshow=5
:state=4:hudunshow=6
:state=4:hudunshow=7
:state=4:hudunshow=8
:state=4:hudunshow=9
:state=4:hudunshow=10
:state=4,scancodekeypressed=0:state=1
;End of Script
Any suggestions will help!
Thanks,
[eX]
"There's more to life than being really, really, ridiculously good looking." - Derek Zoolander