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 / my first script

Author
Message
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 05:22 Edited at: 25th Mar 2008 05:23
hello all, i would first like to express my deepest thanks to all those who spent the time to make the tutorial's, especially plystire's tutorial, it was extremely helpfull. anyway i just started to learn the FPI language and made my first script. it is sopoused to be a timer , meaning if the player does not get to the trigger zone within 5:00 minutes they would die. but when i do it nothing happens. i would greatly appreciate any help you might give. i understand that you get very tired of questions and you all are busy doing other stuff but if you might get a chance that would be great even if you don't answer for a while. thank you so much in advance.

here is the code


"The Beginning is the end."
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Mar 2008 06:32
Okay, for a timer to work, you'll need to start it up first.

To do this, you simply use the "timerstart" action. After that, you can check the "timergreater" condition.

Also, 50000 milliseconds doesn't equal 5 minutes. For a 5 minute time limit, let's do some math. 5 minutes is equal to 300 seconds (5*60). 300 seconds is equal to 300,000 milliseconds (300*1000).

So for a 5 minute duration you'll want to check:

timergreater=300000


I don't want to give you an altered script, because that would rob you of a good learning experience.


Good luck, I hope you can get your first script working properly!

Hint: The entity this is attached to will need to be always active)


The one and only,
~PlystirE~

CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 25th Mar 2008 12:11
Also, You've added PLRWITHINZONE as an action, not a condition.....


castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 17:01
OK i edited it again and still nothing happens.

here is the edited script


"The Beginning is the end."
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 25th Mar 2008 17:06
Don't add all those spaces in, it looks weird.....

Also, this wants the player to be in the zone after 5 minutes before it kills him.....

You might want to add 2 state 1 lines, one where the player is in the zone, and one where he isn't.....


castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 17:08
Ok i'll try that, thanks for the quick reply.

"The Beginning is the end."
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 17:20
is this what you mean?



"The Beginning is the end."
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 25th Mar 2008 18:03
Hmmm...Not really....

On the one where the player does get there in time, don't kill him, 'cos that's cruel.....

Try removing the Timergreater and Plraddhealth parts from the second line....

Also, try and remove spaces, it'll look neater then....


castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 18:15 Edited at: 25th Mar 2008 18:26
well i need to kill them because in my game they have to race the enemy to the end and they die if they dont win.


EDITis there a timelessthen cammand?

"The Beginning is the end."
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 25th Mar 2008 18:28
Yeh, but one line must be as if they do beat the enemy to the end, therefore they don't die....

Also, change PLRADDHEALTH=-X to NEWGAME, then you won't have the player randomly dying, and it'll start a new game instead, (same thing really, just looks better).....


castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 18:35 Edited at: 25th Mar 2008 18:45
well if you add a plrwithinzone command then they only die if time is greater then 5 minutes and they are in the zone.




"The Beginning is the end."
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 25th Mar 2008 19:11
Now you've went back to a single state 1 line, let's go through this, step by step.....

Right, our player is racing an enemy, now, He can either get there before him, (before 5 minutes), or after him (after 5 minutes).....

Therefore we make 2 states, for the 2 choices, and one state to start it up..

That state is state 0.....

You've prepared by starting the timer and moving up to state 1, now you'll have to branch off at state 1 to make it twice....

Now We have this:


But of course, that'll do nothing until we give it a few more boxes to tick, so to speak, so we'll need to work out how we'll test if 5 minutes have gone by, (by using TIMERGREATER), after this, we'll have to kill him, or start a new game, so we add in TIMERGREATER in the conditions area, and NEWGAME in the actions....

We now have this:


Ok, good with making the player lose, but now he can't win, which I'm sure they'll be unhappy about, and your showcase thread will be full of more flaming than an industrial oven, so now we add in checks to test if he does get there in time, beat the baddie, save the planet, etc, etc....

Your doing this on a trigger zone, so we'll use PLRWITHINZONE to test, right, but we don't use the timergreater condition, as that would mess it all up, after doing this, we need to dictate what happens after the player wins....let's say the trigger zone is destroyed, for simplicity, to do that, we use the DESTROY command, simple, eh?

Now we have this:


Now, this'll just can the zone if you win, if you want something else to happen instead when you win, replace the DESTROY command with the commands required to do what you wanted to do...

Good luck..


castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 25th Mar 2008 19:34
i tried it but it didn't kill me after 5 minutes.

"The Beginning is the end."
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Mar 2008 00:16
For testing purposes, I'd set the 300,000 to something a little more standable, like maybe 20 seconds.

Also, did you take my hint into account earlier? You'll want this entity to be Always Active. This can be troublesome if you want it to be a zone with another purpose as well.

What you may want to consider doing is splitting this into two different scripts. One script will be attached to an entity that is Always Active (So the timer will start at the beginning), and check for an "activated" value of 1. If the entity was activated, then destroy the entity (To stop the clock). Now, in your zone, you'll want to give it a script that checks if the player is within the zone, and if they are to activate it's IfUsed with a value of 1. Now put the name of your first entity (the Always Active one) in the IfUsed field of the Zone.

What will happen here is:

- Upon starting the level, the Always Active entity will start a timer, and check for if it's passed 5 minutes or if it has been activated with a value of 1.

- The zone will check if the player has entered it. If the player has, then it will activate that Always Active entity with a value of 1, to stop the timer permanently.


That should be a decent guideline for you.


The one and only,
~PlystirE~

castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 26th Mar 2008 18:27
YES!!!!!! i got it too work thank you all so much for your help it was greatly appreciated.



i attach this sript to an enity which is at the begging then i have a zone with a script that destroys the entity.
thanks again for your help.

"The Beginning is the end."
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 27th Mar 2008 02:49 Edited at: 27th Mar 2008 21:35
@Everyone,

Here's a single script variation that does very much the same thing, but it only needs the single dynamic entity.

K.I.S.S., that's my motto...

Man Enough? http://s1.gladiatus.us/game/c.php?uid=20217

ARE YOU A LONE WOLF? CLICK BELOW TO JOIN THE PACK.

Attachments

Login to view attachments
Keo C
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location: Somewhere between here and there.
Posted: 27th Mar 2008 16:28
Quote: "K.I.S.S"

Kill Insects, Swat and Smash.


Image made by the overworked Biggadd.
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 27th Mar 2008 17:53
My motto: K.I.S.S.A.S.S

Keep
It
Simple
Stupid
And
Stop
Stalling



Login to post a reply

Server time is: 2024-11-24 05:41:01
Your offset time is: 2024-11-24 05:41:01