Inter-Actor Messaging
hillelc
Member Posts: 56
I'm assuming the only way for one actor to set an attribute for another is to communicate through global attributes. But I just want to make sure I haven't missed some way for me to have one actor tell another what to do. (i.e. touch Actor A, and Actor B animates).
Thanks in advance.
--hillel
Thanks in advance.
--hillel
Comments
Other than that, yep, as tshirt says, you have to use global attributes.
One more question... do actors continually listen for changes in global attributes?
For example...
* I set GA to true
* i set actor to spin when GA is true and then reset GA to false
* a minute later I set GA to true again and expect the actor to spin again, but it doesn't
any way to set something to keep listening?
1) when actor.button is pressed i set GA to true
2) actor.that.moves has a rule that when GA is true it moves 10 pixels to the right.
3) i have a timer in actor.button that resets the GA to false after a second or two (when I know the move is complete)
4) I have another button that sets GA.LEFT to true
5) actor.that.moves has another rule that when GA.LEFT is true it moves 10 pixels to the left.
BUT... actor.that.moves appears to have stopped listening after the first move.
Does that clarify?
* actor.that.moves only responds to the first GA value change. Not to any others.
Actor.that.moves behaviors look like this:
* control camera
* if GA.right = true then move 1024 to the right relative to the actor
* if GA.left = true then move 1024 to the left relative to the actor
I've tried nesting things in various combinations. No luck.