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 / time runs out, end of level. but not if you get to winzone first?

Author
Message
Nike
15
Years of Service
User Offline
Joined: 2nd Dec 2008
Location: Finland
Posted: 17th Feb 2009 19:41 Edited at: 17th Feb 2009 19:48
Hi. I searched for 40 minutes and tried to find a script, that starts a timer when level starts, and if it runs out you will die or it will be end of the level. So you need to find the win zone if you dont want to die, i tried some technics that plystire scripted for some korean dude but they didn't work the way i wanted. So do you get the point?

1. Level starts, timer starts (or the timer starts when step on triggerzone?)

2. you run, you run and search for the winzone (toilet).

3. Time runs out, you die.

OR

3. you find winzone and advance to next level.

is there a way to do that by scripting?

I mean like help me to do it, dont give me a script how it works. try to point me in right drection : D Please help me with this

Straight from Finland ;P
Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 18th Feb 2009 00:59
Well, start the timer at the start of the level and when the timer gets less than 1 use plraddhealth=-10000.

- You know you're curious
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Feb 2009 03:40
Quote: "when the timer gets less than 1"


Shouldn't it be when the timer gets to a certain number?


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 18th Feb 2009 03:43 Edited at: 18th Feb 2009 04:06


Here apply that script to a trigger zone. I haven't tested it but it should work. By the way where it says 60000 that means 60 seconds so change that if you want a longer amount of time.

```````````````````````````````````````````````````````````````````

And since you want to learn how to script ill break down the script

:-separates conditions from actions(conditions always come first) and the line always starts with one

:state=0-this state has to be in every script because the engine looks for state=0

timerstart- this starts the timer

state=1-this tell it to move onto state=1 so.

:state=0:timerstart,state=1-this would tell the timer to start then move to state=1.
```````````````````````````````````````````````````````````````````

:state=1-another state that the engine has been told to move to(each state does not do a unique thing that other states don't except for state=0 because state=0 is what the engine looks for first so i could change the state=1 to state=10 and their would be no difference)

timergreater=-this is a condition(condition-ex-if something happened in this case if the timer is greater then an amount; timer must start with timerstart) it is measured in milliseconds so timergreater=1000 would be asking 'if the timer is greater then 1 second'

plraddhealth=this is an action (an action executes or does something) here it would add the amount of health to the player that we ask it to so if we had
:state=0:timerstart,state=1
:state=1,timergreater=1000:plraddhealth=10
that would add 10 health after 1 second. Or we could have
:state=0:timerstart,state=1
:state=1,timergreater=1000:plraddhealth=-10
that would take away 10 health after 1 second(because of the minus symbol

so here
:state=1,timergreater=60000:plraddhealth=-9999
after the state was asked to change to 1 it would wait till the timer was up and then take 9,999 health away from the player which would kill him.

so this code would



Tell the engine to start the timer and then go to state 1
it would move to state 1 and then wait till the timer is at 60 seconds once at 60 seconds it would then kill the player

]

Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 18th Feb 2009 03:52
Quote: "Shouldn't it be when the timer gets to a certain number?"

Ah, well it seems I am not familiar with the timer system. Didn't know it counted up.

- You know you're curious
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 18th Feb 2009 04:07
Well their my lesson of the day. Thought of you ply while I was typing it.

]

Nike
15
Years of Service
User Offline
Joined: 2nd Dec 2008
Location: Finland
Posted: 18th Feb 2009 15:25 Edited at: 18th Feb 2009 15:48
Thank you so much for the lesson hockeykid =) i think im getting it now
I'mma test it soon, i hope my english wasnt hard to read, my studiest are still unfinished.

EDIT: One more thing, Is it possible to prevent the player dying when the timer has counted down again, because if the player has more than 1 live, the player keeps dyin as he spawns again.

Straight from Finland ;P
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 18th Feb 2009 18:49
yeah try this




if that doesn't work try this


By the way your English is perfect

]

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 19th Feb 2009 02:54
Good work hockeykid.

I would make one change for simplicity.



To reset the timer, just use timerstart again.

Best.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 19th Feb 2009 03:11
o yeah i was trying to think of how to restart the timer and i wasn't exactly sure. I thought i had heard the action timerreset or timerrestart some where but i wasn't sure.

]

X10 User
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 20th Feb 2009 18:41
You could also go one further and create pick ups or trigger zones to reset the timer so you could give the player extra time bonuses, doing that you could make some levels impossible to finish in time without searching out time bonuses and add to the difficulty

- Why is everyone on here so rude? -

Login to post a reply

Server time is: 2024-11-24 20:02:38
Your offset time is: 2024-11-24 20:02:38