Plans

Location: Data/Scripts/AI/[LandMode/SpaceMode]

Plans are where Goals are put into action. Plans are Lua Scripts that run when a goal has been activated. The AI uses the Plan script to produce a TaskForce to achieve the goal, and then execute movements or production as necessary.

Plans are linked to Goals via the Category variable in the Definitions function of the script. Multiple plan scripts can be linked to the same Goal, however I am unsure as to how the AI decides which plan to use.

Modding Note:

The Set_As_Goal_System_Removable function in Plan scripts is very important: it tells the AI that once the goal has been activated and the plan has started it cannot be stopped until the script completes. This can be useful if you have goals that may rapidly become obsolete, but that you still want to run their course once activated.