Skip to content

NPC settings

Set these as <property> lines on an entity class that extends dsdNpcTemplate. Anything not listed works as on any vanilla entity: health effect groups, LootList, LootDropProb, MoveSpeed, MoveSpeedAggro, SightRange, sounds, Tags, UserSpawnType and so on.

NPC Utilities settings

Property Default What it does
DSDNpcRole survivor survivor, companion (hireable) or bandit (never hireable, can't be talked to, taunts players, runs when beaten).
DSDNpcHireCost 0 Price in Dukes. 0 = cannot be hired.
DSDNpcHireDays 0 Game days per payment. 0 = hired for good.
DSDNpcMaxFollowers 2 How many followers a player may have when hiring this NPC.
DSDNpcRepHire 600 Standing with the NPC's faction needed to hire (0-1000).
DSDNpcKillRep -150 Change to a player's standing with the NPC's faction when they kill one. Each hit counts 10%. Positive values reward killing.
DSDNpcWeapon none Item the NPC spawns holding. A comma list picks one at random: gunHandgunT1Pistol,meleeWpnClubT1BaseballBat.
DSDNpcAmmo 0 Rounds for that weapon (its first ammo type).
DSDNpcAim 0.45 Aim error in meters at 20 m. Lower is deadlier: 0.2 sharpshooter, 0.6 bandit rabble. Hired NPCs improve with kills.
DSDNpcVoice dsdNpcV_survivor_m1 Prefix of the voice line sounds. Empty = silent. See Voices.
DSDNpcAnimBody none Lend the built-in human animations to your own humanoid model: Survivor. See Your own model.

Vanilla properties that matter

Property Template value Notes
Class EntityDSDNpc, DSD_NPCUtilities Keep it.
Mesh none The body prefab.
PhysicsBody zombieStandard Hit areas and ragdoll. Use dsdNpcSurvivor with the survivor body and standard Mixamo skeletons.
NPCID none The npc_info id in npc.xml. Without it the NPC can't be talked to.
Faction none A faction from npc.xml.
HandItem meleeHandPlayer Unarmed attack: the player's fists.
RightHandJointName RightWeapon Bone held items attach to.
SoundHurt, SoundHurtSmall, SoundDeath survivor voice Pain and death sounds.
RootMotion false Keep it: the animations are in place.

AI tasks

The template's AI list. If you replace it, keep this order.

Entry Task Data Does
AITask-1 DSDNpcShoot Gunfights: spacing, aim, bursts, reloads. Only runs with a gun and ammo.
AITask-2 ApproachAndAttackTarget class=EntityAlive,0 Melee.
AITask-3 DSDNpcOrder wander=12 Follow / Stay / Guard; unhired NPCs wander this many meters from home.
AITask-4 Look Looks around.
AITarget-1 DSDNpcTarget range=24;guard=14 Picks enemies by faction within range m; within guard m of the spot on Guard.
<property name="AITask-3" value="DSDNpcOrder" data="wander=4"/>     <!-- a shopkeeper who stays put -->
<property name="AITarget-1" value="DSDNpcTarget" data="range=40;guard=20"/>   <!-- a lookout -->