julie_dance: //Start of Julie dancing thread.
// ju_dance_st is a location that the thread returns to after a dance sequence is done.
ju_dance_st:
local.rndnum randomint 3 //generates integers 0, 1, or 2
local.rndnum ifequal 0 goto j_anim1
local.rndnum ifequal 1 goto j_anim2
local.rndnum ifequal 2 goto j_anim3
//Here is the first dance sequence.
j_anim1:
//The rotateY command spins Julie around. Here she spins 40 degrees per second.
//To stop rotation use rotateY 0.
$j1 rotateY 40
//The anim command has the script model perform the specified animation.
$j1 anim attack_5
//The attack_5 animation will be played for 1 second before
//the next line of code is read.
wait 1
$j1 anim combat_walk_strafe_right
wait 3
//This sequence is done, so return to ju_dance_st and choose another.
goto ju_dance_st
//Here is the second dance routine.
j_anim2:
$j1 rotateY 10
$j1 anim combat_turn_right
wait 4
$j1 anim hug_step_right
wait 1
goto ju_dance_st
//The third dance sequence.
j_anim3:
$j1 rotateY 60
$j1 anim combat_turn_left
wait 3
$j1 rotateY 0
$j1 anim alternate_fire_chaingun
wait 1
goto ju_dance_st
end //End of julie_dance thread.