Hello!
I have been messing around with modding the game and eventually went ahead and created multiple vest models for my green faction. I accomplished this by editing the green_default.model file and adding this code:
Code:
<model filename="soldier_aX_vest.xml">
<requirement class="carry_item" slot="1" key="vest2.carry_item"/>
<requirement class="rank" range="0 100" />
</model>
<model filename="soldier_aX_vest.xml">
<requirement class="carry_item" slot="1" key="vest2_2"/>
<requirement class="rank" range="0 100" />
</model>
<model filename="soldier_aX_vest.xml">
<requirement class="carry_item" slot="1" key="vest2_3"/>
<requirement class="rank" range="0 100" />
</model>
While this works fine regarding getting the models ingame, it has created the unintended consequence of the models swapping whenever I get shot (the vest takes damage). When considering how to rectify it, I thought of two solutions:
Either I create a single model to use for whenever a vest is damaged, but ideally I'd like a way for the game to recognize the model I am currently using and then keep using that model for the damaged vest until I swap the vest out for a new one. I have some coding background in C++ and java, but this is my first time working in XML so I will need help getting the syntax correct.
After some quick googling I tried adding this:
Code:
<if model filename="soldier_aX_vest.xml">
<model filename="soldier_aX_vest.xml">
<requirement class="carry_item" slot="1" key="vest2_2"/>
<requirement class="rank" range="0 100" />
</model>
<model filename="soldier_aX_vest.xml">
<requirement class="carry_item" slot="1" key="vest2_3"/>
<requirement class="rank" range="0 100" />
</model>
</if>
as a primitive way to add a condition for each damaged vest state model (as I assume that's what Vest2_2 and Vest2_3 refer to), but I had no luck. I'm fairly certain my syntax is just plain wrong, but what I really want to know if my reasoning is sound, or if the game doesn't actually support this sort of thing.
Thanks for your help!