Content definition document - DW2MC/DW2ModLoader GitHub Wiki
Description
The content definition document context.
This is the start of a content patch YAML document. This is where you pick which definition root context to work in.
Each definition root context is named after it's content definition type in Distant Worlds 2.
Instructions
Inside of a definition context, you have access to some instructions.
state:
Modify the shared global state, either creating or modifying variables.
add:
Add a new definition object.
remove:
Remove an existing definition object by its ID.
remove-all:
Not yet implemented.
Remove existing definition objects by matching a $where clause.
Use a $where clause to describe which to remove by resolving as true or non-zero.
update:
Modify an existing definition object by its ID.
Only in the case of EmpirePolicy, this may look similar to update-all:.
- You must use a
$whereclause to describe which to update by resolving as true or non-zero similar toupdate-all:, however you have access toempire. - This is applied at the creation of an
EmpirePolicyso will occur when empires are generated, which may theoretically occur even while the game is running.
update-all:
Modify existing definition objects by matching a $where clause.
Use a $where clause to describe which to update by resolving as true or non-zero.
template:
Not yet implemented. Make a new copy of a definition object but with a new ID.
Supported definition root contexts
The following are all of the content definitions contexts currently supported.
- ArmyTemplate
- Artifact
- CharacterAnimation
- CharacterRoom
- ColonyEventDefinition
- ComponentDefinition
- CreatureType
- DesignTemplate
- EmpirePolicy
- FleetTemplate
- GameEvent
- Government
- LocationEffectGroupDefinition
- OrbType
- PlanetaryFacilityDefinition
- Race
- ResearchProjectDefinition
- Resource
- ShipHull
- TroopDefinition