PDA

View Full Version : Advanced/"Conditional" avatar animations


vjonshih
09-15-2004, 11:04 AM
Hi there,

I was wondering -- if I, for example, have two avatars (say a man and a woman) in my world -- and I have this queue of actions for one avatar to perform (the man):

turn_left = male.turn(270)
male.act(turn_left)
word = male.speak('sound.wav', .5)
male.act(word)
turn_right = male.turn(180)
male.act(turn_right)

How would I insert a 'conditional' action that makes the other avatar (the woman) fall down (i.e. action 7) right as the man starts speaking?

Thanks in advance for your help.

farshizzo
09-15-2004, 11:13 AM
Hi,

You can setup callbacks for when actions are beginning and ending. So in this case setup a callback for when an actions starts then perform whatever action you need. Here's some sample code:def beginaction(avatar,action,type):
if avatar == male and action == word:
print 'The male has started speaking'

viz.callback(viz.AVATAR_BEGIN_EVENT,beginaction)