Troubleshooting reqd > Shooting Range mod (increase shooting exp at diff rate)

Started by nmid, June 16, 2014, 05:23:10 PM

Previous topic - Next topic

nmid

So I was thinking of making
1. A shooting range
2. which would let you gain extra shooting exp than the regular shooting

So far I have found these factors that should be relevant..
I'm trying to use the shooting range to increase the shooting exp and this is what I have so far..

<skillGains>
<li>
<skill>Shooting</skill>
<xp>5</xp>
</li>
</skillGains>

I was trying to add it to the shooting action directly, but that didn't work.
Try 1 - failed when info added to verb in weapons_gun didn't work..
Try 2 - failed when info added to BaseJobDefs? AttackStatic
(------------------)

so I decided to build a shooting range (table) with a bill with a "Shooting Practice" Recipe that would do the job.

I came up with this.
  Recipe
  <!--Shooting practice-->
<RecipeDefs>
  <RecipeDef>
    <defName>ShootingPractice</defName>
    <label>Shooting Practice (WIP)</label>
    <description>Become proficient in shooting</description>
    <jobString>Shooting Practice</jobString>
    <workTimeSkillNeed>Shooting</workTimeSkillNeed>
    <efficiencySkillNeed>ShootingEfficiency</efficiencySkillNeed>
    <workEffect>Shooting</workEffect>
    <alwaysShowWeapon>true</alwaysShowWeapon>
    <!--A low amount for just testing-->
    <workAmount>10</workAmount>
    <!--<sustainerSoundDef> Want to add any shooting sound? </sustainerSoundDef>-->
    <ingredients>
      <li>
        <filter>
          <thingDefs>
            <li>Metal</li>
          </thingDefs>
        </filter>
        <count>10</count>
      </li>
    </ingredients>
    <products>
      <li>
        <thingDef>DebrisSlag</thingDef>
        <count>1</count>
      </li>
    </products>
    <fixedIngredientFilter>
      <thingDefs>
        <li>Metal</li>
      </thingDefs>
    </fixedIngredientFilter>
    <skillGains>
      <li>
        <skill>Shooting</skill>
        <xp>5000</xp>
      </li>
    </skillGains>
  </RecipeDef>
</RecipeDefs>
    <!--What about this string?--><!--
    <driverClass>AI.JobDriver_AttackStatic</driverClass>-->



ThingDefs ThingDefs\Shooting_Range.xml
<?xml version="1.0" encoding="utf-8" ?>
<Buildings>

<ThingDef Name="BuildingBase" Abstract="True">
<category>Building</category>
<soundBulletHit>BulletImpactMetal</soundBulletHit>
<selectable>true</selectable>
<drawerType>MapMeshAndRealTime</drawerType>
<surfaceNeeded>Light</surfaceNeeded>
<constructionEffect>ConstructMetal</constructionEffect>
<repairEffect>Repair</repairEffect>
</ThingDef>

<ThingDef ParentName="BuildingBase">
<DefName>ShootingRange</DefName>
<EType>Building_WorkTable</EType>
<Label>Shooting Range</Label>
<ThingClass>Building_WorkTable</ThingClass>
<Description>A range to practice your shooting and increase your proficiency.</Description>
<TexturePath>Things/Building/TableShooting</TexturePath>
<CostList>
  <li>
<thingDef>Metal</thingDef>
<count>75</count>
</li>
      <li>
        <thingDef>Stone</thingDef>
        <count>75</count>
      </li>
    </CostList>
<AltitudeLayer>Waist</AltitudeLayer>
<WorkToBuild>250</WorkToBuild>
<UseStandardHealth>True</UseStandardHealth>
<maxHealth>250</maxHealth>
<Size>(3,1)</Size>
<Overdraw>False</Overdraw>
<DesignationCategory>Production</DesignationCategory>
<Passability>Impassable</Passability>
<hasInteractionSquare>True</hasInteractionSquare>
<!--Going to change this to make the seat at the horizontal edge for a more realistic view-->
    <interactionSquareOffset>(0,0,-1)</interactionSquareOffset>
<itemSurface>True</itemSurface>
<recipes>
<li>ShootingPractice</li>
    </recipes>
<inspectorTabs>
<li>ITab_Bills</li>
</inspectorTabs>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
</building>
</ThingDef>

</Buildings>


I also added a texture in the correct folder.

The problem is that neither code seems to have worked...
1. For the building code, though I can see the table in the production build menu (going to change it to security later), when I click on it, it doesn't get selected for building.
It just clicks through..

2. For the recipe code, I did check separately by adding the recipe to a stone cutting table but that didn't work either...

Any ideas what I'm missing?
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ