- Code: Select all • Expand view
int WhichLight;
script 26 OPEN
{
WhichLight = (random(17,19));
ChangeCeiling(WhichLight, "NJF002B");
Light_ChangeToValue(WhichLight, 112);
Thing_Deactivate(WhichLight);
delay(random(4, 16));
ChangeCeiling(WhichLight, "NJF002");
Light_ChangeToValue(WhichLight, 144);
Thing_Activate(WhichLight);
delay(random(2,24));
restart;
}
That picks a random number from 17 to 19 (which corresponds to a sector tag and dynamic light) and then makes changes in that sector to make it look like the light has failed temporarily before starting again with a new random choice. It works, but it means that only one light fails at a time.
I'd like to make it so that each time the script runs, any of the sectors (and dynamic lights) could fail in any combination from only one light (as it is now) through any two of the lights and right up to all three. I can do it very mechanically by lots of copy/paste code, but I'm sure that there must be a more efficient way of doing it. Can anyone help out and show me how?