Modme Forums
Menu:

Lights Turn On When Power Is Active

Game Modding | Call of Duty: Black Ops 3 | Radiant


ModmeBot:

Thread By: Yasser143
How do I make light scripts activate when power is on and off when power is off?


ModmeBot:

Reply By: ZombieKid164

Yasser143How do I make light scripts activate when power is on and off when power is off?


1) First, add these bits to yourmapname.gsc:



Add:

level thread checkForPower();



Under:

zm_usermap::main();

Also Add:



function checkForPower()
{
    level util::set_lighting_state(0); /* set lighting state to [1] in Radiant (by default) */
    level waittill("power_on");
    level util::set_lighting_state(1); /* set lighting state to [2] in Radiant (turn lights on) */
}

at the bottom of yourmapname.gsc

2) While you have your light selected in radiant, open the entity info page and look for Light State 1, Light State 2, Light State 3, and Light State 4 with check boxes next to their names. What you want to do is uncheck all of the light state check boxes except for the one that says light state 2.

3) Make sure you have skyboxes set for both light state 1 and two in your sun box. You can do this by selecting the sun box (box with suns on it) and find light state 1 and 2, and setting the ssi under state 2 to the same as light state 1.

I believe that is how I did it.