Trying to add filth to RangedIndustrialGrenades

Started by florisjan, April 15, 2019, 11:31:16 AM

Previous topic - Next topic

florisjan

I am trying to use

<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef> from <defName>Bullet_IncendiaryLauncher</defName> to add filth to other ranged weapons. I copy, paste and alter the def in Filth_Various.xml and turn it into:

<ThingDef ParentName="BaseFilth">
    <defName>Filth_Crumbles</defName>
    <label>Crumbles</label>
    <description>Crumbles.</description>
    <useHitPoints>true</useHitPoints>
    <tickerType>Normal</tickerType>
    <statBases>
      <Beauty>-12</Beauty>
      <Cleanliness>-15</Cleanliness>
    </statBases>
    <graphicData>
      <texPath>Things/Filth/Crumbles</texPath>
    </graphicData>
<pathCost>5</pathCost>
    <filth>
      <rainWashes>true</rainWashes>
      <cleaningWorkToReduceThickness>70</cleaningWorkToReduceThickness>
      <canFilthAttach>true</canFilthAttach>
    </filth>
  </ThingDef>



And add <preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef> to <defName>Proj_GrenadeFrag</defName> and <defName>Weapon_GrenadeEMP</defName>

When I just add <preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef> to the defs it works fine and puddles of fuel appear when firing the grenades.

However when I use my crumbles def, my texture appears as filth, but an exception is constantly thrown when the weapon is used. I assume I am doing something wrong in the directory/file naming. Which is basically:

\Textures\Things\Filth\Crumbles\CrumblesA.png
\Textures\Things\Filth\Crumbles\CrumblesB.png
\Textures\Things\Filth\Crumbles\CrumblesC.png

  Exception ticking Filth_Crumbles573312 (at (120, 0, 4)): System.NotImplementedException: The requested feature is not implemented.
  at Verse.Entity.Tick () [0x00000] in <filename unknown>:0
  at Verse.TickList.Tick () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


As said the texture is being shown, so it's not a matter of the files not being found.

Thanks a lot!



Mehni

The exception is because you are missing a thingClass entry in your def.

LWM

BaseFilth specifies    <thingClass>Filth</thingClass>

So....I dunno what's going on!

If you copy Filth_Fuel exactly and just change the defName to your name, does it work?  It's a painful way to figure out what's going on, but changing one line at a time might narrow things down...

--LWM

florisjan

Quote from: Mehni on April 15, 2019, 04:24:49 PM
The exception is because you are missing a thingClass entry in your def.

That was the problem. Thank you very much!
the <thingClass>LiquidFuel</thingClass> was missing.