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 / Trigger Alarm Light

Author
Message
Malanius
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location:
Posted: 23rd Jun 2010 22:26
Okay, I am trying to trigger an alarm light with one trigger zone and shutting it off with another. Now the actual light on or off using the standard lightoff.fpi works just fine, so actually triggering the light is not my problem.

My issue is trying to have the script make the light flash while it is turned on. Heres the code I'm trying to use for this:



Now I should say that my scripting abilities are limited. So, ya I'm sure the above is atrocious. I hoping that perhaps one of you on here might be able to help me with this. thanks in advance.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 23rd Jun 2010 22:41 Edited at: 23rd Jun 2010 23:04
You are stuck in state=2

Try this



And don't forget the sound for the alarm...



   Conjured Entertainment

 WARNING: Intense Madness
Malanius
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location:
Posted: 23rd Jun 2010 23:16 Edited at: 23rd Jun 2010 23:45
Ha, so I was wow. And thanks for the script, though how do you have it default as off. I'm wanting to use one trigger to turn on the alarm and the other to shut it off. And the above script you gave starts on (though it can be toggled with a switch, which is a dramatic improvement over what I had before )

Again thanks for the help.

Edit: Never mind I got the script you posted to work with a few changes, now it works like a charm. Thanks

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 24th Jun 2010 19:31
Good to see someone else learning scripting


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Malanius
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location:
Posted: 24th Jun 2010 23:00
Trying to at least, For some reason I'm having a bit of a hard time grasping it. Which is odd since I write .net programs for work ... you'd think I'd be fine. oh well, can't win em all right
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2010 08:03
If you're familiar with programming in general then perhaps viewing the script like this will help you understand it a bit better:

Quote: ":state=1:lightoff"

is the same thing as saying
Quote: "If (state == 1) {
lightoff(thisentity);
}"

or for BASIC coders
Quote: "if state=1 then lightoff(thisentity)"


Each line of the script is essentially an if statement and the code to run if the clause returns true.


The one and only,


Malanius
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location:
Posted: 25th Jun 2010 16:20
huh, thats some good advice. Thanks Plystire.

Login to post a reply

Server time is: 2024-11-24 21:50:02
Your offset time is: 2024-11-24 21:50:02