Short version:
Thanks for adding additive modding of simdata file (although it is very error prone because of how mergeMode works).
Could you please also add additive modding for the anim files (<animfile>)?
Long version:
thank you very much for adding additive modding of animations (simdata.xml). I want to report possible bugs/problems with this new simdata modding. I hope xml code will be displayed correctly.
Could you tell us if this is a bug or how we modders are supposed to additive change existing animinfo from simdata.xml?
Example: I created a simdata_mods.xml in game/data/gameplay folder with the following content:
<simdatamods>
<animxml file="spc\units\reginleif\reginleif.xml">
<animations>
<animinfo>
<name>Heal</name>
<versioncount>1</versioncount>
<versions>
<version>
<file>spc\units\reginleif\anim\reginleif_heal_a</file>
<duration>2.26667</duration>
<tags>
<tag>
<type>SpecificSoundSet</type>
<position>0.00000</position>
<properties>
<checkvisible>1</checkvisible>
<set>Heal</set>
</properties>
</tag>
<tag>
<type>particles</type>
<position>0.00000</position>
<properties>
<popcornfxname>glow\valkyrie_heal.pkfx</popcornfxname>
<bone>vfx_heal</bone>
<movewithbone>1</movewithbone>
<stopwithanim>0</stopwithanim>
<adjustduration>1</adjustduration>
</properties>
</tag>
<tag>
<type>particles</type>
<position>0.66000</position>
<properties>
<popcornfxname>glow\valkyrie_heal_pulse.pkfx</popcornfxname>
<bone>vfx_heal</bone>
<movewithbone>1</movewithbone>
<stopwithanim>1</stopwithanim>
<adjustduration>0</adjustduration>
</properties>
</tag>
</tags>
</version>
</versions>
</animinfo>
</animations>
</animxml>
</simdatamods>
This “Heal” animinfo is a 1:1 copy of the vanilla code, expected result is: It does basically nothing: overwriting vanilla with vanilla values.
But still when you enable this code as a mod and have dataValidation enabled, you will get the following errors:
SimDatabase::TagEvent::load (in simdata.xml) - Unknown property supplied to Particles event: “checkvisible” = “1” AnimType: Heal AnimXML: spc\units\reginleif\reginleif.xml
SimDatabase::TagEvent::load (in simdata.xml) - Unknown property supplied to Particles event: “set” = “Heal” AnimType: Heal AnimXML: spc\units\reginleif\reginleif.xml
I confirmed that the reason for this error is the additive modding, not the content itself. And it also works fine when adding a new animinfo with mergeMode=“add”. But obviously mergeMode=“modify” is not applied like we are used to:
From proto_mods.xml and other additive modable files we are used to that if not mentioning “mergeMode” it defaults to “modify”. So based in this the above code should be fine.
At least as long your internal code to execute the additive mod is able to properly identify what already exists (modify if exists) or if it needs to add if it not exists.
The way AoMR handles additive modding does heavily rely on correct implementation on the devs side, because with these “mergeMode” we modder are unable to properly target something specific, all relies on your implementation that the check if sth already eixsts does work.
After some testing it seems the “modify” is simply unable to identify which “tag” from the “tags” should be edited, since they do not have a “name” to identify them.
So I assume here the system you implemented reaches its limits. I assume you have to implement an alternative for targetting specific element nodes, eg. via XPath (example how xml modding is done with xpath in Anno 1800: https://jakobharder.github.io/anno-mod-loader/modops/basics/).
Please tell us if this is a bug you are able to fix, or how we modders are supposed to modify existing animinfo in simdata.xml additive.
How are we supposed to additive mod the animfiles ? For example game\art\spc\units\reginleif\reginleif.xml ?
You added additive simdata.xml modding, thanks, but it looks like you forgot it for these animfiles? At least creating a reginleif_mods.xml at this location with this content:
<animfilemods>
<anim mergeMode="add">Convert<assetreference type="TMAnimation"><file>spc\units\reginleif\anim\reginleif_heal_a</file><duration>2.26666</duration><tag type="SpecificSoundSet" checkvisible="1" set="Converting">0.0</tag><tag type="particles" popcornfxname="glow\conversion_casting.pkfx" bone="vfx_convert" movewithbone="true" stopwithanim="true" adjustduration="true">0.17</tag></assetreference><component>ModelComp</component></anim>
</animfilemods>
seems not to work, while this structure does work eg. for name.tactics files, which have a similar structure.
Please either add additive modding for these files or tell us how to do it, if it already exists.