Skip to content

Multi Verb Combat Framework

Joshua edited this page Jun 13, 2023 · 11 revisions

Multi Verb Combat Framework (MVCF) enables pawns to use ranged attacks provided by hediffs, apparel, and their race. In addition, it provides many unique features for additional flexibility in defining your attacks.

Getting started

The first thing you have to do to use MVCF is create a MVCF mod definition. In some def file in your mod, add a MVCF.ModDef, and enter a defName, label, and description. defName must be unique to your mod, and the other two do not matter, they just must not be empty. None of these fields will ever be shown to the player. Next, add a ActivateFeatures tag, which will be filled as you develop. Whenever this documentation mentions "You must enable the SomeFeatureHere feature in your ModDef", it means you need to add SomeFeatureHere as a list item inside ActivateFeatures. For example, here's a mod def enabling the RangedAnimals, HediffVerbs, and IntegratedToggle features: (Credit to Sarg)

<MVCF.ModDef>
	<defName>AA_AlphaAnimals</defName>
	<label>Alpha Animals</label>
	<description>Adding animal ranged attacks for Alpha Animals creatures</description>
	<ActivateFeatures>
		<li>RangedAnimals</li>
		<li>HediffVerbs</li>
		<li>IntegratedToggle</li>
	</ActivateFeatures>
</MVCF.ModDef>

How to add Verbs?

How you go about adding the verbs depends on what you want to add them to.

Apparel

With Apparel, put the verbs in the verbs field of the ThingDef, then add MVCF.Comps.CompProperties_VerbGiver to its comps. This requires enabling the feature ApparelVerbs in your ModDef.

Hediffs

Now, HediffDef doesn't have a verbs field, so you need to put the verbs in the comp itself. Add a HediffCompProperties_VerbGiver to the comps and then put your verbs in the verbs field of it. This requires enabling the feature HediffVerbs in your ModDef. If these hediffs may be applied to an animal, you also need to enable the RangedAnimals and IntegratedToggle features.

Weapons with multiple attacks

Another thing MVCF allows is a weapon that has more than one ranged attacks. To use this feature, simply add more verbs to the verbs field or your weapon's ThingDef. This requires enabling the feature ExtraEquipmentVerbs in your ModDef.

RaceDef

To have a pawn's race give them a ranged attack, simple add a verbs field to the pawn's race's ThingDef. If you are adding these to an animal, you need to enable the RangedAnimals and IntegratedToggle features.

AdditionalVerbProps

Want to customize your verbs even more? You need to provide AdditionalVerbProps. How you do this depends on how you provided the verbs. All the verbProps fields here are lists of the class AdditionalVerbProps.

Apparel

Simply add a verbProps field to your VerbGiver comp.

Hediffs

Switch HediffCompProperties_VerbGiver to MVCF.Comps.HediffCompProperties_ExtendedVerbGiver and add a verbProps field.

Equipment

Switch the li in comps with compClass of CompEquippable to have a Class of MVCF.Comps.CompProperties_VerbProps, then add a verbProps field. Or, you can give them a new comp of type MVCF.Comps.Comp_VerbProps, with properties of MVCF.Comps.CompProperties_VerbProps.

Weapons that act like ranged weapons.

One unique feature of MVCF is the ability to give ranged attacks to melee weapons, and have them still considered melee. This is useful if you want extra abilities on your spear or axe or whatever. To do this, provide <ConsiderMelee>true</ConsiderMelee> as a sibling node to the verbProps for your weapon.

RaceDef

Verbs on animals with no props will always be togglable. That being said, you can provide them with some by giving the pawn a Comp_VerbProps.

VFE Core

General Comp classes

General DefModExtensions

Item Processor

PipeSystem

Custom Structure Generation

Multi Verb Combat Framework - MVCF

Animal Behaviours

Genes

Apparel

Cuisine

Furniture

Plants

Deprecated

Clone this wiki locally