Trigger ability on damage - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

CompTriggerAbilityOnDamage makes an animal trigger an ability automatically when damaged. It will need to HAVE that ability, for which you can use CompInitialAbility

        public AbilityDef ability;

        public float minDamageToTrigger = 0;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this makes the Silverfish in Vanilla Faction Expanded - Insectoids 2 trigger a charge after receiving any damage

<comps>
	<li Class="VEF.AnimalBehaviours.CompProperties_TriggerAbilityOnDamage">
		<ability>VFEI2_WideTunnels</ability>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️