#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 { if LevelValue "Wolf" != 0 goto EnableCharacter } Actions { Disable SetHitPoints "default 3" #IgnoreWallSplines CheckWallSplines NoAttack NoLosCheck Respawnable "origin" } } #--------------------------------------------- # Enables the character #--------------------------------------------- state EnableCharacter { Conditions { } Actions { DontPush Enable SetState "GotoLocator" } } state GotoLocator { Conditions { } Actions { GotoLocator "xz_rangecheck" "1.0" SetState "Patrol" } } state Patrol { Conditions { if GotOpponent == 1 goto ApproachOpponent } Actions { NoAttack false FollowPath } } 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.0" } } state RespawnOff { Conditions { } Actions { Respawnable "false" NoAttack KillMe } } state Killed { COnditions { } Actions { SetLevelValue "type Dead" "value 1" SetLevelValue "type Wolf" "value 0" #SetState "Base" } }