Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Changing ambient light  (Read 2393 times)

0 Members and 1 Guest are viewing this topic.

FogGobbler

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 228
    • View Profile
Changing ambient light
« on: August 17, 2007, 03:13:59 PM »

Hi!

Please help me with this problem.

I want to change the ambient light (fade in), when my character enters a region. This works fine, when I change the light from black to white, but it doesn´t with colored lights.

Code: [Select]
on "ActorEntry"
{
  for (var a=0;a<255; a = a+10)
  {
  Scene.AmbientLightColor = MakeRGBA(a,a,a);
  Sleep(1);
  }
}
on "ActorLeave"
{
  for (var a=255;a>0; a = a-10)
  {
  Scene.AmbientLightColor = MakeRGBA(a,a,a);
  Sleep(1);
  }
}

I´ve gathered that I have to convert the RBG to HSL and back again using the new functions in the beta-version and change the L-value in a loop, but I really don´t know how to do this.

An example would be great!

Many greetings,
Oli

Logged

FogGobbler

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 228
    • View Profile
Re: Changing ambient light
« Reply #1 on: August 17, 2007, 04:02:41 PM »

Never mind. I´ve found out how to do it.

If anybody´s  interested, I´ll post my solution.

Bye,Oli
Logged
 

Page created in 0.104 seconds with 21 queries.