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 / Help adding something to a flashlight script.

Author
Message
darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 28th Aug 2008 20:02
I am using the script found on this page (http://forum.thegamecreators.com/?m=forum_view&t=128879&b=23), not the main one, the one made by coffeegrunt about 3/4 down the first page. Is it possible to make it so that if the flashlight is off for more than three seconds, it will play a sound and the character dies? Please help me with this.



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Aug 2008 20:59
Ahhhhh, a horror game, eh? Where the character needs to use the flashlight to scare away the monsters and if the light is off for too long then the monster gets them?

Sounds like fun, here's how to do it:

1) When the light is turned "off", have it use the "timerstart" command to reset and start the timer.
2) In the "idle" state for having the light off check for "timergreater=3000".
3) If the above condition is true, then play a sound and just do "plraddhealth=-9999".


Enjoy!


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.
darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 28th Aug 2008 23:44
I think that should be simple enough for me to add, I will try it.



darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 28th Aug 2008 23:58
Hmm... I sort of got it to work, I have made it so that if the light is on for more than three seconds and then you turn it off, you die. But I can't get it to work the way I want or play a sound. Here is what I have:




zeza
16
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 29th Aug 2008 02:59
I think timerstart is an action.
darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 29th Aug 2008 21:21
Can anyone else help?



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Aug 2008 03:21
zeza's right, darimc. you're trying to use timerstart as a condition in your script but it's an action.


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.
darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 30th Aug 2008 06:01
Hmm... I'm not quite sure I understand.



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Aug 2008 23:12
On this line:


You have "timerstart" listed in with the conditions... but since it isn't a condition, then it won't work. It must be listed with the actions, which in this case your only action is "plraddhealth=-9999"


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.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 30th Aug 2008 23:26 Edited at: 30th Aug 2008 23:37
Aaahhh...that script I made that slowly dims the torchlight......

Let me see....



That should do it.....

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Aug 2008 23:34
@CG:

I figured the best way for that to work would be to start the timer when it sets the state to 4, and not when they release the key. Otherwise they could turn it off and have nothing happen to them so long as they held the key down.



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.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 30th Aug 2008 23:36
Ohh....woops.....

darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 31st Aug 2008 00:56
Thanks for the help guys.



darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 31st Aug 2008 01:04
I tried the script and I don't know why, but it didn't work and when I used it, the HUD would not appear.



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Aug 2008 01:25
Please paste the script as you have copied it, in full.

Some things will work in different versions of FPSC. One HUD issue that happens in older versions of FPSC occurs when you do not have the "desc" on it's own line.


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.
darimc
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Canada
Posted: 31st Aug 2008 01:37
This is exactly what I have:


P.S. Thanks both of you for helping me with this.



Login to post a reply

Server time is: 2024-11-24 14:05:49
Your offset time is: 2024-11-24 14:05:49