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 / Timer Script?

Author
Message
knapp16
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location:
Posted: 4th Nov 2010 02:50
Hello, I'm looking for a script that will start a timer (invisible to the player) when the player enters a trigger zone.

Here's the scenario:
You wake up in a confined cell, you spawn inside a trigger zone and sound zone. The sound zone will initiate a small conversation between you and someone else. I would like the trigger zone to start a timer for say, 15 seconds. When that 15 seconds is up, i would like to; 1. open a door, and 2. turn off the lights.

P.S. I'm not looking for a countdown timer that will appear on-screen.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Nov 2010 06:05
Very simple script.

Use "plrwithinzone" to determine when the player's in the zone, use "timerstart" to begin the timer, use "timergreater=15000" to have the timer wait for 15 seconds, and finally use "activateifused" to activate the door and lights. Name the lights and the door the same name, then put that name intot he IfUsed field of the triggerzone.


That's my pseudo-code for you. As with everyone else, I expect you to write it yourself. There are great tutorials out there to help you get into scripting FPI. Check the "ofpscguide.pdf" file in your "FPS Creator/Docs" folder for some nice tutorials.


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
knapp16
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location:
Posted: 4th Nov 2010 13:29
Thank you Ply, I feel kinda dumb now that it was something so simple.
Scene Commander
Support Manager
17
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 4th Nov 2010 13:44
Plystire is completely correct, but I would suggest using the etimers instead.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Nov 2010 02:15
Yeah, etimers would be better (just put an "e" in front of your timer commands like "etimerstart") since they don't interfere with each other.

I didn't mention that because, well, I lose track of what goes into stock FPSC and am never quite sure if those are in there or not.


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
knapp16
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location:
Posted: 5th Nov 2010 04:13 Edited at: 5th Nov 2010 04:20
Alright I must have misread your explanation ply, i didnt realize there was coding involved. I dont really know much but I gave it a quick shot anyway and this is what i got;



Now of course it doesnt work but I was hoping you could kind of guide me on this, Ive always wanted to get into scripting and this might just give me that little nudge.
knapp16
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location:
Posted: 5th Nov 2010 05:08
Sorry about the double post but I figured it out, I just left out =1 after activateifused.




Anyone can feel free to use this and modify it in any way.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Nov 2010 05:15
I'm glad you were able to pick it up that quickly. Hopefully you won't need as much help from us now and take things your own direction.


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.

Login to post a reply

Server time is: 2025-06-04 21:07:41
Your offset time is: 2025-06-04 21:07:41