How to create various button behaviors - Latching?

JH4musicJH4music Member, PRO Posts: 23

Hi,

Not much experience with Gamesalad, but I do have experience programming in a scripting language.

I am having a lot of trouble trying to do something that seems like it should be easy to do: latching buttons. Basically, I want to be able to click the button, and it lights up.... The button remains lit up until you click it again. I can get momentary behavior to work fine.... But if I try to program the button to "latch", I can only click on it once to turn it on... It never responds to mouse movement again.

Here's what I did:
1. I created an actor (the button)
2. I created an attribute for the button called "On Off State"
3. I created a rule with the following conditons: When the mouse button is down, and the value of "On Off State" is 0...... Change Attribute "On Off State" to a value of 1, and display the text "On" on the actor
4. I created another rule with the following conditons: When the mouse button is down, and the value of "On Off State" is 1...... Change Attribute "On Off State" to a value of 0, and display the text "Off" on the actor.

Why can't I get this simple behavior to work? I have tried several variations of this, including making the attribute a game attribute instead of tying it directly to the actor, and it simply doesn't do what I think it should.

Comments

Sign In or Register to comment.