-
Notifications
You must be signed in to change notification settings - Fork 37
ThingDefExtension
The ThingDefExtension
of Vanilla Expanded Framework provides additional configurable features to weapons, apparel (including shields) and various other ThingDefs.
public class ThingDefExtension : DefModExtension
{
// For weapons
public bool usableWithShields = false;
public WeaponDrawOffsets weaponCarryDrawOffsets = null; // Offsets carried weapon regardless of stance
public WeaponDrawOffsets weaponDraftedDrawOffsets = null; // Only when drafted but not actively attacking/aiming
// For shields and apparel
public List<PawnKindDef> useFactionColourForPawnKinds;
// For artillery
public float siegeBlueprintPoints = SiegeBlueprintPlacer.ArtyCost;
// For thing that can be discovered by deep scanner
public Color deepColor = Color.white;
public float transparencyMultiplier = 0.5f;
public bool allowDeepDrill = true;
// For buildings that need to render deep resources mouse attachments
public bool deepResourcesOnGUI = false;
public bool deepResourcesOnGUIRequireScanner = true;
// For skyfallers that can fall into shield fields
public int shieldDamageIntercepted = -1;
public bool destroyCorpse;
}
Add the VFECore.ThingDefExtension
Def Extension to the ThingDef
you want to customize, and specify optional parameters as desired:
<modExtensions>
<li Class="VFECore.ThingDefExtension">
<!-- Specify optional parameters here -->
</li>
</modExtensions>
For oversized weapons such as the Warcasket lasers and wardrone mini-blasters from Vanilla Factions Expanded - Pirates, you can use weaponCarryDrawOffsets
to specify draw offsets and angles. These apply at all times, whenever the pawn is drafted, carrying weapons openly, watching for targets or actively aiming/attacking a target.
<!-- Example: VFEP_WarcasketGun_LaserBlaster from Vanilla Factions Expanded - Pirates -->
<modExtensions>
<li Class="VFECore.ThingDefExtension">
<weaponCarryDrawOffsets>
<north>
<drawOffset>(0,0,-0.18)</drawOffset>
</north>
<east>
<drawOffset>(0,0,-0.18)</drawOffset>
</east>
<south>
<drawOffset>(0,0,-0.18)</drawOffset>
</south>
<west>
<drawOffset>(0,0,-0.18)</drawOffset>
</west>
</weaponCarryDrawOffsets>
</li>
</modExtensions>
For long polearm weapons such as pikes and halberds, you can use weaponDraftedDrawOffsets
to specify draw offsets and angles that only apply when the pawn is drafted, carrying weapons openly, watching for targets - aiming is not affected.
<!-- Example: Mousekin Pike from Mousekin Race -->
<modExtensions>
<li Class="VFECore.ThingDefExtension">
<weaponDraftedDrawOffsets>
<north>
<drawOffset>(0.25, 0, 0.36)</drawOffset>
<angleOffset>-143</angleOffset>
</north>
<east>
<drawOffset>(0.1, 0, 0.42)</drawOffset>
<angleOffset>-122</angleOffset>
</east>
<south>
<drawOffset>(-0.25, 0, 0.47)</drawOffset>
<angleOffset>-143</angleOffset>
</south>
<west>
<drawOffset>(-0.1, 0, 0.42)</drawOffset>
<angleOffset>122</angleOffset>
</west>
</weaponDraftedDrawOffsets>
</li>
</modExtensions>
- All orientations (north/south/east/west), position and angular offsets are optional, and default to 0,0,0 and 0 degrees respectively
- Both
weaponCarryDrawOffsets
andweaponDraftedDrawOffsets
can be used simultaneously - The offsets apply cumulatively over the base game's existing
equippedAngleOffset
parameter
For items or resources that can be mined using Deep drills, you can customize the color and transparency of their associated underground deposits detected by the Long-range mineral scanners:
<modExtensions>
<li Class="VFECore.ThingDefExtension">
<deepColor>(0.72, 0.29, 0.29)</deepColor> <!-- defaults to white if unspecified -->
<transparencyMultiplier>0.75</transparencyMultiplier> <!-- defaults to 0.5 if unspecified -->
</li>
</modExtensions>
- QuestNode_GetFaction
- Expandable projectiles
- Faction Def Extension
- Toggable patches
- Recipes Inheritance
- Adding new backstories
- Spawning things on new generated maps
- ThoughtExtensions
- WeatherLetterExtensions
- WeatherOverlayExtension
- WeatherEffectsExtension
- ThingDefExtension
- Stuff commonality extension
- Biome extension
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Update to KCSG 2.0
- Exporting buildings
- Customizing symbols
- Debug helpers options
- Custom faction settlement
- Custom structure and scenarios
- Custom structure in quests
- Custom structure in WorldObjects
- Biome based structures
- Spawning world object(s) at world generation
- Prevent settlement spawning for nomadic factions
- Animal Behaviours Basics
-
Animal Behaviours Comp Classes
- Acid Attacks and Acid Immunity
- Animal Resources
- Animal Resources On Caravan
- Apply Hediff When Bound
- Asexual Reproduction
- Auto Nutrition
- Blink
- Build Periodically
- Cause Incident
- Change Def if Not Unique
- Change Weather
- Corpse Decayer
- Destroy This Item
- Die After Period
- Die And Change Into Another Def
- Dig Periodically
- Dig When Hungry
- Disease Event Immunity
- Disease Immunity
- Diseases After Period
- Doesn't flee
- Draftability
- Drop on Death
- Eat Weird Food
- Electrified
- Enrage Other Pawns
- Exploding Hatcher
- Extreme Xenophobia
- Fertilizer
- Filth Producer
- Fixed Gender
- Floating
- Gas Producer
- Give Thoughts On Caravan
- Graphic by Style
- Graphic by Terrain
- Hediff Effecter
- Hediff When Fleeing
- Highly Flammable
- Infecter
- Initial Ability
- Initial Hediff
- Initial Mental State
- Last Stand
- Light Sustenance
- Metamorphosis
- Mind Effecter
- Nearby Effecter
- No Taming Decay
- Passive Regenerator
- Pawn Overlay
- Produces no filth
- Refueling
- Regeneration
- State After Health Loss
- Summon On Spawn
- Swallow Whole
- Thought Effecter
- Untameable
- Animal Behaviours Hediff Comp Classes
- Animal Behaviours Damage Workers
- Animal Behaviours Def Extensions
- Animal Behaviours Extra Defs
- Animal Behaviours Misc