I tried to find the recipe to remove organs to copy it for limbs etc. but somehow I couldn't find it.
Could someone help me there? I need a recipe to remove Fingers, Hands, Arms etc.
It doesn't need to end up with an item I just need to bodyparts gone for a mod im working on.
That's a damn good question. I am trying toget stomachs removable to no avail. I have a feeling the list for what parts are removable is not something that can be edited.
I've only seen a brain removal mod work so far, but looking at the core code, brain removal was actually coded in, but then disabled for some unkown reason. Really hope someone can prove me wrong and get other parts removable.
Well the bodyparts defs that can be removed have:
<spawnThingOnRemoved>Lung</spawnThingOnRemoved>
In them, I havent tested this but does adding that do anything, youll be surprised how much can hang off of 1 xml line.
Quote from: skullywag on October 18, 2014, 10:47:27 AM
Well the bodyparts defs that can be removed have:
<spawnThingOnRemoved>Lung</spawnThingOnRemoved>
In them, I havent tested this but does adding that do anything, youll be surprised how much can hang off of 1 xml line.
Tried that earlier, doesnt work on limbs ... pretty much only works on the stuff thats already coded into the core.
My guess is, that amputation is hardcoded somewhere because I cant happen to find any recipes to remove specific bodyparts.
hunting through core dlls now.
edit - heres the file, but Im not to up together with the inumerator stuff:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Verse;
namespace RimWorld
{
internal class Recipe_RemoveBodyPart : RecipeWorker
{
[DebuggerHidden]
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
Recipe_RemoveBodyPart.<GetPartsToApplyOn>c__Iterator57 <GetPartsToApplyOn>c__Iterator = new Recipe_RemoveBodyPart.<GetPartsToApplyOn>c__Iterator57();
<GetPartsToApplyOn>c__Iterator.pawn = pawn;
<GetPartsToApplyOn>c__Iterator.<$>pawn = pawn;
Recipe_RemoveBodyPart.<GetPartsToApplyOn>c__Iterator57 expr_15 = <GetPartsToApplyOn>c__Iterator;
expr_15.$PC = -2;
return expr_15;
}
public override void ApplyOnPawn(Pawn pawn, RecipeDef recipe, BodyPartRecord part, Pawn billDoer)
{
MedicalRecipesUtility.SpawnNaturalPartIfClean(pawn, part, billDoer.Position);
MedicalRecipesUtility.SpawnAddedParts(pawn, part, billDoer.Position);
BodyPartDamageInfo value = new BodyPartDamageInfo(part, false, null);
DamageInfo dinfo = new DamageInfo(DamageTypeDefOf.SurgicalCut, 99999, null, new BodyPartDamageInfo?(value), null);
pawn.TakeDamage(dinfo);
}
}
}
To bad I totally suck at coding. I can barely understand what the hell this code does :S
As far as I can tell from what I noticed ingame you can only remove stuff like limbs when they are severely damaged. So there has to be some line of code that prevents structural body parts from being removed for no good reason.
If someone could tell me or show me how to modify which file to enable limb amputation, that'd be great.
Removable parts arent hardcoded anywhere. Adding <spawnThingOnRemoved>Sth</spawnThingOnRemoved> should be enough. "Sth" must refer to real item.
Quote from: ison on October 19, 2014, 05:33:42 PM
Removable parts arent hardcoded anywhere. Adding <spawnThingOnRemoved>Sth</spawnThingOnRemoved> should be enough. "Sth" must refer to real item.
Nope, tried that already. I added <spawnThingOnRemoved>Lung</spawnThingOnRemoved> to both arms and it still doesnt work :/
EDIT: Okay, nevermind ... I had to add a new item for each limb it added a bit of work and a few new items but I think I can work with that :D
EDIT 2: Ugh .... Recipe_InstallnaturalBodyPart only works if the targeted part is damaged or gone BUT it will alway fix the bodypart without adding any healthdiffs :/
So the only way to augument or add less effective prosthetics is to use Recipe_InstallartificialBodyPart but that will not allow to add parts to the replaced bodypart .... so my first issue is still the same ... adding a bionic arm wont allow me to add a bionic hand -.-
Quote from: Shudokai on October 20, 2014, 06:42:03 PM
adding a bionic arm wont allow me to add a bionic hand -.-
That's a different thing altogether. The hand is considered part of the arm. In the same way that each finger is part of the hand and if any are broken, they will be fixed when you add a power claw.
To change that, you'd probably have to change the body part categorization so that hands are no longer counted as parts of the arm. Or maybe have the arm part that the bionic arm applies to, isntead apply to a sub-arm that you'd add, which will likely cause less issues.
For now, I'm gonna try what the others have said to allow removable stomachs...
Okay yes! Stomachs work! Arms and legs also removable!! Gonna go post my mod now!
Changing the body part groups would be a nice aproach but that would make the gameplay pretty damn wonky.
If your arm gets shot off your Hand will still be there.
I think adding a completely new body structure for bionic parts might work if one adds like "sockets" for bionic parts. I might try that. Thanks for the idea :D
Quote from: skullywag on October 18, 2014, 10:47:27 AM
Well the bodyparts defs that can be removed have:
<spawnThingOnRemoved>Lung</spawnThingOnRemoved>
In them, I havent tested this but does adding that do anything, youll be surprised how much can hang off of 1 xml line.
That simple solution is the key!
For those of you that want limb removal, that is now a mod! (https://ludeon.com/forums/index.php?topic=7029) The more complex stuff with more individual parts like hands and toes I'll leave to someone else.
Quote from: Shudokai on October 20, 2014, 06:42:03 PM
adding a bionic arm wont allow me to add a bionic hand -.-
If you have a bionic arm, it presumably came with a hand.
Now, if you want a bionic arm and a power claw...well, that's different. I guess just make a "Bionic Arm with Power Claw" prosthetic?