[Question] Increasing melee skill for an animal

Started by Valor, August 12, 2021, 07:58:48 PM

Previous topic - Next topic

Valor

If I would like to have an animal species with higher melee skill than 4, how should I update the XML, please? Anyone could provide me with example.

Thank you!

RawCode

are you sure that animals have melee skill of 4?

as far as i can see skill value is not used (directly) in code at all.

Valor

Might not be melee skill then?

This is what I am refering to

https://imgur.com/3usjz2Z

Any idea how to change (increase) it for specific animal species please?

Canute

I looked at the XML autodoc and found
MeleeHitChance
Maybe add these to your custom animal def.

but hey i am a noob in that, maybe RawCode know something better.

Valor

#4
You advice was sound and produced wanted effect (through in a bit more cumbersome way)

for future reference, this works.

in ThingDef

<statBases>
<MeleeHitChance>10.0</MeleeHitChance>
</statBases>


it will make base value 1000% and that will get turned to 84% in post processing (quite reasonable number for combat animal)

Once again, thank you!

RawCode

value of 4 comes from
  <StatDef>
    <defName>MeleeHitChance</defName>
    <label>melee hit chance</label>
    <description>Chance to hit a target in melee.\n\nThe target can still dodge even if we would've hit.</description>
    <category>PawnCombat</category>
    <neverDisabled>true</neverDisabled>
    <defaultBaseValue>0</defaultBaseValue>
    <minValue>0</minValue>
    <showOnPawns>false</showOnPawns>
    <toStringStyle>PercentZero</toStringStyle>
    <toStringStyleUnfinalized>FloatOne</toStringStyleUnfinalized>
    <noSkillOffset>4</noSkillOffset>