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 / Question for Plystire

Author
Message
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 6th Nov 2008 15:36
Well, seeming as you have helped me numerous times, I guess you're the guy to ask about scripting. Basically, I've written this script that is designed to teleport a player to another destination after a certain amount of time. Here is what I have:

;Triggers

:state=0,plrwithinzone=1:state=1
:state=1,timerstart,timergreater=60000:state=2
:state=2,plrmoveto=OUT

;End of Script

However, nothing happens. I do have a trigger zone named OUT aswell. Any ideas?

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Nov 2008 16:45 Edited at: 6th Nov 2008 16:46
I'm not ply, and I'm not the greatest scripter. But I think your problem lies in the line:



I believe that your problem is that you are starting the timer on every iteration through the code. Meaning: Every time the script is checked at this line, the timer is started. And if it is started all the time (and in effect restarted every time it gets to this point), then it will never hit 60000.

Now, I could be entirely wrong on this. But, just as an aside (and to humor me a little), try the following code:

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 6th Nov 2008 17:23
Thanks I got it working, also, is there a way to make it so that when the player is in a certain area for 10 seconds, they win?

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Nov 2008 17:41 Edited at: 6th Nov 2008 17:41
Quote: "Thanks I got it working"

Just curious, but was it because of my answer? I'm not the best in scripting, but if I was right I'd like to know cuz that means I'm getting better.

Quote: "is there a way to make it so that when the player is in a certain area for 10 seconds, they win"

I would assume so. Just modify the winzone script (make a backup copy first) to include a timer condition.
meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 6th Nov 2008 21:05
I dunno if he got it working because of your help, but that is definatley correctly scripted

I love Jenkins forever :p
There is nothing to fear except fear itself... and FPSC bugs.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Nov 2008 21:20
fantastic. not bad for writing that off the top of my head without looking anything up, huh? I guess I'm a better scripter than I give myself credit for. (I still suck, but at least I'm trying!)
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Nov 2008 00:28
Yup, that's good, Leon.


@marc steene:

Your scripts are in working order... or at least, I can see how they would make sense to someone starting out, but just remember that you need to have any action commands go after the second colon ( : ) on a line and the conditions go before that second colon.


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.

Login to post a reply

Server time is: 2024-11-24 13:33:36
Your offset time is: 2024-11-24 13:33:36