#PARAM 1 shootrange 1.5 #PARAM 2 engagedist 1.5 PARAM 0 visibility 20 PARAM 1 shootrange 3.5 PARAM 2 engagedist 3.0 #start state state Base { Conditions { if GotTriggerArea == 1 goto Idle if PreviousResult == 0 goto Idle } Actions { NoAttack NoLosCheck DontPush Respawnable "origin" } } #CheckLevelFlag #waiting for attack state Idle { Conditions { if GotOpponentName "mr_beaver" == 1 goto GetToBeaver if Message "logstart" == 1 goto Patrol } Actions { } } #now normal patrol state Patrol { Conditions { if GotOpponentName "mr_beaver" == 1 goto GetToBeaver if GotOpponent == 1 goto ApproachOpponent # if Message "Wind" == 1 goto Wind } Actions { NoAttack false IgnoreWallSplines false FollowPath } } #follow the opponent till we get in range state ApproachOpponent { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 1 goto GetToBeaver # if Message "Wind" == 1 goto Wind if Message "logdone" == 1 goto RespawnOff if OpponentRange < 3.0 goto AttackOpp } Actions { FollowAttack } } state ApproachAttack { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 1 goto GetToBeaver # if Message "Wind" == 1 goto Wind if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state Think { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 1 goto GetToBeaver # if Message "Wind" == 1 goto Wind if Message "logdone" == 1 goto RespawnOff if OpponentRange > 3.5 goto ApproachOpponent if Random < 0.6 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "0.6" } } state Wait { Conditions { if OpponentRange > 3.5 goto ApproachOpponent if GotOpponentName "mr_beaver" == 1 goto GetToBeaver if Message "logdone" == 1 goto RespawnOff # if Message "Wind" == 1 goto Wind } Actions { FaceOpponent "0.6" Setstate "Think" } } state AttackOpp { Conditions { if Message "logdone" == 1 goto RespawnOff if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" # "instant" } } state Wind { Conditions { if Message "Wind" == 0 goto Patrol } Actions { } } state CirclePlayerClockwise { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if CircleClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.8" "walk" "CLOCKWISE" } } state CirclePlayerAntiClockwise { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if CircleAntiClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.8" "walk" "ANTICLOCKWISE" } } state RespawnOff { Conditions { } Actions { NoAttack Respawnable "false" KillMe } } state GetToBeaver { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 0 goto Patrol if InLevelNode "BeaverWay" == 1 goto AttackBeaver if Message "logdone" == 1 goto RespawnOff } Actions { # dont need but good example SetPathCnxFlag "from=BeaverFrom" "to=BeaverWay" "REQPERMISION" #allows this wolf only to go down a permision route IgnoreWallSplines SetReqPermision GoToNode "BeaverWay" } } state AttackBeaver { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 0 goto Patrol if OpponentRange < 2.5 goto EngageMrBeaver if Message "logdone" == 1 goto RespawnOff } Actions { FollowAttack } } state EngageMrBeaver { Conditions { if GotOpponent == 0 goto Patrol if GotOpponentName "mr_beaver" == 0 goto Patrol if OpponentRange > 2.2 goto AttackBeaver if Message "logdone" == 1 goto RespawnOff } Actions { } }