Gun Trouble! Please Halp!

Started by Quasarrgames, October 29, 2014, 07:25:49 PM

Previous topic - Next topic

Quasarrgames

So, alpha 7 brought so many changes to xml stuff (specifically guns) that i'm completely lost. I tried to remake a gun i made in alpha 6 by taking the weapons_guns file and making a new gun with new values, and then storing it in a mod folder with all the correct file paths and all that.

However, it doesn't exist! I can't find it in the spawn menu! (yes i did remember to turn on the mod)

is it something in the code that's causing it?
      </li>
    </comps>
  </ThingDef>
 
 
  <ThingDef Name="BaseHumanGun" ParentName="BaseGun" Abstract="True">
    <weaponTags>
      <li>Gun</li>
    </weaponTags>
  </ThingDef>


  <ThingDef Name="BaseBullet" Abstract="True">
    <category>Projectile</category>
    <tickerType>Normal</tickerType>
    <altitudeLayer>Projectile</altitudeLayer>
    <thingClass>Bullet</thingClass>
    <label>bullet</label>
    <useStandardHealth>False</useStandardHealth>
    <neverMultiSelect>True</neverMultiSelect>
    <shaderType>Transparent</shaderType>
  </ThingDef>

  <!-- ============================================================== -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_accuPistol</defName>
    <label>AccurAIM pistol bullet</label>
    <graphicPathSingle>Things/Projectile/AccurAIM_Bullet_Small</graphicPathSingle>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <DamageAmountBase>10</DamageAmountBase>
      <Speed>55</Speed>
    </projectile>
  </ThingDef>


  <ThingDef ParentName="BaseHumanGun">
    <defName>Gun_accuPistol</defName>
    <label>AccurAIM Pistol</label>
    <description>Garunteed to NEVER miss! Warranty void if fired.</description>
    <graphicPathSingle>Things/Item/Equipment/AccurAIM_Pistol</graphicPathSingle>
    <soundInteract>InteractPistol</soundInteract>
    <tradersCarry>True</tradersCarry>
    <baseMarketValue>250</baseMarketValue>

    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <cooldownTicks>40</cooldownTicks>
        <hasStandardCommand>true</hasStandardCommand>
        <projectileDef>Bullet_Pistol</projectileDef>
        <accuracyTouch>999</accuracyTouch>
        <accuracyShort>999</accuracyShort>
        <accuracyMedium>999</accuracyMedium>
        <accuracyLong>999</accuracyLong>
        <warmupTicks>85</warmupTicks>
        <range>24</range>
        <fireSound>ShotPistol</fireSound>
      </li>
    </verbs>
  </ThingDef>

<ThingDefs>


</ThingDefs>


or is it something else?
On the right path, but the wrong medication.

I like how there's a thing that displays how long you've logged in to the forums. It shows just how many hours you've spent here, never to get back...

skullywag

Turn on dev mode in the main options and reload, see if you have errors in the console. No mod make should be running the game during development of a mod without this on imo. If it doesnt help ill take a look tonight properly.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Rikiki

I see some obvious errors.
The accuracy of the gun is a float in range [0; 1], with 0 = "will never touch target", 1 = "cannot miss".
So 999 is slightly out of range... :o

Retest with correct values for accuracyTouch, accuracyShort, accuracyMedium and accuracyLong ;).

Also, this should appear in the dev console at game start-up (press the top left key on the left of "1/&" key).

ItchyFlea

It might be because you've got the opening tag <ThingDefs> at the very bottom of the file, with nothing except 2 blank lines inbetween it and the closing tag.
The game is probably ignoring the first opening tag at the top of the file as a result.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Rikiki

Yep, the file you provided is obviously not the one you use (strange lines at the top and the opening ThingDefs tag ItchyFlea mentioned).

Please attach the real one so we can test it. :)

Demo

I'd say that it's what Itchyflea pointed out. The game is simply ignoring it because of the </Thingdefs> being missing at the very top, try adding that then try.

Quasarrgames

HURPADURP *_* the thingdefs thing was the problem...

*facepalmForNotSeeingItBefore*

thanks for finding it guys! :)

p.s. in response to Rikiki, it apparently doesn't make a difference wether it's 999 or 1, it's still just 100%. also, that's only the gun's accuracy, not the full accuracy (I hate the fact that human error still applies!) and <canMiss>false</canMiss> doesn't work anymore.
On the right path, but the wrong medication.

I like how there's a thing that displays how long you've logged in to the forums. It shows just how many hours you've spent here, never to get back...