Ludeon Forums

RimWorld => Mods => Help => Topic started by: AileTheAlien on July 11, 2018, 11:43:55 PM

Title: Make implant / bionic part removable?
Post by: AileTheAlien on July 11, 2018, 11:43:55 PM
What makes an implant / bionic part removable? I've tried changing the parts in my mod (https://github.com/EliaTarasoff/rimworld-implants) to subclass <HediffDef ParentName="AddedBodyPartBase"> instead of <HediffDef ParentName="ImplantHediffBase"> (not on a branch, sorry), but that doesn't seem to do it. Neither does setting <addedPartProps><solid>true</solid</addedPartProps> (a guess). <spawnThingOnRemoved>HeartSymbiote</spawnThingOnRemoved> has been there from the start, and it doesn't seem to be what does it either. What am I missing here?
Title: Re: Make implant / bionic part removable?
Post by: Karthas077 on July 12, 2018, 01:10:37 AM
Take a look at the recipe for ExciseCarcinoma. You need a surgery recipe that removes the Hediff of the implant/bionic part. As long as spawnThingOnRemoved is set, you'll get the part back. (Implants use the workerClass Recipe_InstallImplant to preserve the existing part, where bionic parts use Recipe_InstallArtificialBodyPart to replace the part and any sub-parts).
Title: Re: Make implant / bionic part removable?
Post by: AileTheAlien on July 12, 2018, 02:19:36 PM
Cool, will try that when I get home! :)
Title: Re: Make implant / bionic part removable?
Post by: AileTheAlien on July 29, 2018, 06:01:51 PM
Is <spawnThingOnRemoved> all that's needed on a surgery, to make the part given back? Or does it need to subclass BodyPartArtificialBase instead of ImplantBase? It seems like my symbiote-removal surgeries don't actually give back the item, but my artificial lung gets removed just fine. Also noteworthy, that anything that subclasses BodyPartArtificialBase gets a removal surgery for free in the game, but if you subclass implants, you need to add a surgery recipe yourself, for that thing.
Title: Re: Make implant / bionic part removable?
Post by: Karthas077 on July 31, 2018, 02:05:21 AM
So apparently the recipes to remove Hediffs go through an entirely separate process, and only Recipe_RemoveBodyPart actually triggers SpawnThingsFromHediffs to create the spawnThingOnRemoved. At the moment, I can't think of any way to make an implant re-spawn on being removed without making a custom recipe class that inherits from Recipe_Surgery.
Title: Re: Make implant / bionic part removable?
Post by: AileTheAlien on July 31, 2018, 03:06:54 AM
I can deal with this. Some will be body-horror body-parts that can be re-aquired (just like that horrible fish-tongue thing!), and others will be non-recoverable infested paras...I mean "delicate symbiotes".