need help with a little problem with some rules please.

guillefaceguilleface Member, BASIC Posts: 1,039
hi, let says i have a actor, "bulb" on this actor i created a self integer attribute named ,"on/off" and i set it to 1
when touch is pressed change.self.on/off to (on/off+1)%2 as you know this will work as a switch button
now i have a real global attribute "#of bulbs on?"
each actor has this rule when self.on/off is true to change "#of bulbs on?"+1, otherwise -1.(so when all bulbs are on, this attribute is equal 10 because i have 10 bulbs in the scene.
what i want to do is to disable that i cant not turn off all 10 bulbs but only 9, to do this i added to the touch rule this,
when touch is pressed and "#of bulbs on?" is equal or higher than 2,
with this i can only turn off 9 and cant turn off the last bulb which is what i need, the problem is that i cant longer turn on back any of the 9 bulbs that are off.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    That's because on only = 1 and your rule says 2 or higher.
  • guillefaceguilleface Member, BASIC Posts: 1,039
    yes your right, i know that ,thats the problem but if i delete that rule then i can turn all 10 off, so i dont know how make this work.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Is there a specific bulb you want to leave on or is it just any one of the ten?
  • guillefaceguilleface Member, BASIC Posts: 1,039
    just any of them, is not actually bulbs i just wanted to make it clearly so i used bulbs,but this is for my game guess who? , i have 24 characters and when they are crossed a player can not guess that character, but if they hide all 24 characters this mess my game because now there is nothing to guess, so i want to have always 1 character uncrossed.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You might have to split up the on off rules to be able to control the off logic as right now it's integrated into the on using otherwise. This will allow you to add conditions to off and not affect on.
Sign In or Register to comment.