machine RaptorHunger { default state HungerStart { action StartLook("LookProximity", 0.5) action ClearTarget() transition { goto PreWanderAcquire } } state PreWanderAcquire { action SetSpeedModifierWalk(1.0) action SetRunMode(false) /* transition GetFlockHungerNeed() { goto FlockTargetCheck } action AcquireLatchTarget("food") transition HasTarget() { goto TargetCheck } transition AcquireHuman() { goto TargetCheck } */ transition { action SetWander() ;//action LookAtRandomPositionExtent(2.0, 0.35, 0.15) ;//action SetRandomTimerBetween(2, 2.0, 3.0) goto Wander } } state Wander { transition HasArrived() { goto PreWanderAcquire } transition GetFlockHungerNeed() { goto FlockTargetCheck } action AcquireLatchTarget("food") transition HasTarget() { goto TargetCheck } transition AcquireHuman() { goto TargetCheck } transition AcquirePrefPrey() { goto SmallTargetCheck } /*transition IsTimerUp(2) { action LookAtRandomPositionExtent(2.0, 0.35, 0.15) action SetRandomTimerBetween(2, 2.0, 3.0) goto Wander ;// stay in this state }*/ } state TargetCheck { transition IsTargetDead() == false { direct goto TargetCheckHunger } transition GetVariable("foodenergy") > 0.9 { goto Wander } transition { direct goto TargetCheckHunger } } state TargetCheckHunger { transition IsTargetDead() { goto EatCheck } transition IsTargetHuman() { call RaptorVistorAttack EatCheck } transition { direct goto Seek } } state SmallTargetCheck { transition IsTargetDead() == false { direct goto SmallTargetCheckHunger } transition GetVariable("foodenergy") > 0.9 { goto Wander } transition { direct goto SmallTargetCheckHunger } } state SmallTargetCheckHunger { transition IsTargetDead() { goto EatCheck } transition IsTargetSmall() { action PlayAnim("call", "01_lp", false) call RaptorAttack EatCheck } transition { goto Wander } } state FlockTargetCheck { transition IsTargetDead() == false { direct goto FlockTargetCheckHunger } transition GetVariable("foodenergy") > 0.9 { goto Wander } transition { direct goto FlockTargetCheckHunger } } state FlockTargetCheckHunger { transition GetFlockTarget() == false { goto Wander } transition CanAttackTarget() == false { action ClearTarget() goto Wander } transition IsTargetDead() { goto EatCheck } transition IsTargetSmall() { action PlayAnim("call", "01_lp", false) call RaptorAttack EatCheck } transition { direct goto Seek } } state Seek { transition { action PlayAnim("call", "01_lp", false) call RaptorHunt EatCheck } } state EatCheck { transition GetVariable("foodenergy") > 0.9 { goto PreWanderAcquire } transition IsTargetDead() { call RaptorEat PreWanderAcquire } transition { goto PreWanderAcquire } } ;//------------------------ Exit States Begin ---------------------- exitstart state HungerCleanUp { transition { direct goto HungerCleanUpEnd } } exitend state HungerCleanUpEnd { action StopLook() } ;//------------------------ Exit States End ---------------------- }