Skip to content

missionRules beta ​

Function of @v12-engine/engine/ai

ts
export declare function missionRules(options?: {
    rules?: MissionRule[];
}): GamePack;

Mission rules as data (campaign plan MS1): the rules a map keeps (MissionRule, under GameMap.data.rules, written in the editor's Rules panel) run as the game plays, rules of the game's own code beside them. Each when a condition of the computer players' language holds (docs/ai/scripting.md), asked as a player, does its actions (MissionActionData: an objective of the map's given, done or failed, a line said, a cinematic played, a prefab spawned, a computer told, a relation set, a timer started, win, lose). Checked once a second; what the rules remember is in the world's state, so a save mid-mission has it. The code reaches the rules with tellRules and hears them fire as ruleFired; the map's checks say what is wrong with them (checkMissionRules). Of @v12-engine/engine/ai, as a condition is asked of a watcher seated as the computer players are (ruleWatcher); the map objectives pack (mapObjectives) goes with it, for the objectives a rule gives