Jump to content

ANyone know of a script for a blinking light.


Floatsup

Recommended Posts

I've tried most of the geck/modders sites, but havent found a script for one. Anyone got any idea's for one. It needs to be activated when the game starts though. I tried the pulse thing in the light properties and thats useless. So itd gonna have to be a script. I cant find any wait command in geck script. I just want it to loop over and but it needs pauses, and im lost without a wait function. I tried adding a simple counter, but didnt compile. So im back to the forum. :confused: The other thing is I could call time, and have it wait for that but what is the increments of time in the game. is it a whole 24 hour clock 00:00:00 hr:min:sec and if I increment say + 1 does that fall into the second catorgory?

 

heres a floating timer

 

float timer

 

begin gamemode

if timer < 5

set timer to timer + GetSecondsPassed

else

;5 seconds have passed, do something special

set timer to 0

endif

end

 

then instead of the end command I would need to get the state of the light whether it was on or off, which is just a reference. but I need it to alwas going, will this effect cpu cycles very much? Or can you put a reference where the player is. Then the problem comes down to if you turn it off, how would it get started again. Unless you had some trigger on an area, that the player would wake up the script again. I dont know, Im still green (newblet) so if anyone care to explain, I am listening with my pencil in hand.

Edited by Floatsup
Link to comment
Share on other sites

This should work to make a light blink.

 

 

scn MyBlinkingLightScript

;Place this script on the light

float fTimer

BEGIN GameMode

if (fTimer <= 0)
 set fTimer to 5
 if (GetDisabled == 1)
  enable
 else
  Disable
 endif
else
 set fTimer to fTimer - GetSecondsPassed
endif

END

 

Object scripts only run when the player is in the same cell as the object.

 

You could also put a variation of this script on a light switch instead of the light, and give the light a persistent reference that the switch's script could enable/disable.

 

 

 

 

Link to comment
Share on other sites

Oh thats brilliant. Thanks, my coading skills are weak. Thats also great to know about the object script too, about it only running with the player in the same cell. I thought I would have to do a player reference, and was worried about sucking up cycles, so thats a plus.

 

Yeah Im still trying to find examples in the game to reverse engineer to learn. Didnt look in freeside. DOH. Well off to the gecko, and plug this is in. Should look kewl now.

Link to comment
Share on other sites

  • 2 months later...

This should work to make a light blink.

 

Hi,

I'm also using this script for some of my lights. but how do i make it so that the blinking is random, or atleast with different on/off intervalls? (malfunctioning)

 

If possible i'd like to synchronize the blinking with one of the office lights. something like this one: OffRmLightBlink01

 

Is it also possible to make other lights, which don't have a blinking effect in them, blink?

It's supposed to be a devastated vault in an "Normal" setting. So not ruined.

 

If you need me to be more clear on what i need please tell me!

 

PS. I know this is an old thread but i have the issue now, so sorry if i brought up some mothballs.

 

Regards,

Chrophiss

Link to comment
Share on other sites

By using a random function.. its a must in any type of computer programing..

in the GECK there is GetRandomPercent(http://geck.bethsoft.com/index.php/GetRandomPercent)

randomly selects a number between 0-99

 

for 1-10, divide by ten in a set declaration.

 

float number
set number to getrandompercent / 10

 

I'm not sure it will handle rounding well however. im also not sure that on a random delay for a light it matters...

anyways, use the above line in the other code, instead of seting the timer to a static number (5) set it to that

set fTimer to (Getrandompercent / 10)

Link to comment
Share on other sites

Chrosphiss, yes it is.

 

This isn't a specific script for a light. It uses the 'enable - disable' commands. Basically what you have happening is the object appearing and disappearing. Because it's being run on a light, the light disappears and appears giving the blinking effect.

 

If you run this script on, say a securitron, it'll look weird as it'll (presumably) appear and disappear exactly like the light blinking.

Link to comment
Share on other sites

Chrosphiss, yes it is.

 

This isn't a specific script for a light. It uses the 'enable - disable' commands. Basically what you have happening is the object appearing and disappearing. Because it's being run on a light, the light disappears and appears giving the blinking effect.

 

If you run this script on, say a securitron, it'll look weird as it'll (presumably) appear and disappear exactly like the light blinking.

 

could use SetUnconscious 1/0 and make it have siezures, lol

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...