How to make something place able on anything?

Started by CplCuddles, February 24, 2018, 05:29:30 PM

Previous topic - Next topic

CplCuddles

Hey guys, I am trying to make a mod that makes a "buried power conduit" that can be "built underground" and isn't affected by rain and cannot catch on fire, also doesn't show up (due to it being buried,) but otherwise works like a conduit. Basically, I want to be able to place it underwater even if need be. The problem is that I am hitting a wall when it comes to being able to place it. According to the very obviously outdated rimworldwiki, I should being able to put "Any" in the "terrainAffordanceNeeded" and it should work. "Any" is no longer an option, I only have "Underfined" which just doesn't let you place it basically.

Here is my code so far:
  <ThingDef ParentName="BuildingBase">
    <defName>BuriedPowerConduit</defName>
    <label>buried power conduit</label>
    <thingClass>Building</thingClass>
    <category>Building</category>
    <graphicData>
      <texPath>PowerConduit_Atlas1</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <linkType>Transmitter</linkType>
      <linkFlags>
        <li>PowerConduit</li>
      </linkFlags>
      <damageData>
        <rect>(0,0.35,1,0.3)</rect>
      </damageData>
    </graphicData>
    <blueprintGraphicData>
      <texPath>Things/Building/Linked/PowerConduit_Blueprint_Atlas</texPath>
    </blueprintGraphicData>
    <uiIconPath>Things/Building/Linked/PowerConduit_MenuIcon</uiIconPath>
    <building>
         <ai_chillDestination>false</ai_chillDestination>
         <isInert>true</isInert>
      <isEdifice>false</isEdifice>
    </building>
    <altitudeLayer>FloorEmplacement</altitudeLayer>
    <passability>Standable</passability>
    <leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
    <statBases>
      <MaxHitPoints>500</MaxHitPoints>
      <WorkToBuild>250</WorkToBuild>
      <Flammability>0</Flammability>
      <Beauty>0</Beauty>
    </statBases>
    <description>A set of electrical cables for moving power around. It is placed under ground and is fire/water proof.</description>
    <placingDraggableDimensions>1</placingDraggableDimensions>
    <costList>
      <Steel>1</Steel>
     <Plasteel>4</Plasteel>
     <Cloth>2</Cloth>
    </costList>
    <comps>
      <li Class="CompProperties_Power">
        <compClass>CompPowerTransmitter</compClass>
        <transmitsPower>true</transmitsPower>
      </li>
    </comps>
    <placeWorkers>
      <li>PlaceWorker_Conduit</li>
    </placeWorkers>
    <rotatable>false</rotatable>
    <selectable>true</selectable>
    <neverMultiSelect>true</neverMultiSelect>
    <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
    <terrainAffordanceNeeded>Any</terrainAffordanceNeeded>
    <designationCategory>Power</designationCategory>
    <constructEffect>ConstructMetal</constructEffect>
    <clearBuildingArea>false</clearBuildingArea>
    <designationHotKey>Misc1</designationHotKey>
    <researchPrerequisites>
      <li>Electricity</li>
    </researchPrerequisites>
  </ThingDef>

Sandy

Why dont u look at how bridge mods place bridges on water?

wwWraith

Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

CplCuddles

Quote from: Sandy on February 24, 2018, 11:36:20 PM
Why dont u look at how bridge mods place bridges on water?
I'll look into that, but I'm pretty sure a bridge would classify under a terraindef or buildingdef. Conduits are thingdefs
Quote from: wwWraith on February 25, 2018, 08:03:22 AM
Invisible Conduits
Simple underground conduit (scroll down to #13)
Neither of those are what I want. My conduits are already invisible, I want them to be able to be placed on any terrain. Simple underground conduit claims it can do this, but it can't. I tried to use it originally, it didn't work(because of the same problem I am facing), so I decided to make it myself.