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 Pulse", my first script

Author
Message
fantasy
18
Years of Service
User Offline
Joined: 2nd Feb 2006
Location: London -UK
Posted: 16th Feb 2006 16:32
I made my fisrt script
it makes the light pulse on and off,
for red alarms and sirens in your games,
I added it for an escape level at the end of my game
here it is



add it to your "Main" section of any light,
if you have a blue light, and you add it, then it will flash like a police car
brummel
18
Years of Service
User Offline
Joined: 26th Nov 2005
Location: Sweden
Posted: 16th Feb 2006 16:50
Nice!

-Half Death- A game like Half Life 2 in progress...
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 16th Feb 2006 21:26
:activated=1,timergreater=50:incstate=1,timerstart
:activated=2,timergreater=50:decstate=1,timerstart

:state=0:activate=1,timerstart
:state=1:lightrange=20,activate=1
:state=2:lightrange=40
:state=3:lightrange=60
:state=4:lightrange=80
:state=5:lightrange=100
:state=6:lightrange=120
:state=7:lightrange=140
:state=8:lightrange=160
:state=9:lightrange=180
:state=10:lightrange=200
:state=11:lightrange=220
:state=12:lightrange=240
:state=13:lightrange=280
:state=14:lightrange=300
:state=15:lightrange=320
:state=16:lightrange=340
:state=17:lightrange=380
:state=18:lightrange=400,activate=2


Just an example of a little cleaner code...
Instead of increasing timer all the time, you can reset it. This is a little easier when talking about repeating patterns. If you are doing a sequence, you probally will want to know what time it is.

activate and activated are the second variables in FPSC, sorry, no more (well, good ones). Activated is the conditional, and activate is the action.

incstate= is useful with sequences, since instead of constantly typing the next state, you simply set the =1 and it goes to the next state. Decstate is it's oppisite.


Welcome to the coding community. Shakes Hand.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 17th Feb 2006 08:13 Edited at: 17th Feb 2006 08:15
Well done fantasy!

Excellent example of the use of incstate and decstate Merranvo.

Sweet Logic.




Don't forget to visit http://www.conjured.us/

Support Your Local CE-FPSC Chapter
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 13th Mar 2006 00:28
Thanks.This will come in handy.

Not changing this sig until I get rich

Login to post a reply

Server time is: 2024-11-22 03:24:49
Your offset time is: 2024-11-22 03:24:49