Posted December 02, 2017 by Commodore Shawn
2.1 is here, with reworks to combat, Maskling AI, and quieter lumberyards.
Mods can now change data files instead of replacing them. There are three new XML elements you can add to an xml file to your mod, these will be processed after mods are unpacked, but before data is loaded, changing the XML files themselves.
<remove_element
parent_type="race" parent_id_attribute="id" parent_id_value="race_human"
target_type="available_structure" target_id_attribute="id" target_id_value="human_tower_0"/>
This will remove an element from the data file. This example will remove <available_structure id="human_tower_0" /> from h_r_human.xml (which removes towers from the human race). parent_type, parent_id_attribute, and parent_id_value all identify the element containing the element to remove. target_type, target_id_attribute, and target_id_value, identify the element to remove. So, the above will:
Find an element in the XML file named "race", that has an attribute "id" that has the value "race_human", then remove all of its children that are named "available_structure", with an attribute "id" that has the value "available_structure".
<add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="maskling_ratpen" /> </add_element>
This adds an element. Like remove_element above, parent_type, parent_id_attribute, and parent_id_value all determine what element will be targeted, if a target is found, the contents of the "add_element" element, will be added to the target. This example adds <available_structure id="maskling_ratpen" /> to the human race definition, which gives humans the ability to build maskling ratpens.
<set_attribute parent_type="race" parent_id_attribute="id" parent_id_value="race_maskling"
attribute="player_available" value="true"/>
The last element changes an attribute value (or adds an attribute with a value). Like the other two, parent_type, parent_id_attribute, and parent_id_value determine the target. attribute is the name of the attribute to change, and value is the value the attribute should have. This example will change the "player_available" attribute to "true" for the maskling race, which makes the race available to pick when starting a new game.
TestMod, which is distributed with Bronze Age has an example of these new data modifiers.