Bullets ignoring custom DamageTypes?

Started by Justin C, April 30, 2014, 08:39:04 PM

Previous topic - Next topic

Justin C

When I define a custom DamageType and use it with a custom bullet, the bullet seems to ignore all of the variables set in the DamageType. I know it's using my custom damage type, because if I comment the damage type out the game gives me errors. It just doesn't seem to actually care about the variables inside the damage type.

<DamageTypeDef>
     <defName>RubberBullet</defName>
     <hasForcefulImpact>false</hasForcefulImpact>
     <externalViolence>false</externalViolence>
     <harmsHealth>false</harmsHealth>
     <incapChanceMultiplier>99</incapChanceMultiplier>
     <makesBlood>false</makesBlood>
</DamageTypeDef>


<ThingDef ParentName="BaseBullet">
     <defName>Bullet_NonlethalTurret</defName>
     <label>Rubber Bullet</label>
     <texturePath>Things/Projectile/Bullet_Small</texturePath>
     <projectile>
          <DamageType>RubberBullet</DamageType>
          <damageAmountBase>0</damageAmountBase>
          <speed>80</speed>
     </projectile>
</ThingDef>

<ThingDef ParentName="BaseGun">
     <defName>Gun_NonlethalTurret</defName>
     <label>Nonlethal Turret Gun</label>
     <menuHidden>true</menuHidden>
     <description>Jury-rigged gun attached to a turret.</description>
     <texturePath>Things/Item/Equipment/Default</texturePath>
     <interactSound>InteractBoltActionRifle</interactSound>
     <canBeSpawningInventory>false</canBeSpawningInventory>
     <weaponTags>
          <li>TurretGun</li>
     </weaponTags>
     <verb>
          <projectileDef>Bullet_NonlethalTurret</projectileDef>
          <warmupTicks>108</warmupTicks>
          <range>40</range>
          <accuracy>5</accuracy>
          <ticksBetweenBurstShots></ticksBetweenBurstShots>
          <burstShotCount>1</burstShotCount>
          <fireSound>GunShotA</fireSound>
     </verb>
</ThingDef>


I'm using those turrets with that bullet and damage type and all of the settings within the bullet and the turret seem to work, but it completely ignores the damage type. There is still a forceful impact from the bullets, the enemies still bleed from them, and they don't get incapacitated any more frequently.

Is anyone else having similar issues, or am I doing something wrong?

Tynan

This is an error on my part which I corrected today.

For now, you could fix it by creating a custom alternate version of Projectile_Bullet (in a dll) and having it use the def's damagetype instead of always using DamageTypeDef.Bullet.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Justin C