# 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

Message
Posted: 16th Feb 2006 16:32
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

if you have a blue light, and you add it, then it will flash like a police car
Posted: 16th Feb 2006 16:50
Nice!

-Half Death- A game like Half Life 2 in progress...
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.
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/