For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Change Light Color in UScript not reflected in environment

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
hooli
OldUnreal Member
Posts: 9
Joined: Sat Apr 11, 2020 5:16 am

Change Light Color in UScript not reflected in environment

Post by hooli »

Hi folks,

I am trying to have a teleporter change the color of a Light actor. I am able to find the actor, and I can even read the before and after values of the color change.. however, the light does not seem to actually change color. Do I need to somehow call a "refresh" or "re-render"? (This is for UT2k4, but guessing the methods are the same in Unreal 22X).

Code: Select all

			// secret location is next, change light color
			foreach AllActors( class 'Light', L )
			if( string(L.tag)~=GoalLight && L!=Self )
			{
				Lights[i] = L;
				Other.Instigator.ClientMessage(L.Name); //correctly finds "Light0"
				Other.Instigator.ClientMessage(L.LightHue); //correctly shows "before value"
				L.LightBrightness = GoalLightBrightness;
				L.LightHue = GoalLightHue;
				L.LightSaturation = GoalLightSaturation;
				Other.Instigator.ClientMessage("now");
				Other.Instigator.ClientMessage(L.LightHue); // correctly shows "after value", but no physical change...
				i++;
				if ( i > arraycount(Lights) )
					break;
			}

User avatar
hooli
OldUnreal Member
Posts: 9
Joined: Sat Apr 11, 2020 5:16 am

Re: Change Light Color in UScript not reflected in environment

Post by hooli »

Update: I was able to get this to work using TriggerLight instead of Light. Some online reading was mentioning Lights are bStatic and TriggerLights are not.
User avatar
Hellkeeper
Global Moderator
Posts: 3260
Joined: Wed May 21, 2008 8:24 pm
Location: France
Contact:

Re: Change Light Color in UScript not reflected in environment

Post by Hellkeeper »

Probably because lights are static while triggerlights are dynamic lights, which means they only cast basic lighting.
Static lights can't change at all during gameplay and are baked into the lightmaps.
You can figure it out because triggerlights cast no shadows (their light goes through walls, movers and actors).
You must construct additional pylons.
Post Reply

Return to “UScript Board”