[#modding] **Feature request (modding):** a way of including or excluding XML data conditio...

Issue #8720 new
Freehold Games Bot Account created an issue

Marked for crossposting by: orb strategy mode (books)

Message (jump):

<kernelmethod> Feature request (modding): a way of including or excluding XML data conditional on the value of a key in the game's global state dictionary. The idea is to make it possible to conditionally enable or disable content based on player-selected settings.

I'm imagining a couple possible ways of implementing this (there may be better/more easily-implemented ones):

Version 1: when merging tables with Load="Merge", allow modders to specify an attribute that checks whether a key exists in the state dictionary before performing the merge. For example,

<objects> <object Name="Ctesiphus" Load="Merge" IfGameStateTrue="Kernelmethod_MyMod_EnableContent"> <part Name="Render" ColorString="&amp;B"></part> </object> </objects>

This would check whether The.Game.GetBooleanGameState("Kernelmethod_MyMod_EnableContent") is true before merging the new table into the old one for Ctesiphus.

Version 2: create a new tag that checks a key in the global state dictionary before including an item in a given population table. This new tag would serve a vaguely similar function to tags like ExcludeFromDynamicEncounters or ExcludeFromVillagePopulations. Ex:

<objects> <object Name="Ctesiphus" Load="Merge"> <tag Name="ExcludeIfGameStateFalse" Value="Kernelmethod_MyMod_EnableContent" /> </object> </objects>

The game would check whether The.Game.GetBooleanGameState("Kernelmethod_MyMod_EnableContent") is true before including Ctesiphus in a given population table.

Comments (3)

  1. Ray

    It would also be convenient to have this for enabling/disabling content based on the inclusion / exclusion of other mods

  2. Log in to comment