[Solved]How to add hediff to specific new bodypart with AddHediff() ?

Started by lzycc2009, August 09, 2023, 09:01:30 AM

Previous topic - Next topic

lzycc2009

AddHediff(Hediff hediff, BodyPartRecord part = null, DamageInfo? dinfo = null, DamageWorker.DamageResult result = null)

Or remove a bodypart? I added a new body part for my race mod, and I want to add hediff to this body part when some conditions are met, but I don't know how to target the bodypart I added.

lzycc2009

If I want to destory a bodypart, can I write it this way?

var hediff = HediffMaker.MakeHediff(HediffDefOf.MissingBodyPart, pawn);
pawn.health.AddHediff(hediff);

lzycc2009

Quote from: lzycc2009 on August 09, 2023, 09:06:56 AMIf I want to destory a bodypart, can I write it this way?

var hediff = HediffMaker.MakeHediff(HediffDefOf.MissingBodyPart, pawn);
pawn.health.AddHediff(hediff);
I don't know how to target specific bodypart, so I posted here.