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 / Multiple Alarm Lights - help..?

Author
Message
Pyr0 technician
16
Years of Service
User Offline
Joined: 22nd Jul 2008
Location: Scotland-woo!
Posted: 13th Aug 2008 15:08
I modified the light2.fpi file to create a light that flashes on and off at regular intervals, like an alarm, using a timer.
It works great when there's one light, but when I try to assign the script to more than one light, it doesn't work, only one of the lights flickers, the other just stays lit(Both are dynamic and have the right script).
I read somewhere that I could use variables, but I really don't know anything about them.

here's the script:



any help would be much appreciated.

thanks

Pyr0

i r teh n00b
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 13th Aug 2008 16:56
you can only have one timer going in the engine at one time() and also it would just be simpler to do this in your script


I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 13th Aug 2008 18:27
<rant> I wish we had entity timers, specific to ONE entity, and not global. Using variables as timers sucks, because the faster your engine is, the faster the script processing is and the faster your variable timer is. And, you can't have an exact timer that runs for, say, 5.6 seconds, as you don't know for sure how long an INCVAR loop takes to process... </rant>

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Aug 2008 21:42
How about you name all of the alarm lights the SAME name (I've done this exact script before )... now have ONE script run the tiemrs and activate the lights on intervals to turn them all on and off at the same time?


TADA!!!

I'll let someone else have the pleasure of explaining that in more detail if necessary, just here to get the concept across.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
wgreg2001
19
Years of Service
User Offline
Joined: 9th Jun 2005
Location: Philadelphia
Posted: 14th Aug 2008 05:13
I need a sript that will turn a lamp on with a wall switch and how to turn a lamp on with a trigger zone

warren gregory
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Aug 2008 08:41
There is a video tutorial on the official FPSC website that tells you exactly how to do that. Might wanna check it out.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Pyr0 technician
16
Years of Service
User Offline
Joined: 22nd Jul 2008
Location: Scotland-woo!
Posted: 14th Aug 2008 10:49
Quote: "How about you name all of the alarm lights the SAME name (I've done this exact script before )... now have ONE script run the tiemrs and activate the lights on intervals to turn them all on and off at the same time?"

right...so you could make a script for an object that, when the timer reaches a certain value, sets a global variable to 1, then resets the timer, then when the timer reaches that value again, sets that variable to 0, then resets the timer, and loops.
You then give all the lights a script so that when the variable is 1, they are on, and when it is 0 they are off.

is that kinda it?

Pyr0

i r teh n00b
Little Bill
16
Years of Service
User Offline
Joined: 18th Jun 2008
Location: UK
Posted: 14th Aug 2008 11:30
I think he means something like:


Pyr0 technician
16
Years of Service
User Offline
Joined: 22nd Jul 2008
Location: Scotland-woo!
Posted: 14th Aug 2008 11:35 Edited at: 14th Aug 2008 12:04
OK I've managed to sort it out.

thanks guys

Pyr0

i r teh n00b
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 16th Aug 2008 18:54
Or if you have 1.09, you can use variables. Look at this.


Login to post a reply

Server time is: 2024-11-24 11:57:34
Your offset time is: 2024-11-24 11:57:34