LightTrigger

All information regarding our UT99 server. Plus General discussion related to the game.
User avatar
p455w0rd
Site Admin
Site Admin
Posts: 284
Joined: Wed Sep 14, 2005 12:00 am
Contact:

LightTrigger

Postby p455w0rd » Sun Feb 13, 2011 4:46 pm

I'm working on a little projec and I wanted to to have to ability to change all of the lights in a level to a certain color..there is nothing for this that I could find, so I made my own:

Code: Select all

//=============================================================================
// LightTrigger.
//=============================================================================
class LightTrigger expands Trigger;
var() float ColorB;
var() float ColorH;
var() float ColorS;

var   String DefaultBrightness;

function PostBeginPlay()
{
   Super.PostBeginPlay();
}

function Touch(actor Other)
{
         //Other.Instigator.BroadcastMessage( "fer shitzngigglez" );
}
function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType )
{
      local Actor A;
      ForEach AllActors( class'Actor', A )
      {
         if ( Left( A.Name, 5 ) == "Light" )
         {
            if ( Left( A.Name, 11 ) != "LightTrigger" )
            {
            //instigatedBy.ClientMessage("Light found!");
            A.LightBrightness = ColorB;
            A.LightHue = ColorH;
            A.LightSaturation = ColorS;
            }
         }
      }
      
      Super.TakeDamage(Damage, instigatedBy, HitLocation, Momentum, DamageType);
}


This is simply a trigger like any other..in this state it can only be shot (no player bump) but programming for both wouldn't be difficult...After you add the actor to your level go into its properties under LightTrigger, there are 3 values: ColorB, ColorH, and ColorS, for ther Bright, Hue, and Saturation respectively. Instead of RGB, UT uses these values for lighting color..a few examples can be found here. Pretty nifty...it would be nice to add functionality to record every light's object name and it's light color settings so they can be set back to default...pretty useless but cool

Return to “Unreal Tournament 99”

Who is online

Users browsing this forum: No registered users and 2 guests