Justintime9 wrote:Well, that's still pretty much latin to me, (what the heek are states?), but here's what I want to do: The button will open a wide window, the first time the button is pressed, it will open, the second time, it will close. When the button is clicked, the avatar will do the push button animation.
Terribly sorry. I honestly tried to make it as legible as I could, speaking about something I don't really understand myself. I'll begin with the states bit:
Ok, we're kind of dealing with metaphors here... You do physics at school, right? Now a body of water can be in different "states", or maybe one could say "ways of being", like "Solid state" (frozen), "Liquid state" (fluid) and "Gaseous state" (steam). Likewise, a ball sitting on a tabletop is said to be in a "static" or "resting" state, push it and it is in a rolling state, only to go into a falling state as it goes over the edge. :P
You have just defined two states for your window: "Open state" and "Closed state".
Our metaphorical representation of this, in alcscript, is two lists:
"what do do if the user presses the button while the window is closed" and
"what to do if the user presses the button while the window is open".
You can see one such list in the example alcscript I pasted, although it contains only a single entry.
Disregarding, for the time being, any other effects you might want in there, like the button lighting up, as you push it, each of your two "states" lists of actions would consist of two messages sent:
1) a "onestagemod", which makes the avatar perform an action
2) an animation message, sent to you window
The onestagemod will send a "callback" message, at a certain frame of the avatar animation (when hand makes contact with button) saying "Ok, I've pressed the button now" and you will use this to make the animation message, that opens the window, not start until the avatar is done with exercising her/his impressive buttonpressing skills. You do this by assigning the "callback" a number and then use that number on the "waiton" line of the window animation message.
Oh man.. too wordy again. :P
Whether studying the alcscript above tells you anything or not, you'd do well to study the "original" from which I harvested it. :P Nadnerb's AnimatedDoor example age, found at the bottom of the animations wiki page:
http://www.guildofwriters.com/wiki/AnimationsIt does what you want and more.
Good luck. :7