This repository was archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
ThingDefExtension
Taranchuk edited this page Oct 6, 2022
·
9 revisions
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 WeaponCarryDrawOffsets weaponCarryDrawOffsets = null;
// 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;
// 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 long polearm weapons (e.g. spears, glaives, pikes, halberds), you can customize their relative position and angle when wielded by a drafted pawn.
Notes:
- All orientations (north/south/east/west), position and angular offsets are optional, and default to 0,0,0 and 0 degrees respectively
- The offsets apply cumulatively over the base game's existing
equippedAngleOffset
parameter
<modExtensions>
<li Class="VFECore.ThingDefExtension">
<weaponCarryDrawOffsets>
<north>
<drawOffset>(0.25, 0, 0.25)</drawOffset>
</north>
<east>
<drawOffset>(0.3, 0, 0.20)</drawOffset>
<angleOffset>21</angleOffset>
</east>
<south>
<drawOffset>(-0.25, 0, 0.25)</drawOffset>
</south>
<west>
<drawOffset>(-0.3, 0, 0.20)</drawOffset>
<angleOffset>339</angleOffset>
</west>
</weaponCarryDrawOffsets>
</li>
</modExtensions>
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
- CompApparelHediffs
- CompShieldBubble
- CompHediffGiver
- CompLeavesSpawner & CompAutumnLeavesSpawner
- CompProperties_HomingProjectile
- ThoughtExtensions
- ExcludeFromQuestsExtension
- 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
- 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