JK and MotS Editing >> Cog, AI, and Templates >> Broken light cog     (Moderator: Admins) Previous Topic | Next Topic
Page 1 of 1
 Author 
 Post 
Post 19-Jan-2011 14:51        

Hey guys, I'm having an issue.

I need a broken light COG.

I know there was one on Massassi, but it has an undesirable effect, the light flash is visible outside of the building.
I think it is becuase it's attached to a ghost object.

Is there anyway to make a similar COG with the ability to be restricted to the sector, or to be attached to a light object instead of a regular object?

Much thanks for the help.
Post 21-Jan-2011 06:26        

Just so you have some response to go on...

My first thought was SECTOR LIGHT.

I believe you can design a cog, that just turns on or off light in a given sector
( or varying shades of light 0 to 1 ).

At one time, I had designed a cog that given a room in pure black 0, then by clicking a lightswitch the room slowly dims to bright fully lit 1 ).

I'll look into premade jk cogs and see if i find anything.
-Pali

*i know it can be done, just gotta remind myself how i did it b4*
Post 21-Jan-2011 06:56        

Try this. JED isn't working for me so I couldn't test it. I always hated it when people didn't text cogs before sending them to me, but now I understand what they had to work with.





symbols

message startup
message Timer

sector flickersector


int TempS local
int TempP local
flex brightness=1
flex min_interval=2
flex range_interval=1

end

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

code

startup:
settimer(min_interval+(rand()*range_interval));
return;

Timer:

SetSectorLight(flickersector, brightness, 0); //Turns sector light on
sleep(rand()); // keeps light on for random time...
SetSectorLight(flickersector, 0, 0); //turns light off


settimer(min_interval+(rand()*range_interval));// waits random time before next flicker
return;

end

Last edited by sexy_lexy on 21-Jan-2011 17:43; edited 1 time in total
Post 21-Jan-2011 09:02        

Hm. That cog looks very familiar. I may have seen it as a Massassi cog once. Though I am a little wondering about the extra sleep(rand()).

Yeah, it sure is a shame that ThingLight goes outside the sectors for as long as you can see its origin sector, and undirectional.
Though, just had a thought here if your first thought was to get some nice shading on things (like the player himself), but would require a heck of alot of patience. To set up a series of things and giving them JUST the right amount of light to fill the corners, but not go outside.
Heh, if only SetVertexLight() was available in JK you could make the shading through that.

Oh, another idea just popped into my head, but not sure if you are gonna be jumping out of the window to this room. You could do so that if you are looking at the room from the outside it blinks using SectorLight, but when you are inside it blinks using ThingLight.

Just some fun thoughts.
Post 21-Jan-2011 17:44        

well I wrote it... lol...
but since it was 12:30 in the morning my brain was kinda fuzzy and I forgot some stuff. But now I think it should be fine.
Post 25-Jan-2011 00:39        

Ill test it ASAP since the original wasnt working the way i wanted. I'll check. Thanks man.
Post 26-Jan-2011 14:56        

Well it works just works with sector lighting.
Really need some light objects though.
I dunno. slow work.
Post 27-Jan-2011 03:55        

yeah I didn't put the light objects in...
Post 03-Mar-2011 15:41        

Hiya, looking for a modified version of this cog, whereby the light turns off permenantly after the player crosses an adjoin. How can this be done?

Thanks!
*** Post commands are unavailable for guests. ***