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 $where clause to describe which to update by resolving as true or non-zero similar to update-all:, however you have access to empire.
  • This is applied at the creation of an EmpirePolicy so 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.