Help! Different Material = Different Movement Cost

Started by Headshot, April 03, 2015, 01:52:22 PM

Previous topic - Next topic

Headshot

Hello,

I'm currently make a fence like object which slows down pawns walking through it. Everything functions correctly, and it uses the stuff system. What I'm trying to do is have different materials provide a greater debuff for the pawns walking through it. Currently it's set to <pathCost>200</pathCost> which also seems to set it globally. How can I get different pathcosts based on the material used to create the spike?

I'm completely stuck, and thanks for any assistance in advance  ;D

and here's my code currently:
<?xml version="1.0" encoding="utf-8"?>
<Buildings>

   <ThingDef Name="BuildingBase" Abstract="True">
     <category>Building</category>
     <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
     <selectable>true</selectable>
     <drawerType>MapMeshAndRealTime</drawerType>
     <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
     <repairEffect>Repair</repairEffect>
   </ThingDef>
   
   <ThingDef ParentName="BuildingBase" Name="Stake">>
     <designationCategory>Security</designationCategory>
     <defName>Stakes</defName>
     <label>Stakes</label>
     <description>Ugly sharpened polls, rods, logs, or sticks for slowing down attackers.</description>
     <graphicPath>Things/Building/SimpleBlock_Atlas</graphicPath>
     <blueprintgraphicPath>Things/Building/SimpleBlock_BluePrint</blueprintgraphicPath>
     <graphicClass>Graphic_Single</graphicClass>
     <uiIconPath>Things/Building/SimpleBlock_MenuIcon</uiIconPath>
     <statBases>
       <MaxHealth>30</MaxHealth>
       <Beauty>-4</Beauty>
       <WorkToMake>400</WorkToMake>
       <Flammability>1.0</Flammability>
     </statBases>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
     <size>(1,1)</size>
     <costStuffCount>3</costStuffCount>
     <filthLeaving>BuildingRubble</filthLeaving>
     <eType>BuildingComplex</eType>
     <thingClass>Building</thingClass>
     <altitudeLayer>Waist</altitudeLayer>
<pathCost>200</pathCost>
     <passability>PassThroughOnly</passability>
     <castEdgeShadows>true</castEdgeShadows>
     <fillPercent>1</fillPercent>
     <placingDraggableDimensions>1</placingDraggableDimensions>
     <tickerType>Normal</tickerType>
     <rotatable>false</rotatable>
     <neverMultiSelect>false</neverMultiSelect>
     <holdsRoof>false</holdsRoof>
     <staticSunShadowHeight>0.33</staticSunShadowHeight>
<stuffCategories>
      <li>Metallic</li>
      <li>Woody</li>
  <li>Stony</li>
    </stuffCategories>
<damageMultipliers>
      <li>
        <damageDef>Bomb</damageDef>
        <multiplier>3</multiplier>
      </li>
    </damageMultipliers>
   </ThingDef>
</Buildings>

mrofa

You would need to code that in c# thers not such option in xml
All i do is clutter all around.

Headshot

Quote from: mrofa on April 03, 2015, 02:03:52 PM
You would need to code that in c# thers not such option in xml

Oh, okay. In that case would you mind pointing me in the right direction? I've not used C# before, but I'm sure I can figure it out.

mrofa

All i do is clutter all around.

Headshot