def to check if their is a roof.

Started by jacob814, December 17, 2014, 08:19:20 PM

Previous topic - Next topic

jacob814

Is their a def that if true/false will allow the furniture to be built only if it is under a roof? I tried to check the solar panel def but without luck. Any help?
My Mods:
Glass&Lights

Rikiki

You must use a place worker like for the OrbitalTradeBeacon:

    <placeWorkers>
      <li>PlaceWorker_NotUnderRoof</li>
    </placeWorkers>

jacob814

Yes but what is the opposite condition for PlaceWorker_NotUnderRoof
My Mods:
Glass&Lights

Rikiki

Place worker are custom functions which can do nearly anything.
You have to define your own one. There is no PlaceWorker_NotUnderRoof placement restricter in the core assembly for now.

jacob814

So I would need to get into coding to do that
My Mods:
Glass&Lights

jacob814

My Mods:
Glass&Lights

jacob814

I can code if I understand how he codes but unless I can get the source code to look at, I wont know how to program in this feature.
My Mods:
Glass&Lights

Rikiki

Use ILSpy to look into the Assembly-CSharp.dll assembly.
You can find the source assembly in RimWorld8\RimWorld657Win_Data\Managed\Assembly-CSharp.dll

Take the OrbitalTradeBeacon in RimWorld8\Mods\Core\Defs\ThingDefs\Buildings_Misc.xml as exemple:

    <placeWorkers>
      <li>PlaceWorker_NotUnderRoof</li>
    </placeWorkers>


Then look for PlaceWorker_NotUnderRoof in ILSpy.

Good luck! :)

jacob814

The problem is that I cant find this code. Could you point me to the right folder in the rimworld folder?
My Mods:
Glass&Lights

jacob814

My Mods:
Glass&Lights

jacob814

My Mods:
Glass&Lights