#PARAM 1 shootrange 1.5 #PARAM 2 engagedist 1.5 PARAM 0 visibility 20 PARAM 1 shootrange 3.5 PARAM 2 engagedist 2.0 #--------------------------------------------- # Start state #--------------------------------------------- state Base{ Conditions { } Actions { Disable SetHitPoints "default 3" NoAttack NoLosCheck IgnoreWallSplines CheckWallSplines Idle "mintime 1.5" "maxtime 4.0" MessageWait "WOLFATTACK" "1.0" SetState "Enable" } } #--------------------------------------------- # Enables the character #--------------------------------------------- state Enable { Conditions { } Actions { DontPush Enable SetState "Patrol" } } #now normal patrol state Patrol { Conditions { if GotOpponent == 1 goto ApproachOpponent } Actions { NoAttack false FollowPath } } #follow the opponent till we get in range state ApproachAttack { Conditions { if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange < 3.0 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs > 300.0 goto BackupTurn if Random < 0.7 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "0.4" } } state Wait { Conditions { if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs > 300.0 goto BackupTurn } Actions { FaceOpponent "0.4" Setstate "Think" } } state AttackOpp { Conditions { if TurnAngAbs > 300.0 goto BackupTurn if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" } } state BackupTurn { Conditions { if GotOpponent == 0 goto Patrol if OpponentRange > 3.5 goto ApproachOpponent if TurnAngAbs < 256.0 goto Think } Actions { BackupTurn "goalrange 5.0f" } }