Ludeon Forums

RimWorld => Mods => Help => Topic started by: BukTaki on February 09, 2019, 01:26:21 PM

Title: Need help with a sling
Post by: BukTaki on February 09, 2019, 01:26:21 PM
I am trying to add more weapons to rim world i added a spear which works fine.
But when i try to do a Sling the pawn misses every time when it range attacks i know i am missing something i just dont know what.


  <ThingDef ParentName="BaseWeaponNeolithic">
    <defName>RangedWeapon_LeatherSling</defName>
    <label>LeatherSling</label>
    <description>Long leather pouch used to fling rocks can used as simple blunt weapon when througher does not release the stone.</description>
    <graphicData>
      <texPath>Things/Weapons/Neolithic/LeatherSling/LeatherSling</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <techLevel>Neolithic</techLevel>
    <weaponTags>
      <li>NeolithicMeleeBasic</li>
    </weaponTags>
    <costStuffCount>5</costStuffCount>
    <statBases>
      <WorkToMake>1600</WorkToMake>
      <Mass>1.25</Mass>
      <AccuracyTouch>0.30</AccuracyTouch>
      <AccuracyShort>0.70</AccuracyShort>
      <AccuracyMedium>0.90</AccuracyMedium>
      <AccuracyLong>0.60</AccuracyLong>
      <RangedWeapon_Cooldown>1.65</RangedWeapon_Cooldown>
    </statBases>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>SlingStoneBullet</defaultProjectile>
        <warmupTime>2</warmupTime>
        <range>22</range>
        <soundCast>Interact_BeatFire</soundCast>
      </li>
    </verbs>
<equippedAngleOffset>0</equippedAngleOffset>
    <stuffCategories>
      <li>Leathery</li>
    </stuffCategories>
    <recipeMaker>
      <recipeUsers>
        <li>CraftingSpot</li>
      </recipeUsers>
    </recipeMaker>
    <tools>
      <li>
        <label>head</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>6</power>
        <cooldownTime>2</cooldownTime>
      </li>
    </tools>
  </ThingDef>



and the charge is


  <ThingDef ParentName="BaseProjectileNeolithic">
    <defName>SlingStoneBullet</defName>
    <label>Sling Stone Bullet</label>
    <graphicData>
      <texPath>Things/Weapons/Neolithic/LeatherSling/LeatherSlingBullet</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>CutoutComplex</shaderType>
      <drawSize>(1,1)</drawSize>
    </graphicData>
    <projectile>
      <flyOverhead>true</flyOverhead>
      <damageDef>RangedStab</damageDef>
      <damageAmountBase>10</damageAmountBase>
      <stoppingPower>20</stoppingPower>
      <armorPenetrationBase>0.10</armorPenetrationBase>
      <speed>26</speed>
    </projectile>
  </ThingDef>
Title: Re: Need help with a sling
Post by: Pelador on February 09, 2019, 02:20:33 PM
Your projectile definitions contains:

<flyOverhead>true</flyOverhead>

I think this needs to be false, as this normally is assigned as true for indirect fire weapons that need to pass over obstacles e.g mortar shells.
Title: Re: Need help with a sling
Post by: Kirby23590 on February 09, 2019, 03:13:11 PM
Probably what Pelador said...

You should set <flyOverhead>true</flyOverhead> to false.

Otherwise they will miss all the time since the flyOverhead thing is mostly reserved for mortars or other indirect ranged weapons.
Title: Re: Need help with a sling
Post by: BukTaki on February 09, 2019, 06:55:25 PM
You guys are awesome that was exactly what it was.