/* Galli Play Behaviour // */ machine GalliPlay { default state Start { action SendEnclosureEvent("play") action SetAutoMovementBlend(true) transition IsInFlock() == false { call JoinFlock SetMoveMode } transition { goto SetMoveMode } } state SetMoveMode { action StartLook("LookProximity", 0.5) action ClearTarget() action SetRand(0, 2) transition { action SetSpeedModifier(1.0) action SetRunMode(true) goto GetTarget } } state GetTarget { action SetRand(0, 2) transition GetRand() == 0 { direct goto SetWanderChose } transition AcquireFlockTarget(true) { goto FlockChangeCheck } } state SetWanderChose { transition SetWander() { action SetRandomTimerBetween(1, 5.0, 8.0) goto SeekWait } } ;// temp state FlockChangeCheck { transition IsTargetFlockBetter() { action JoinTargetFlock() goto SeekTarget } transition { goto SeekTarget } } ;// temp state SeekTarget { transition SeekTarget(false, false) { action SetRandomTimerBetween(1, 5.0, 8.0) goto SeekWait } transition { action ClearTarget() goto SetMoveMode } } state SeekWait { transition InTargetProximityRadius(1.5, true) { direct goto TalkInit } transition HasArrived() { direct goto TalkInit } transition IsTimerUp(1) { goto GetTarget } } state TalkInit { action StopLook() action SetStandStill() action SetRandomTimerBetween(1, 2.0, 3.0) action LookAtRandomPositionExtent(0.7, 0.9, 0.5) action PlayAnim("call", "02_lp", false) action SendEnclosureEvent("call_social") transition { goto Talk } } state Talk { transition IsTimerUp(1) { action LookEnd() action SetRandomTimerBetween(1, 4.0, 6.0) action SetWander() goto TalkWander } } state TalkWander { transition IsTimerUp(1) { action SetStandStill() goto SetMoveMode } } ;------------------------ Exit States Begin ---------------------- exitstart state CleanUp { action StopLook() transition { goto CleanUpEnd } } exitend state CleanUpEnd { } ;------------------------ Exit States End ---------------------- }