My goal for Shell 410 is for the user to click the door, have the avatar walk over and touch it, and then have the door slide down with a rumbling sound.
I've got 2/3 parts working now. I've got the OneShotMod for the avatar to touch the door, I've got the sound, I've even got the actual animation objects created with a hex editor ready to be imported. I just need to write a message to start the animation (which I'll hopefully get working soon).
The key here is that the door should not start sliding down and the sound should not play until after the OneShotMod has finished animating. Luckily, there's an easy way to handle all of this. The ResponderModifier objects have a fWaitToCmd table, and all commands have an fWaitOn value. I set the fWaitOn value of my SoundMsg command to 0 (default is -1), and add an entry to the fWaitToCmd table. Key 0 has value 0.
Now, if I run Uru, I can click on the door, but the sound will never play, and the object will not be clickable again. I need to tell the ResponderModifier that the OneShotMod has finished, and that it can run the SoundMsg. In my OneShotMsg, I add a callback event that sends a notice to the ResponderModifier with a "user" variable. The user variable's value is the value of the fWaitToCmd table that we specified above.
The cmd fWaitOn gives a key for the fWaitToCmd table.
The value of that key is the user of a callback event from a message.
Once that callback is received by the ResponderModifier, the Wait'ed command will run.