Template:Goals
Bot's behaviour is controlled by states. Most of low-level states are written in C++ and they are compiled into dynamic link library. For example FollowPath, Aimer, LookAround, WeaponSystem, TargetingSystem, SensoryMemory. You can view them in the Debug Window. Most of high-level states are written in GameMonkey and we call them ScriptGoals. You can find them in omni-bot/et/scripts/goals folder or omni-bot/global_scripts/goals folder. You usually don't need to modify ScriptGoals.
Following tutorial is about MapGoals which are specific for each map. MapGoals are locations in the map that represent something for the bot to do. They are saved into omni-bot/et/nav folder and have _goals.gm suffix. Don't open goals files in text editor. They are automatically generated by command /bot goal_save. There is usually 1:1 relationship between ScriptGoal and MapGoal types, but there are a few exceptions. For example ScriptGoal CAMP can handle multiple MapGoals CAMP, ATTACK, DEFEND, SNIPE. Some ScriptGoals don't need any MapGoal because they are activated by game events. For example WatchForProjectile, InDisguise, DeliverSupplies, PickupItems.
Reference
Creating your first goal
- stand in a location where you want a camp goal. this does not have to be on a waypoint, in fact it is better if it is not directly on a waypoint.
- /bot goal_create camp test1
- face a direction you would like the bot to face
- /bot goal_setproperty facing 0
- optionally face another direction and add another facing with /bot goal_setproperty facing 1
- /bot goal_setproperty stance crouch
- note that the rendering for the aim vectors gets lowered depending on stance. prone would render much lower for example
- /bot goal_finish
- this deselects the goal
- /bot goal_save will save all the goals to the nav folder in <mapname>_goals.gm
Editing an existing goal
- /bot draw_goals on if not already rendering
- stand next to a goal
- /bot goal_edit
- this selects the goal and should be indicated in console
- /bot goal_move
- this will start moving the goal based on where you are aiming
- /bot goal_move
- this will stop moving the goal
- /bot goal_setproperty facing 2
- add another facing so the bots will scan an area
- /bot goal_finish
Auto Detected Goals
These goals are created automatically by the mod:
- AMMOCAB
- BUILD
- CHECKPOINT
- DEFUSE
- HEALTHCAB
- FLAG
- FLAGRETURN
- MOUNTMG42
- MOVER
- PLANT
- REPAIRMG42
- REVIVE
In most cases, the goal have all the information it needs without further input, and can operate correctly. Some goals have additional options that are specific to that goal type. For example, you can define cover spots at PLANT goal. You can use command goal_help to list all properties and you can change properties by command goal_setproperty.