Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Editor Help SpotLight still active?
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#1
SpotLight still active?

I've placed a light box in my level and when you activate it you see a picture on the wall. Obviously this is done with a spotlight and that all works fine.

There's one problem, though. The spotlight is active and is lit from the beginning, even though it's in-active in the level editor. Is this some kind of bug?


ProjectLight" ACTIVE []

void Projector(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("ProjectLight", true);
PlaySoundAtEntity("ProjectorSound", "OldMovieProjector.snt", "Projector", 1, false);

}
05-31-2016, 02:47 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: SpotLight still active?

In OnStart(), use SetLightVisible(); to make it invisible.

Otherwise in OnStart() and your callback, use FadeLightTo(); instead.

PHP Code: (Select All)
void FadeLightTo(stringasLightNamefloat afRfloat afGfloat afBfloat afAfloat afRadiusfloat afTime); 

Quote:Changes the properties of a light.

asLightName - internal name
afR - red value
afG - green value
afB - blue value
afA - alpha value
afRadius - radius of the light. -1 means keeping the radius
afTime - time in seconds until change is done

The simplest way would be to just copy and paste the R/G/B values you have assigned in your Level Editor (and divide them by 255 to get the decimal float value), but change the alpha to 0 or 1 (invisible and visible), -1 for radii and 0.01f for the time needed.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-31-2016, 04:09 AM
Find




Users browsing this thread: 1 Guest(s)