Verb Comps - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

Verb Comps

Verb comps add additional features to verbs, mainly drawing, acting like turrets, or reloading.

Drawing

Drawing is done with MVCF.VerbComps.VerbCompProperties_Draw, and then the compClass set to MVCF.VerbComps.VerbComp_Draw. This requires the Drawing feature. The properties have these fields:

graphic : GraphicData (optional)

Provides a graphic, used for two things: 1. If draw is true, this is what will be drawn, and 2. this is used as an icon for the verb's gizmo. For more information, see Verb Icon Strategy.

specificPositions : List<DrawPosition> (optional)

List of draw positions to use. This is explained in More Details.

defaultPosition : DrawPosition (default: (0, 0))

If the owner doesn't match any defNames from specificPositions, then this DrawPosition is used.

drawScale : float (default: 1f)

How much to scale the icon when drawing. Only used if draw is true.

scalings : List<Scaling> (optional)

Specific scalings to use. This is explained in More Details.

humanAsDefault : bool (default: false)

If true, pawns that do not match any specific defName in scalings and/or specificPositions will search for the ones with a defName of Human. Useful to support modded races easily.

Turret

Independent Fire is done with MVCF.VerbComps.VerbCompProperties_Turret, and the compClass must be MVCF.VerbComps.VerbComp_Turret. This requires the IndependentFire feature. It has all the fields of VerbCompProperties_Draw, and these:

invisible : bool (default: false)

If true, then do not draw. This is for if you want a turret verb with no graphic.

uniqueTargets : bool (default: false)

If true, then it forces this verb to choose a different target from all the other verbs on the pawn.

Cooldown

Cooldowns are added with MVCF.VerbComps.VerbCompProperties_Cooldown, and compClass set to MVCF.VerbComps.VerbComp_Cooldown. It also has these fields:

cooldownTime : float

This sets the cooldown time in seconds.

Reloading

Reloading is done with MVCF.Reloading.Comps.VerbCompProperties_Reloadable, and compClass set to MVCF.Reloading.Comps.VerbComp_Reloadable. You can provide the following fields:

ItemsPerShot : int

Number of items that are needed to reload each shot of the weapon.

MaxShots : int

Maximum number of shots that can be loaded in this weapon.

ReloadTimePerShot : float

Number of seconds it takes to reload each shot of the weapon.

NewVerbClass : Type (optional)

Replace the class of the targeted verb with the provided one. Used if you want to remove a Verb_ShootOneUse, for example.

ReloadSound : SoundDef (optional)

Sound to play when reloading the weapon.

StartLoaded : bool (default: true)

If true, weapon will be loaded upon creation. Otherwise, it will be empty.

GenerateBackupWeapon : bool (default: false)

If true, then when a pawn is generated with this weapon, they will also be given a pistol or knife as a back-up.

GenerateAmmo : List<ThingDefCountRangeClass> (optional)

When a pawn is generated with this weapon, these items will be added to their inventory.

⚠️ **GitHub.com Fallback** ⚠️