Modme Forums

Lighting states not working corrrectly

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


ModmeBot:

Thread By: The Black Death

So yesterday I went around my map and set all the lights I wanted on with the power being on to be unticked for lighting state 1, and all the lights I wanted off with the power to be unticked for lighting state 2. For reference, this is what one of my Juggernog lights looks like.

Even in Radiant the lights that are intended to be on when the power is on show as grey. Aber, when I go in-game, the power lights are on, and the non-power lights are off, and when I turn on the power it switches around. Which means that lighting state 2 is on at the start, when lighting state 1 should be. And the power is setting it to lighting state 1?

This is the code in my mapname.gsc:

Even when I tried setting it to lighting state 1 manually within main(), the map still defaults to lighting state 2, and the init_power() function at the bottom sets it to lighting state 1...


ModmeBot:

Reply By: Abnormal202

The

So yesterday I went around my map and set all the lights I wanted on with the power being on to be unticked for lighting state 1, and all the lights I wanted off with the power to be unticked for lighting state 2. For reference, this is what one of my Juggernog lights looks like.

Even in Radiant the lights that are intended to be on when the power is on show as grey. Aber, when I go in-game, the power lights are on, and the non-power lights are off, and when I turn on the power it switches around. Which means that lighting state 2 is on at the start, when lighting state 1 should be. And the power is setting it to lighting state 1?

This is the code in my mapname.gsc:

Even when I tried setting it to lighting state 1 manually within main(), the map still defaults to lighting state 2, and the init_power() function at the bottom sets it to lighting state 1...

I have this problem too. The lighting states seem really glitchy. I just treat lights like lighting state 2 is before power and lighting state 1 is when power is on, and it works for the most part. Though some perk lights still do not turn on, no matter what I set them to...


ModmeBot:

Reply By: The Black Death

Abnormal202
The

So yesterday I went around my map and set all the lights I wanted on with the power being on to be unticked for lighting state 1, and all the lights I wanted off with the power to be unticked for lighting state 2. For reference, this is what one of my Juggernog lights looks like.

Even in Radiant the lights that are intended to be on when the power is on show as grey. Aber, when I go in-game, the power lights are on, and the non-power lights are off, and when I turn on the power it switches around. Which means that lighting state 2 is on at the start, when lighting state 1 should be. And the power is setting it to lighting state 1?

This is the code in my mapname.gsc:

Even when I tried setting it to lighting state 1 manually within main(), the map still defaults to lighting state 2, and the init_power() function at the bottom sets it to lighting state 1...

I have this problem too. The lighting states seem really glitchy. I just treat lights like lighting state 2 is before power and lighting state 1 is when power is on, and it works for the most part. Though some perk lights still do not turn on, no matter what I set them to...

Thanks for the advice, also I got Mule Kick's lights to work in Radiant and then they stopped working again. Very odd. Spaghetti code I'd say.


ModmeBot:

Reply By: Wild

Try this instead. First make sure your sun volume has both ssi 1 and 2 set up. Then select all the lights you want on 100% of the time and tick light state 1 and 2 only. For lights you want on at the start of the game but turn off when power is on select them and only tick the box for light state 1. For the lights you want to only be on once power is turned on select them and tick the box for light state 2 only.

Now the scripting part. (I got this from DTZxPorter as he posted it as a reply to another post and I used it and it works.)

Open your mapname.gsc and underneath

zm_usermap::main();



put this:

thread init_power();



Next replace the function you have with this funtion instead:

function init_power()
{ 
	level util::set_lighting_state(0);
	level waittill("power_on"); 
	level util::set_lighting_state(1);
}



If you add that stuff to your map's gsc and set up the lights like I said for which lights you're using then it should work fine as I use it myself and can comfirm that it does. Hope this helps!