Forcing PawnDef apparel

Started by demeggy, October 17, 2016, 03:15:35 PM

Previous topic - Next topic

demeggy

Evening all!

So I've noticed a quirk in my WIP: I've created a faction, setup PawnDefs spawned by that faction, all works swimmingly - with the exception that some of the PawnDefs refuse to wear the Armour and Helmet tagged in their ThingDef Apparel.xml tags, nor be equipped with the weapon as tagged in their ThingDef Apparel.xml tags.

I can see there's an Apparel costing element to apparel that if I understand, is picked up by the PawnDef's min/max money allowance.

Is there a much easier way to force them to wear specific outfits?

Thanks,

Demeggy

kaptain_kavern

Have you tried :

<apparelRequired>
      <li>ThingDefName</li>
</apparelRequired>


Found it in /Core/Defs/PawnKindDefs_Humanlikes/PawnKinds_Mercenary.xml, line 212 (for forcing slasher to wear shield in Vanilla)

demeggy

Quote from: kaptain_kavern on October 17, 2016, 03:51:25 PM
Have you tried :

<apparelRequired>
      <li>ThingDefName</li>
</apparelRequired>


Fantastic! Thanks :) I was hoping <weaponRequired> would do a similar thing, alas, it doesnt exist...
Found it in /Core/Defs/PawnKindDefs_Humanlikes/PawnKinds_Mercenary.xml, line 212 (for forcing slasher to wear shield in Vanilla)

demeggy

Alas, weirdly, that forces them to equip a personal shield (despite them wearing the designated apparel).
What I did do as a temp workaround was to increase each pawns apparel money allocation to an insane amount, and lower the cost of the apparel.

    <apparelMoney>
      <min>100000</min>
      <max>1000000</max>
    </apparelMoney>

Still sometimes though, Pawns rock up partially nude. Any ideas?

kaptain_kavern

Quote from: demeggy on October 18, 2016, 03:23:12 PM
Alas, weirdly, that forces them to equip a personal shield (despite them wearing the designated apparel).
What I did do as a temp workaround was to increase each pawns apparel money allocation to an insane amount, and lower the cost of the apparel.

    <apparelMoney>
      <min>100000</min>
      <max>1000000</max>
    </apparelMoney>

Still sometimes though, Pawns rock up partially nude. Any ideas?
Wait that's weird, are you sure you haven't by mistake let the personalshield reference when you copy paste ?

I mean you should have

<apparelRequired>
      <li>YOUR MODDED THINGDEF</li>
</apparelRequired>


and not
<apparelRequired>
      <li>Apparel_shield</li>
</apparelRequired>


right ?

demeggy

Yup:

Free typed the tags in anyhoo rather than copy/paste, whacked my thingDef apparel in there - equips the apparel, but throws a personal shield over the top.

kaptain_kavern

Wow that is strange. I can't explain how. Maybe inherited from the base/abstract parent ?  Care to share the code for us to have a look ?

demeggy

Ah I removed it in the end! I'll add it back in shortly, see if it re-occurs, and if so, will pop the .xml up!