Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Fading Ambient Light to Region's Color  (Read 2300 times)

0 Members and 1 Guest are viewing this topic.

Lomeg83

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 1
    • View Profile
Fading Ambient Light to Region's Color
« on: January 16, 2010, 12:58:14 PM »

//Add this script to your Region////

var rscolor = GetRValue(Scene.GetLightColor("Lampe"));
var gscolor = GetGValue(Scene.GetLightColor("Lampe"));
var bscolor = GetBValue(Scene.GetLightColor("Lampe"));

var rrcolor = GetRValue(this.AlphaColor);
var grcolor = GetGValue(this.AlphaColor);
var brcolor = GetBValue(this.AlphaColor);

var rncolor = GetRValue(Scene.GetLightColor("Lampe"));
var gncolor = GetGValue(Scene.GetLightColor("Lampe"));
var bncolor = GetBValue(Scene.GetLightColor("Lampe"));

////////////////////////////////////////////////////////////////////////////////
on "ActorEntry"
{
while(rncolor != rrcolor && gncolor != grcolor && bncolor != brcolor)
{
if(rncolor > rrcolor){rncolor = rncolor - 1;}
if(rncolor < rrcolor){rncolor = rncolor + 1;}
if(gncolor > grcolor){gncolor = gncolor - 1;}
if(gncolor < grcolor){gncolor = gncolor + 1;}
if(bncolor > brcolor){bncolor = bncolor - 1;}
if(bncolor < brcolor){bncolor = bncolor + 1;}
Scene.SetLightColor("<Name of default Omni Light in the Scene>",MakeRGBA(rncolor,gncolor,bncolor));
///You can add a <Sleep(1....);> for slower fading////
}


on "ActorLeave"
{
while(rncolor != rscolor && gncolor != gscolor && bncolor != bscolor)
{
if(rncolor > rscolor){rncolor = rncolor - 1;}
if(rncolor < rscolor){rncolor = rncolor + 1;}
if(gncolor > gscolor){gncolor = gncolor - 1;}
if(gncolor < gscolor){gncolor = gncolor + 1;}
if(bncolor > bscolor){bncolor = bncolor - 1;}
if(bncolor < bscolor){bncolor = bncolor + 1;}
Scene.SetLightColor("<Name of default Omni Light in the Scene>",MakeRGBA(rncolor,gncolor,bncolor));
///You can add a <Sleep(1....);> for slower fading////
}
}
Logged
 

Page created in 0.135 seconds with 17 queries.