DamageDefs and HealthDiffs

Started by skullywag, October 02, 2014, 03:56:13 PM

Previous topic - Next topic

skullywag

Can anyone help me with this, im going insane, no matter what I do I can get any of my "injurys" to show, I have a simple gun firing a simple projectile with damagedef set to my new basedamagedef this inturn has the "injurys" set in healthDiff and the healthDiff is a copy paste of a vanilla one with some changes (as is most of the rest while im testing trying to get this to work).

Does anyone know if this actually does work? is it bugged? am I a raging idiot?

code:

<ThingDef ParentName="BaseBullet">
<defName>Bullet_StunGun</defName>
<label>StunGun bullet</label>
<graphicPathSingle>Things/Projectile/Spark</graphicPathSingle>
<projectile>
  <flyOverhead>false</flyOverhead>
                  <damageDef>Spasm</damageDef>
  <DamageAmountBase>1</DamageAmountBase>
  <Speed>20</Speed>
</projectile>
</ThingDef>


<ThingDef ParentName="BaseHumanGun">
<defName>Gun_StunGun</defName>
<label>StunGun</label>
<description>A typical stun gun, used to incapacitate.</description>
<graphicPathSingle>Things/Weapons/StunGun</graphicPathSingle>
<soundInteract>InteractPistol</soundInteract>
<tradersCarry>True</tradersCarry>
<baseMarketValue>150</baseMarketValue>
<verbs>
                  <li>
                    <verbClass>Verb_Shoot</verbClass>
      <projectileDef>Bullet_StunGun</projectileDef>
                    <hasStandardCommand>true</hasStandardCommand>
                    <accuracyTouch>0.85</accuracyTouch>
                    <accuracyShort>0.70</accuracyShort>
                    <accuracyMedium>0.60</accuracyMedium>
                    <accuracyLong>0.50</accuracyLong>
              <warmupTicks>600</warmupTicks>
      <range>18</range>
              <fireSound>StunGun</fireSound>
                  </li>
</verbs>
</ThingDef>


<DamageTypeDef Name="LocalInjuryBase" Abstract="True">
    <workerClass>DamageType_AddLocalInjury</workerClass>
  </DamageTypeDef>

  <DamageTypeDef>
    <defName>Spasm</defName>
    <label>Spasm</label>
    <harmsHealth>false</harmsHealth>
    <incapChanceMultiplier>1</incapChanceMultiplier>
    <hasForcefulImpact>False</hasForcefulImpact>
    <interruptJobs>true</interruptJobs>
    <makesBlood>false</makesBlood>
    <externalViolence>false</externalViolence>
    <deathMessage>{0} died from nerve damage.</deathMessage>
  <healthDiff>Spasm</healthDiff>
    <healthDiffSkin>Spasm</healthDiffSkin>
    <healthDiffSolid>Spasm</healthDiffSolid>
    <harmAllLayersUntilOutside>false</harmAllLayersUntilOutside>
    <impactSoundType>Blunt</impactSoundType>
  </DamageTypeDef>


<HealthDiffDef>
<defName>Spasm</defName>
<label>Spasm</label>
                <naturallyHealed>true</naturallyHealed>
                <injury>
    <painPerDamage>1</painPerDamage>
    <oldLabel>Nerve Damage</oldLabel>
    <bleeding>1</bleeding>
    <becomeOldChance>1</becomeOldChance>
    <combine>false</combine>
    <destroyedLabel>Severed Nerve</destroyedLabel>
    <treatedWellLabel>repaired</treatedWellLabel>
    <treatedLabel>poorly repaired</treatedLabel>
    <innerTreatedWellLabel>repaired</innerTreatedWellLabel>
    <innerTreatedLabel>poorly repaired</innerTreatedLabel>
    <solidTreatedWellLabel>repaired</solidTreatedWellLabel>
    <solidTreatedLabel>poorly repaired</solidTreatedLabel>
                </injury>
</HealthDiffDef>
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

I don't know about the weapon part, but you've missed the parent definition for your DamageTypeDef.
Because of that it will not work as the worker class isn't set :)

change it to this:

<DamageTypeDef ParentName="LocalInjuryBase">

skullywag

Dammit I missed this....yep that was it, oh for a second pair of eyes....Thanks Haplo!
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo