machine RaptorHunt { state HuntInit { ;//action SetAesPosInterp(false) action SetSpeedModifier(1.2) action SetRunMode(true) action SetRand(0, 2) action AddRandomAnimation("call", "01_lp", 4.0, 10.0) action SetRandomTimerBetween(4, 30.0, 40.0) action SetFlockHungerNeed(true) action GetFlockTarget() action LockMachine(false) transition CanAttackTarget() == false { action ClearTarget() goto HuntExit } transition { direct goto HuntBegin } } state HuntBegin { action SendEnclosureEvent("seek_prey") transition HasTarget() == false { direct goto HuntExit } transition IsTargetDead() { goto HuntExit } ;//action SeekTarget() transition { action CreateKnockMusterZoneTarget(true, false) goto Hunt } } state Hunt { transition GetRand() == 0 { goto SeekLeft } transition { goto SeekRight } /* transition InTargetProximity(7.0) == true { direct goto LatchCheck } transition HasArrived() { direct goto LatchCheck } */ } state SeekLeft { transition HasTarget() == false { direct goto HuntExit } transition IsTargetDead() { direct goto HuntExit } transition SeekTargetOffset(3.0, -1.57, true, false, true) == false { action SetRandomTimerBetween(4, 5.0, 6.0) goto SeekFail } transition InSetPosProximityRadius(2.5) == true { direct goto LatchCheck } transition InTargetProximityRadius(1.0, true) == true { direct goto LatchCheck } transition IsTimerUp(4) { goto HuntExit } /*transition HasArrived() { direct goto LatchCheck } */ } state SeekRight { transition HasTarget() == false { direct goto HuntExit } transition IsTargetDead() { direct goto HuntExit } transition SeekTargetOffset(3.0, 1.57, true, false, true) == false { action SetRandomTimerBetween(4, 5.0, 6.0) goto SeekFail } transition InSetPosProximityRadius(2.5) == true { direct goto LatchCheck } transition InTargetProximityRadius(1.0, true) == true { direct goto LatchCheck } transition IsTimerUp(4) { goto HuntExit } /* transition HasArrived() { direct goto LatchCheck } */ } /* state SeekFail { transition SetWander() { action SetRandomTimerBetween(4, 15.0, 20.0) action SetSpeedModifierWalk(1.0) action SetRunMode(false) goto FailWander } transition IsTimerUp(4) { goto HuntExit } } state FailWander { transition IsTimerUp(4) { goto HuntExit } transition HasArrived() { goto HuntExit } } */ ;///////////////////////////////// state SeekFail { transition GetRand() == 0 { direct goto CornerSeekLeft } transition { direct goto CornerSeekRight } } state CornerSeekLeft { transition HasTarget() == false { action ClearTarget() goto HuntExit } transition IsTargetDead() { goto HuntExit } transition InTargetProximityRadius(3.5, true) { direct goto LatchCheck } transition SeekTargetOffset(3.0, 1.57, true, false, true) { goto SeekLeft } transition SeekTargetOffset(-5.0, 0.0, false, false, true) == false { action ClearTarget() goto HuntExit } } state CornerSeekRight { transition HasTarget() == false { action ClearTarget() goto HuntExit } transition IsTargetDead() { goto HuntExit } transition InTargetProximityRadius(3.5, true) { direct goto LatchCheck } transition SeekTargetOffset(3.0, -1.57, true, false, true) { goto SeekLeft } transition SeekTargetOffset(-5.0, 0.0, false, false, true) == false { action ClearTarget() goto HuntExit } } ;/////////////////////////////// state LatchCheck { transition IsTargetDead() { direct goto HuntExit } transition IsTargetHelicopter() { direct goto HuntExit } transition LatchOnTarget() == true { action StopAllRandomAnimations() action LockMachine(true) action StopAllUserAnimations() action SetAutoMovementBlend(false) action PlayAnim("leap", "st", false) action SetAutoLinkAnimOff("leap", "st", true) ;//action SetRandomTimerBetween(4, 1.0, 1.0) ;//goto JumpWait goto LeapWait } transition { goto HuntBegin } } state LeapWait { transition IsAnimPlaying("leap", "st", false) == false { action SendEnclosureEvent("attack_prey") action PlayAnim("leap", "lp", false) action SetAutoLinkAnimOff("leap", "lp", true) goto JumpEnd } } /* state JumpWait { transition IsTimerUp(4) { action StopAnimState("leap") goto JumpEnd } transition IsAttached() == true { action StopAnimState("leap") goto JumpEnd } } */ state JumpEnd { transition IsAnimStatePlaying("leap") == false { goto GrappleInitWait } } state GrappleInitWait { transition IsAttached() == true { action PlayAnimLooping("grapple", "lp", false, -1.0, 2.0) action SetRandomTimerBetween(4, 3.0, 5.0) goto Grapple } } state Grapple { ;//action UpdateDeltaVariableTarget("Health", -10.0) action HurtTargetUnit(true, 1.0) transition IsTimerUp(4) { direct goto FallOff } transition IsTargetDead() { direct goto FallOff } } state FallOff { transition { action StopAnimState("grapple") action UnLatchFromTarget() action SetStandStill() action PlayAnimInstant("hit", "lt", true) ;//action SetRandomTimerBetween(4, 4.0, 5.0) goto FallWait } } state FallWait { transition IsAnimPlaying("hit", "lt") == false { action PlayAnimInstant("getup", "lt", true) goto GetupWait } } state GetUpWait { transition IsAnimPlaying("getup", "lt") == false { action LockMachine(false) action SetAutoMovementBlend(true) goto ExpUpdate } } state ExpUpdate { action UpdateVariable("health", -10.0) action UpdateVariable("Stress", -0.05) transition IsDead() { action SetKillCause("dino") direct goto AddExperience } transition { direct goto AddExperience } } state AddExperience { transition IsTargetDead() { action AddKillExperience(1, 0.0) goto HuntBegin } transition { goto HuntBegin } } state JumpRest { transition IsTimerUp(4) { action SetAutoMovementBlend(true) goto HuntBegin } } ;//----------------------- Exit States -------------------------- exitstart state HuntExit { transition { direct goto HuntEnd } } exitend state HuntEnd { action SetFlockHungerNeed(false) action StopAllRandomAnimations() action SetAutoMovementBlend(true) action UnLatchFromTarget() action LockMachine(false) action SetStandStill() ;//action SetAesPosInterp(true) } }