Making simple new gun, can't figure out what's wrong

Started by RoboticManiac, September 11, 2018, 10:13:21 AM

Previous topic - Next topic

RoboticManiac

So I'm following the guide made by Jecrell, and I can't figure out what I'm doing wrong. Rimworld opens up and says there's a parse failure, but I can't figure out what in specific is wrong. It should be a simple copy/paste of the revolver with different stats and the LMG texture. Would really appreciate some help.

<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThingDef ParentName="BaseBullet">
    <defName>Bullet_HMG</defName>
    <label>hmg bullet</label>
    <graphicData>
      <texPath>Things/Projectile/Bullet_Big</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>12</damageAmountBase>
      <stoppingPower>2</stoppingPower>
      <speed>55</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>Gun_HMG</defName>
    <label>Heavy Machine Gun</label>
    <description>An old heavy machine gun.</description>
    <graphicData>
      <texPath>Things/Item/Equipment/WeaponRanged/LMG</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>Interact_Rifle</soundInteract>
    <statBases>
      <WorkToMake>10000</WorkToMake>
      <Mass>4</Mass>
      <AccuracyTouch>0.70</AccuracyTouch>
      <AccuracyShort>0.70</AccuracyShort>
      <AccuracyMedium>0.75</AccuracyMedium>
      <AccuracyLong>0.35</AccuracyLong>
      <RangedWeapon_Cooldown>1.6</RangedWeapon_Cooldown>
    </statBases>
    <weaponTags>
      <li>SimpleGun</li>
      <li>HMG</li>
    </weaponTags>
    <costList>
      <Steel>150</Steel>
      <ComponentIndustrial>6</ComponentIndustrial>
    </costList>
    <recipeMaker>
      <skillRequirements>
        <Crafting>5</Crafting>
      </skillRequirements>
    </recipeMaker>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_HMG</defaultProjectile>
        <warmupTime>0.2</warmupTime>
        <range>30</range>
        <soundCast>Shot_Minigun</soundCast>
        <soundCastTail>GunTail_Medium</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
<burstShotCount>10</burstShotCount>
      </li>
    </verbs>
    <tools>
      <li>
        <label>grip</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
      <li>
        <label>barrel</label>
        <capacities>
          <li>Blunt</li>
          <li>Poke</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
    </tools>
  </ThingDef>
</defs>

Kirby23590

You were missing the <ticksBetweenBurstShots> when making an automatic weapon like an Heavy machine gun or an assault rifle.

I compared it to the Core game's LMG & your code, and found out why.

i also edited and fixed your code, so here you go! :)

<ThingDef ParentName="BaseBullet">
    <defName>Bullet_HMG</defName>
    <label>hmg bullet</label>
    <graphicData>
      <texPath>Things/Projectile/Bullet_Big</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>12</damageAmountBase>
      <stoppingPower>2</stoppingPower>
      <speed>55</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>Gun_HMG</defName>
    <label>Heavy Machine Gun</label>
    <description>An old heavy machine gun.</description>
    <graphicData>
      <texPath>Things/Item/Equipment/WeaponRanged/LMG</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>Interact_Rifle</soundInteract>
    <statBases>
      <WorkToMake>10000</WorkToMake>
      <Mass>4</Mass>
      <AccuracyTouch>0.70</AccuracyTouch>
      <AccuracyShort>0.70</AccuracyShort>
      <AccuracyMedium>0.75</AccuracyMedium>
      <AccuracyLong>0.35</AccuracyLong>
      <RangedWeapon_Cooldown>1.6</RangedWeapon_Cooldown>
    </statBases>
    <weaponTags>
      <li>IndustrialGunAdvanced</li>
      <li>HMG</li>
    </weaponTags>
    <costList>
      <Steel>150</Steel>
      <ComponentIndustrial>6</ComponentIndustrial>
    </costList>
    <recipeMaker>
      <skillRequirements>
        <Crafting>5</Crafting>
      </skillRequirements>
    </recipeMaker>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_HMG</defaultProjectile>
        <warmupTime>0.2</warmupTime>
        <range>30</range>
<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
        <soundCast>Shot_Minigun</soundCast>
        <soundCastTail>GunTail_Medium</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
<burstShotCount>10</burstShotCount>
      </li>
    </verbs>
    <tools>
      <li>
        <label>grip</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
      <li>
        <label>barrel</label>
        <capacities>
          <li>Blunt</li>
          <li>Poke</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
    </tools>
  </ThingDef>

One "happy family" in the rims...
Custom font made by Marnador.



RoboticManiac

Quote from: Kirby23590 on September 11, 2018, 11:28:29 AM
You were missing the <ticksBetweenBurstShots> when making an automatic weapon like an Heavy machine gun or an assault rifle.

I compared it to the Core game's LMG & your code, and found out why.

i also edited and fixed your code, so here you go! :)

<ThingDef ParentName="BaseBullet">
    <defName>Bullet_HMG</defName>
    <label>hmg bullet</label>
    <graphicData>
      <texPath>Things/Projectile/Bullet_Big</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>12</damageAmountBase>
      <stoppingPower>2</stoppingPower>
      <speed>55</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>Gun_HMG</defName>
    <label>Heavy Machine Gun</label>
    <description>An old heavy machine gun.</description>
    <graphicData>
      <texPath>Things/Item/Equipment/WeaponRanged/LMG</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>Interact_Rifle</soundInteract>
    <statBases>
      <WorkToMake>10000</WorkToMake>
      <Mass>4</Mass>
      <AccuracyTouch>0.70</AccuracyTouch>
      <AccuracyShort>0.70</AccuracyShort>
      <AccuracyMedium>0.75</AccuracyMedium>
      <AccuracyLong>0.35</AccuracyLong>
      <RangedWeapon_Cooldown>1.6</RangedWeapon_Cooldown>
    </statBases>
    <weaponTags>
      <li>IndustrialGunAdvanced</li>
      <li>HMG</li>
    </weaponTags>
    <costList>
      <Steel>150</Steel>
      <ComponentIndustrial>6</ComponentIndustrial>
    </costList>
    <recipeMaker>
      <skillRequirements>
        <Crafting>5</Crafting>
      </skillRequirements>
    </recipeMaker>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_HMG</defaultProjectile>
        <warmupTime>0.2</warmupTime>
        <range>30</range>
<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
        <soundCast>Shot_Minigun</soundCast>
        <soundCastTail>GunTail_Medium</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
<burstShotCount>10</burstShotCount>
      </li>
    </verbs>
    <tools>
      <li>
        <label>grip</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
      <li>
        <label>barrel</label>
        <capacities>
          <li>Blunt</li>
          <li>Poke</li>
        </capacities>
        <power>9</power>
        <cooldownTime>2</cooldownTime>
      </li>
    </tools>
  </ThingDef>


Brilliant, thanks!