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 / Countdown timer

Author
Message
SAK
15
Years of Service
User Offline
Joined: 16th Nov 2009
Location:
Posted: 8th Jun 2010 01:24
Are someone know how to make countdown timer when enteryng in zone,and when it finish you are dead.Unleashed you have 5 minutes.

Studio
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 8th Jun 2010 16:40
Easiest way would be using Project Blue and the script below:

desc = countdown

:state=0:dimvar=timer,setvar=timer 300,etimerstart,state=1
:state=1,etimergreater=1000:subvar=timer 1,etimerstart
:state=1,varless=timer 1:plraddhealth=-100,state=2

:state=2:setvar=timer 300,etimerstart,state=1

:always:printval=%timer


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 8th Jun 2010 16:51
Does that variable substitution code work in vanilla FPSC X9 or X10 (setvar=n n) then? That'll probably explain why it didn't work for me xD. I just did addvar=2, and then like varequal=6 and it wouldn't work. And would this work if other scripts took advantage of the same variable or would it have to be the globalvar?

-SSG

--=. ,=--
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 8th Jun 2010 17:49
Quote: "Does that variable substitution code work in vanilla FPSC X9 or X10"


Nope, it won't work unfortunatley Stock uses a different variable system to PB, and it doesn't have the print val command.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 8th Jun 2010 18:43
I see. Thanks for that anyway . So the stock variable system is only var[whatever]=1 and not var[whatever]=binary1 binary2? Sorry if I'm not making sense, my English exam sucked all my intelligence out for the day .

-SSG

--=. ,=--
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 8th Jun 2010 19:12
I took that exam too. Did you take AQA? How did you find it?


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 8th Jun 2010 23:59
It was alright lol, add me on MSN for a chat .

-SSG

--=. ,=--
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 9th Jun 2010 00:46 Edited at: 9th Jun 2010 00:51
Here is a
for the stock engine that has a 5 second delay for testing.

Here is a
for the stock engine that should do your 5 minute delay.
Mind you, nothing else should be starting the global timer during that time or it will reset the timer and start the count again.

   Conjured Entertainment

 WARNING: Intense Madness
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 9th Jun 2010 00:52 Edited at: 9th Jun 2010 00:52
Thanks CE for providing code for the stock engine. There is a lot that can be coded using the stock engine without having to use a mod.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 10th Jun 2010 00:22
@Flatlander:

Marc said that it was the "easiest" way... not the only way.

This is especially true, if you want your timer to be displayed to the player. Although it is possible in vanilla FPSC, it's just easier with a Mod.


The one and only,


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 10th Jun 2010 01:29
Yup, you can use my mod too and it would be easier. But, maybe he doesn't want a mod.

Login to post a reply

Server time is: 2024-11-24 23:27:21
Your offset time is: 2024-11-24 23:27:21