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 / light flash with alarm script help

Author
Message
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 28th Apr 2016 00:16
hi i'm working on this script for having alarm light on trigger but i cannot manage to set it properly into the editor




how can i correctly use this script code??

how must i correclty set entites and triggers?'

thanks in advance,,,
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 28th Apr 2016 22:53
JC LEON
For this kind of script I would use "etimer" instead of "timer"
Are you attaching this to a "light marker" to have turn on and off?
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 29th Apr 2016 00:50
yes i would to attach the script to a light marker to turn on and off ..but even other ideas are welcome

the original post from i lurked is this

https://forum.thegamecreators.com/thread/171794
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th Apr 2016 02:24
JC LEON
Ah yes, I remember that script from CE. It's perfect for this. The only thing that has changed is the syntax for a timer.
Use "etimer" when controlling entities. You can still use "timer" but might cause problems.
Noticed your second state=0 runs in a loop ":state=0,activated=0:stopsound,lightoff,state=0"
That causes problems (state=0 going back to state=0)

Note the script starts with the light off. When activated light flashes every 1/2 sec.
Change timer to meet your needs.
Now just attach this script to a "Dynamic" light & give it a unique name (like light1 or alarm_light)
Place a trigger where you need it and give it the "plrinzoneactiveused.fpi" script.
Open the trigger property settings, in the "If Used" field put in the exact name of the "light"
Now when player steps into trigger zone, alarm light will activate.

But here's my question. Once you have the alarm light on, how do you want/need it to shut off?
If the player "leaves" trigger zone, or some other method??? Like a switch or something?
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 29th Apr 2016 10:24
hi ncmako and thanks again for your time and effort..

script works like a charm now ...and YES.. would alarm shut off if the player make a specified action...like interact with a swtch, hack a computer,disable a powerbox and so on...

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Apr 2016 01:42
Quote: " alarm shut off if the player make a specified action"

Yes, simple. If you open the light script I gave you up above you'll see
where to "start" the light flash we used "activated=1". So to "stop" the light
from flash we need to go back, to activated=0 (look at the second state=1 line of code)
So here's a simple script to do just that.

I took a regular "switch" script and change one line. You'll see at "state=10" at the end "activateifused" now is 0 (zero)
Attach this script to any switch or toggle (any stock switch will do). And DONT forget to add the exact name of the flashing light
in the switch "if used" field. Just as in the triggers "if used" field. Now the trigger will activate the light and the switch will
deactivate it.
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 30th Apr 2016 20:25
all works great..only one question...

ok can i do to disable the trigger after i activate it once... since even if i stop alarm by switch if i return on trigger alarm activate again..( andi f i can try to use switch again it obviusly doesnt work)

many thanks again.. and sorry for my noobish
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Apr 2016 21:57
Quote: " if i return on trigger alarm activate again"

Yep, easy. And not noobish at all. Open the triggers .fpi file "plrinzoneactivateused"
and change just one thing. Change the last line ":state=1,plrwithinzone=0:state=0"
Change "state=0" to some state not being used, so to dead ends and stops. ( I'll use state=2)

Now the trigger can only run once and stop! Save it with a unique name so you can find it.
My games never have bugs. They just develop random features..
Lots and lots of random features...
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 30th Apr 2016 22:12 Edited at: 30th Apr 2016 22:13
yeah.. it works ..I was trying this on alarm _light script and not on trigger script.. oh my noob..


since i was reading this thread
https://forum.thegamecreators.com/thread/187718

got it ..works great...


many many many many thanks..

I'm learnig scripting thakns to you... I do not forget you great help.. mate..

Login to post a reply

Server time is: 2024-11-23 09:32:35
Your offset time is: 2024-11-23 09:32:35