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 / win a level through a trigger point, not from a win zone

Author
Message
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Jan 2012 17:35
I want one of my levels to end when the player steps on a trigger zone in a certain room. The reason why I'm not using a win zone, is that I don't want the level to end immediatly, instead I'm writing a script where a timer starts, and when it have reached a certain value the level will end.

I've put this code in the trigger zone so far:



And now,, I'm looking for the correct action command, but I can't find any that seems suitable.

Can this be done? Or do I have to integrate my code into a win zone somehow?

Thanks in advance,,,

/mnemonic
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 11th Jan 2012 17:57 Edited at: 11th Jan 2012 17:59
place winzone in your editor, open with rightklick, look for the mainscript, open it in editor, look for the plrwin action (whatever it is called)

the winzone is also a triggerzone as sound and story and others are. only difference: its yellow


oh, by the way. forumsearch "winzone timer":

http://forum.thegamecreators.com/?m=forum_view&t=144605&b=23

gz
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Jan 2012 17:59
We use a similar method. We have a trigger which will show a couple of huds, then the win zone is activated and the level ends.

What you want to do is when the time is reached, activate the winzone. So in your example, you would use something like this:



I changed your timer to etimer. In the Trigger properties, put the name of the winzone in the IFUsed field. When your script "activates the IFUsed" field, it activates the winzone.

In the winzone properties, put this script in the Start script field (replaces the appear1.fpi):

Appearifactivate.fpi



Place your winzone where you want it to be activated from. Usually it is in the same place where the player would hit the trigger. Note: the player will still be able to move unless you use the "plrfreeze=x" command to freeze them in place. Otherwize they might not be in the winzone area when it is spawned, unless that is not an issue.


Twitter: @NFoxMedia
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Jan 2012 19:00
Thank you. I will try this.

But this discussion leads me into another question that I've been thinking about: What is the main difference between etimer and timer?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Jan 2012 19:07 Edited at: 11th Jan 2012 19:10
Quote: "What is the main difference between etimer and timer?"


If you use timer and have more than one script running using that command, they will interfere with one another. If you use etimer, it is for that specific item and you can run multiple scripts using etimer- they will not interfere with one another.

For example, if I have a script attached to a character, one attached to a book, and both use timer, then the scripts will not work because they both use timer and it is a local timer. If I change to etimer, then that timer is specific to that script and therefore I can run multiple scripts at once with that command.


Twitter: @NFoxMedia
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Jan 2012 19:09
Ah! Thanks a lot.

Login to post a reply

Server time is: 2024-11-24 02:02:06
Your offset time is: 2024-11-24 02:02:06