Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / How to Implement Flashlight Srcipt?

Author
Message
eXone 42zero
18
Years of Service
User Offline
Joined: 31st Oct 2006
Location: 7!9
Posted: 31st Oct 2008 20:46
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)



Any suggestions will help!

Thanks,
[eX]

"There's more to life than being really, really, ridiculously good looking." - Derek Zoolander
eXone 42zero
18
Years of Service
User Offline
Joined: 31st Oct 2006
Location: 7!9
Posted: 31st Oct 2008 21:37
somebody? anybody?

"There's more to life than being really, really, ridiculously good looking." - Derek Zoolander
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Oct 2008 22:06
Well, the common way of doing this is to put a triggerzone on top of where the player starts, and just give the triggerzone the script.

You really should look into trying things first.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
eXone 42zero
18
Years of Service
User Offline
Joined: 31st Oct 2006
Location: 7!9
Posted: 31st Oct 2008 22:36
hmm
i need to start thinking like that...
i'll try it and see what i get

now, hang on

would i need to have the trigger zone over the entire level for it to work? or just where the player spawns?

"There's more to life than being really, really, ridiculously good looking." - Derek Zoolander
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Oct 2008 23:52
Just where the player spawns. Once the player enters the triggerzone it will pretty much act like an entity whose "ALWAYS ACTIVE" property is set to "yes". This makes settings up "process scripts" such as the flashlight rather painless.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
eXone 42zero
18
Years of Service
User Offline
Joined: 31st Oct 2006
Location: 7!9
Posted: 1st Nov 2008 00:55
oh snap
thanks man you've been a lot of help

"There's more to life than being really, really, ridiculously good looking." - Derek Zoolander

Login to post a reply

Server time is: 2024-11-24 13:46:20
Your offset time is: 2024-11-24 13:46:20