Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Lighting Cogs
Lighting Cogs
2005-10-28, 1:59 AM #1
Would any one be able to help me make a cog, or make for me a cog that.

-Turns lights on and off via a switch.
-Creates a flickering light effect. (By this i mean like a fluro tube that is dying.)


If these cog(s) are already around, just direct me in there Direction, if they are really easy to make just tell me, and ill give it a go. I just dont know the first thing about cogging.
Anarchistic, Srunched. you got a problem i got some metal storms lets settle this out side.
2005-10-29, 9:06 AM #2
I think this problem might be solved, thnak you very much, But never mind.
Anarchistic, Srunched. you got a problem i got some metal storms lets settle this out side.
2005-10-30, 6:46 AM #3
Nope problem is still here, if any one has any ideas on how to make a flickering light Cog please contact me.

Th is a cog that was made for me, but doesnt work for me.


Code:
# Flickering Neon Light
#
# By Edward
symbols

message       startup
message       pulse

thing       light
surface       bulb

flex       highlight
flex       lowlight
flex       maxon
flex       minon
flex       maxoff
flex       minoff
# These flexes determine how long the light should be on and off.
# With this, you have free choice on how old the bulb is,
# or how random it should flicker.

sound       zap
sound       blink

end
#
code
startup:
   sleep(1);
   SetPulse(minon+rand()*maxon);
return;
pulse:
   if(GetThingLight(light)<highlight)
   {
      ThingLight(light, highlight, 0.1);
      PlaySoundThing(blink,light, 1, -1, -1, 0x80);
      SetSurfaceLight(bulb, highlight, 0.1);
      SetPulse(minon+rand()*maxon);
   }
   else if(GetThingLight(light)>lowlight)
   {
      ThingLight(light, lowlight, 0.1);
      PlaySoundThing(zap, light, 1, -1, -1, 0x80);
      SetSurfaceLight(bulb, lowlight, 0.1);
      SetPulse(minoff+rand()*maxoff);
   }
return;
end 
Anarchistic, Srunched. you got a problem i got some metal storms lets settle this out side.
2005-10-30, 8:54 AM #4
This one works :)
Code:
# Jedi Knight Cog Script
#
# Flickering Lights
# 
# [darthslaw]
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message		startup
message		activated
message		pulse

surface		switch
thing		light

int		on=0				# set to 0 if you want lights off on startup, and 1 if you want them on

flex		mindelay=0.1			# delay between on/off flickering
flex		maxdelay=1.0
flex		minlight=0.1			# min light to be emitted
flex		maxlight=0.7			# max light to be emitted
flex		offlight=0.0			# how much light should be emitted when the light is off

sound		flipswitch=lvrclik1.wav		# when switch is nudged
sound		flicker=forcefieldhit01.wav	# when light flickers

flex		L=0				local

end

# ========================================================================================

code

startup:
	sleep(0.1);
	if(!on)	SetThingLight(light, offlight, 0.0);
	else SetPulse(mindelay + rand() * (maxdelay - mindelay));
	SetWallCel(switch, on);
	Return;

Pulse:
	L = 1 - L;
	if(L) SetThingLight(light, minlight, 0.0);
	else
	{
		SetThingLight(light, maxlight, 0.0);
		PlaySoundThing(flicker, light, 0.5, -1, -1, 0x80);
	}
	SetPulse(mindelay + rand() * (maxdelay - mindelay));
	Return;

Activated:
	if(GetSenderRef() != switch) return;
	on = 1 - on;
	L = 0;
	SetWallCel(switch, on);
	PlaySoundPos(flipswitch, SurfaceCenter(switch), 1.0, -1, -1, 0x0);
	if(on) SetPulse(0.01);
	else
	{
		SetPulse(0);
		SetThingLight(light, offlight, 0.0);
	}
	Return;

# ........................................................................................

end
May the mass times acceleration be with you.
2005-10-30, 5:33 PM #5
WoooooT! it works Thanx Tons Darthslaw. Your name is in the credits.
Anarchistic, Srunched. you got a problem i got some metal storms lets settle this out side.
2005-11-09, 12:52 AM #6
I tested my level a while ago and i never got around to it but, the flickering lights only work for host, I know I forgot to mention that it needs to work in multiplayer!
Anarchistic, Srunched. you got a problem i got some metal storms lets settle this out side.
2005-11-09, 11:12 AM #7
Add flags=0x240 before the symbols section. (I think...)
-Hell Raiser

↑ Up to the top!