We have five lights on:
[x][x][x][x][x]
Then we press second button and we are turning off second light and surrounding ones (because all were enabled)
[ ][ ][ ][x][x]
Then we press third button and we turning on two lights (due to disabled status) and off only one (due to enabled status).
[x][x][x][ ][x]
Ok, so this is how it works ... in my mind.
I've made two scripts. The first one was pinned to every light:
begin cc_mar_s_litestatusshort stateif ( GetDisabled == 1 ) set state to 0endifif ( GetDisabled == 0 ) set state to 1endifend
The second script was added to button and it looks as follows:
begin cc_mar_s_litesbtn2if ( OnActivate == 1 )PlaySound, "Torch Out" if ( "cc_mar_lite1"->GetDisabled == 0 ) Disable else Enable endifendifif ( OnActivate == 1 )PlaySound, "Torch Out" if ( "cc_mar_lite2"->GetDisabled == 0 ) Disable else Enable endifendifif ( OnActivate == 1 )PlaySound, "Torch Out" if ( "cc_mar_lite3"->GetDisabled == 0 ) Disable else Enable endifendifend
I've also tried if ( "cc_mar_lite3".state == 1 ) instead of if ( "cc_mar_lite3"->GetDisabled == 0 ) but it doesn't work too. What's more, sometimes the button is able to disappear completely when we activate it. I don't see any mistakes in my scipts so, really, I don't have any idea how to get around this problem.