These are proposals and may or may not end up in the game.
- Patching InfoTip export.bin
- Patching .cfg files
- Patching .fc files
- Link files
- Conditions with ModID
- Wrap ModOp Content
You can patch data/infotips/export.bin
by adding an export.bin.xml
patch file to your mod.
Example:
<ModOps>
<ModOp Type="merge" Path="//InfoTipData[Guid='500934']">
<InfoElement>
<VisibilityElement>
<VisibilityElement />
<VisibilityElement>
<ElementType>
<ElementType>1</ElementType>
</ElementType>
<CompareOperator>
<CompareOperator>1</CompareOperator>
</CompareOperator>
<ResultType>
<ResultType>1</ResultType>
</ResultType>
<ExpectedValueInt>102284</ExpectedValueInt>
<Condition>[Selection Object GUID]</Condition>
</VisibilityElement>
</VisibilityElement>
</InfoElement>
<!-- ... -->
</ModOp>
</ModOps>
Note: the counts InfoTipCount
, TemplateCount
and ChildCount
will be adjusted automatically, you don't need to change anything.
The format is the same as used in the FileDBReader.
You can patch .cfg files e.g. world_map_01.cfg
by adding an XML file with the same name plus .xml
as an extension.
<ModOps>
<ModOp Type="add" Path="//Models">
<Config>
<ConfigType>MODEL</ConfigType>
<!-- ... -->
</Config>
</ModOp>
</ModOps>
Note: patching is more expensive than replacing. Avoid it if you can.
You can patch .fc files e.g. world_map_01.fc
by adding an XML file with the same name plus .xml
as an extension.
Example:
<ModOps>
<ModOp Type="add" Path="/DummyRoot/Groups">
<i>
<hasValue>1</hasValue>
<Name>2111001</Name>
<Groups />
<Dummies>
<i>
<hasValue>1</hasValue>
<Name>2111001_0</Name>
<!-- position -->
<Id>$auto</Id> <!-- use auto -->
<HeightAdaptationMode>1</HeightAdaptationMode>
</i>
</Dummies>
<Id>$auto</Id>
</i>
<!-- ... -->
</ModOp>
</ModOps>
Note: you can use $auto
to automatically assign free ids. Use $auto(0)
, $auto(1)
, ... if you want to use the same auto id multiple times.
The format is the same as used in the FileDBReader.
You can link files by adding a text file with the extension .lnk
.
The path and name of the file is the link source, the text file contents is the link target.
This is useful to duplicate islands under a different path for example.
You can use conditions to check if a mod exists in any patch - not only assets.xml
patches.
It doesn't matter whether the mod is loaded before or after this mod.
Use LoadAfterIds
to ensure it's loaded before your mod.
<Group Condition="#NewWorldDocklands">
<ModOp Type="add" Path="@1404422070/ModuleOwner/ConstructionOptions">
<Item>
<ModuleGUID>1500010080</ModuleGUID>
</Item>
</ModOp>
<Group>
<ModOp Type="merge" Path="@1010399/AssetPool/AssetList"
Content="@120055/ProductStorageList/ProductList/Item/Product/text()">
<Item>
<Asset>
<ModOpContent />
</Asset>
</Item>
</ModOp>
Content source:
<ProductList>
<Item>
<Product>120008</Product>
</Item>
<!-- ... -->
</ProductList>
Merge target:
<AssetPool>
<AssetList>
<Item>
<Asset>120008</Asset>
</Item>
<!-- ... -->
</AssetList>
</AssetPool>