Ludeon Forums

RimWorld => Mods => Help => Topic started by: BrockLee on May 21, 2021, 09:49:39 PM

Title: How to make an item apply a ModExtension to another item?
Post by: BrockLee on May 21, 2021, 09:49:39 PM
So I've been trying to figure out how to get one item to apply a defmodextension to another item.

I'm working on a personal mod adding some new custom tents to the Camping Tent mod. My mod is piggybacking on the code of the said mod, and I want to have an air conditioner unit as a linkable facility that, placed adjacent to a tent, will apply (or possibly replace) the extension.

I've tried a couple of approaches, but they keep applying the extension to the linkable itself.

Any ideas would be appreciated 
Title: Re: How to make an item apply a ModExtension to another item?
Post by: RawCode on May 26, 2021, 05:03:14 AM
when you specify list inside def extension, it's addition to existing list, unlike "normal" fields that is direct replacement.

if you want to replace list, you must explicitly clean it first and then add new items.