Ludeon Forums

RimWorld => Mods => Help => Topic started by: Cat123 on November 10, 2014, 05:01:51 PM

Title: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 10, 2014, 05:01:51 PM
I'm looking for the specific disease code parameters - most importantly % chance of catching etc.

I'm thinking of a biological modification mod that works as an opposite to the bionics mods - grafting alien tissue into people, infecting them with mutagens etc. The major difference from bionics being it's 100% permanent and removes any future changes to that body part. While tying a few directly to events is ok, I'd prefer it if there was a code based framework so that I can hang a lot of variables off. e.g. "Eat X alien item > % chance mutation".

So, while I'll be ripping open the bionics mod code, I'd love to use the current disease code as a basis for random mutations, random alien infections > mutations and so on.


Thanks in advance!
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Rikiki on November 11, 2014, 02:06:03 AM

Good luck, this mod seems really interresting! :)
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Igabod on November 17, 2014, 02:25:06 AM
Quote from: Cat123 on November 10, 2014, 05:01:51 PM
I'm looking for the specific disease code parameters - most importantly % chance of catching etc.
Chance of catching diseases is in the biomes defs. specifically, Core/Defs/BiomeDefs/BiomesBase.xml

The particular part that effects chance per day of getting the disease looks like this:

     <diseases>
      <li>
        <diseaseInc>Flu</diseaseInc>
        <chancePerDay>0.01</chancePerDay>
      </li>
      <li>
        <diseaseInc>Plague</diseaseInc>
        <chancePerDay>0.005</chancePerDay>
      </li>
    </diseases>


And is defined for each biome individually.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 17, 2014, 04:19:04 AM
Quote from: Igabod on November 17, 2014, 02:25:06 AM

Chance of catching diseases is in the biomes defs. specifically, Core/Defs/BiomeDefs/BiomesBase.xml

The particular part that effects chance per day of getting the disease looks like this:


And is defined for each biome individually.


Yep, I've found that - wasn't quite what I was looking for, however. At the moment, all the diseases do roughly the same thing, I was hoping there was more I could do with it. i.e. make diseases that did specific things.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: skullywag on November 17, 2014, 04:24:13 AM
Got any examples of these specific things?

Im sure you could do this in DLL form. Xml i doubt it.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 17, 2014, 06:47:23 AM
Quote from: skullywag on November 17, 2014, 04:24:13 AM
Got any examples of these specific things?

Im sure you could do this in DLL form. Xml i doubt it.

This thread: https://ludeon.com/forums/index.php?topic=7461.0


At the moment, the loop I'm stuck in is this:

Organs = <items>; Operation = <item X> <-> <item Y> (e.g. leg for bionic leg). It's neither permanent nor logical for what I'm trying to do.

So, I've got:

1) A huge list of <items> (biogenic_bodyparts_mutations.xml, biogenic_bodyparts_weapons.xml, healthdiffs_mutatedparts.xml, healthdiffs_mutatedparts_weapons.xml) that I don't want to be available as <items>, but I have to generate / make them somehow.

2) A permanence issue: i.e. making each mutation permanent and exclusive, and disallowing surgery in some cases. e.g. you could cut a tentacle off (arm), but not remove a spined spine or an armored carapace (torso / sternum).  You can change the XML so that when a mutation is removed it generates something other than the original item (human meat is what I'm using atm), but you can't turn off the categories.

3) Given they are mutations, see the linked thread to specific desires. i.e. weighted tables that determine which is given.

I was hoping to use the disease code to do the following: each mutation = a disease, then effects the pawn, over time > <item> (mutation) is added. e.g. (this is for skull replacement):

<diseases>
      <li>
        <diseaseInc>Bony Ridges</diseaseInc>
        <chancePerDay>0.25</chancePerDay>
      </li>
      <li>
        <diseaseInc>Enlarged Cranium</diseaseInc>
        <chancePerDay>0.2</chancePerDay>
      </li>     
<li>
        <diseaseInc>Spongy Holes</diseaseInc>
        <chancePerDay>0.05</chancePerDay>
      </li>     
<li>
        <diseaseInc>Tumorous Growths</diseaseInc>
        <chancePerDay>0.1</chancePerDay>
      </li>
<li>
        <diseaseInc>Horned</diseaseInc>
        <chancePerDay>0.2</chancePerDay>
      </li>
<li>
        <diseaseInc>Bull Horned</diseaseInc>
        <chancePerDay>0.15</chancePerDay>
      </li>
<li>
        <diseaseInc>Predator </diseaseInc>
        <chancePerDay>0.05</chancePerDay>
      </li>
    </diseases>


So - 100% chance that one happens in a day; in the list above, 7 are positive, 2 are negative and 1 is amazing. Each has it's own HP / stats / bonuses or penalties attached to it - a couple have melee attacks, which I'm working on (porting across the animal attacks so that headbutts are a thing). They each also have a weighting to the degree of mutation, but that's a system not in place atm (i.e. Most are minor, a couple are medium, one is monstrous).

The problem being I need to limit the duration to a single day, and roll only once - after that, the colonist comes down with the "disease" (mutating!), after 1-4 days > mutation is installed.

TL;DR

At the moment I'm trying to hack together a system that doesn't require coding I'm not capable of. Rimworld has no weighted table rolls I can find. In other games, I'd simply generate a weighted table and have the mutation selected off a subtable (e.g. Mutations > skull > roll on table > item selected + installed, no need to craft it)
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 17, 2014, 10:39:18 AM
Reference to myself: I might have been a muppet. If you replace a base bodypart with one that hasn't got an operation assigned to it, you'll make it permanent.


<RecipeDef>
<defName>MutateNaturalSkull</defName>
<label>mutate skull</label>
<description>Mutates Skull.</description>
<workerClass>Recipe_InstallNaturalBodyPart</workerClass>
<jobString>Adding foreign DNA to skull.</jobString>
<workAmount>2000</workAmount>
<workEffect>ButcherFlesh</workEffect>
<workSpeedStat>MedicalOperationSpeed</workSpeedStat>
<sustainerSoundDef>Recipe_ButcherCorpseFlesh</sustainerSoundDef>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Mutagen</li>
</thingDefs>
</filter>
<count>1</count>
</li>
<li>
<filter>
<thingDefs>
<li>Skull</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<fixedIngredientFilter>
<thingDefs>
<li>Mutagen</li>
<li>Skull</li>
</thingDefs>
</fixedIngredientFilter>
<appliedOnFixedBodyParts>
<li>Skull</li>
</appliedOnFixedBodyParts>
<subOptionsChooseOne>
<addsHealthDiff>Bony Ridges</addsHealthDiff>
<addsHealthDiff>Enlarged Cranium</addsHealthDiff>
<addsHealthDiff>Spongy Holes</addsHealthDiff>
<addsHealthDiff>Tumorous Growths</addsHealthDiff>
<addsHealthDiff>Horned</addsHealthDiff>
<addsHealthDiff>Bull Horned</addsHealthDiff>
<addsHealthDiff>Predator</addsHealthDiff>
</subOptionsChooseOne>
</RecipeDef>


Pawnkind has <subOptionsChooseOne> tag - so all that's needed is to choose the outcome healthdiff, with odds! Obviously this tag won't work, but the precedent is in the code.

WTB something like this:

<subOptionsChooseOne>
<li>
<addsHealthDiff>Bony Ridges</addsHealthDiff>
<Weight>0.2</weight>
</li>
<li>
<addsHealthDiff>Enlarged Cranium</addsHealthDiff>
<Weight>0.2</weight>
</li>
<li>
<addsHealthDiff>Spongy Holes</addsHealthDiff>
<Weight>0.2</weight>
</li>
(etc)
</subOptionsChooseOne>
.

Can't be too hard.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 17, 2014, 12:12:05 PM
Tum te tum.

Next question (no-one's answering, but meh)

Can you add <statBases> to bodyparts? Like so:

  <BodyPartDef>
    <defName>BonyRidges</defName>
    <label>bony ridges</label>
<health>40</health>
<oldInjuryBaseChance>0</oldInjuryBaseChance>
<skinCovered>false</skinCovered>
<isSolid>true</isSolid>
<dontSuggestAmputation>true</dontSuggestAmputation>
  </BodyPartDef>

<HealthDiffDef ParentName="MutatedBodyPartBase">
    <defName>BonyRidges</defName>
    <label>bony ridges</label>
    <addedBodyPart>
      <isSolid>true</isSolid>
      <partEfficiency>1</partEfficiency>
    </addedBodyPart>
<modifiers>
    <statBases>
      <DamageDeflection_Blunt>0.1</DamageDeflection_Blunt>
      <DamageDeflection_Piercing>0.1</DamageDeflection_Piercing>
    </statBases>
    </modifiers>
  </HealthDiffDef>



And yeah, <HealthDiffDef ParentName="MutatedBodyPartBase"> might just change into the normal version; atm nothing that's added regenerates, which is bad. Thinking about it, <partEfficiency>1</partEfficiency> probably requires the <isbionic> tag, so can be pruned.

Quesion - why did 'SurgeryExtended & Bionics' mod by Minus+CrazehMeow+GottJammern use novel code and why didn't they alter the races_humanoid.xml to add the recipes to the base pawn?
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Rikiki on November 18, 2014, 03:16:00 AM
QuoteQuesion - why did 'SurgeryExtended & Bionics' mod by Minus+CrazehMeow+GottJammern use novel code and why didn't they alter the races_humanoid.xml to add the recipes to the base pawn?

For compatibility reasons between mods, you should NOT alter core files like races_humanoid.xml.
You should better add a new module.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 08:37:34 AM
Quote from: Rikiki on November 18, 2014, 03:16:00 AM

For compatibility reasons between mods, you should NOT alter core files like races_humanoid.xml.
You should better add a new module.

If they mod a core file & bundle it in their mod, I can't see an issue as long as theirs is loaded first. You also didn't answer the question: I cannot see any place in their mod where a <list> is added to, nor can I see the point of the <list> in the core file apart from generation of non-Player pawns.

In which case, I obviously want to add to it so that non-Player pawns can spawn with mutations. e.g. In this code, what's the point of having this recipe list, if adding to the InstallBodyPart tree doesn't require modding it at all?

<thinkTree>Humanoid</thinkTree>
      <humanoid>true</humanoid>
      <isFlesh>true</isFlesh>
      <hasLeather>true</hasLeather>
      <leatherColor>(211,194,143)</leatherColor>
      <nameCategory>HumanStandard</nameCategory>
      <hasStory>true</hasStory>
      <minFoodQuality>Raw</minFoodQuality>
      <body>Human</body>
      <bodySize>1</bodySize>
      <healthScale>1</healthScale>
      <diet>Omnivorous</diet>
      <soundWounded>Pawn_Human_Wounded</soundWounded>
      <soundDeath>Pawn_Human_Death</soundDeath>
      <soundMeleeHitPawn>Pawn_Melee_Punch_HitPawn</soundMeleeHitPawn>
      <soundMeleeHitBuilding>Pawn_Melee_Punch_HitBuilding</soundMeleeHitBuilding>
      <soundMeleeMiss>Pawn_Melee_Punch_Miss</soundMeleeMiss>
    </race>
    <recipes>
      <li>InstallPowerClaw</li>
  <li>InstallScytherKnifeProtrusion</li>
      <li>InstallBionicEye</li>
      <li>InstallBionicArm</li>
      <li>InstallBionicLeg</li>
      <li>InstallSimpleProstheticArm</li>
      <li>InstallSimpleProstheticLeg</li>
      <li>InstallPegLeg</li>
      <li>InstallDenture</li>
      <li>InstallNaturalHeart</li>
      <li>InstallNaturalLung</li>
      <li>InstallNaturalKidney</li>
      <li>InstallNaturalLiver</li>
      <li>RemoveBodyPart</li>
  <li>Euthanize</li>
    </recipes>



Anyhow, last try: so far I've asked about 10 times whether or not various <tags> are transferrable and whether they'd work, and got zero response.

<RecipeDef>
<defName>MutateNaturalSkull</defName>
<label>mutate skull</label>
<description>Mutates Skull.</description>
<workerClass>Recipe_InstallNaturalBodyPart</workerClass>
<jobString>Adding foreign DNA to skull.</jobString>
<workAmount>2000</workAmount>
<workEffect>ButcherFlesh</workEffect>
<workSpeedStat>MedicalOperationSpeed</workSpeedStat>
<sustainerSoundDef>Recipe_ButcherCorpseFlesh</sustainerSoundDef>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Mutagen</li>
</thingDefs>
</filter>
<count>1</count>
</li>
<li>
<filter>
<thingDefs>
<li>Skull</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<fixedIngredientFilter>
<thingDefs>
<li>Mutagen</li>
<li>Skull</li>
</thingDefs>
</fixedIngredientFilter>
<appliedOnFixedBodyParts>
<li>Skull</li>
</appliedOnFixedBodyParts>
<subOptionsChooseOne>
<li>
<addsHealthDiff>BonyRidges</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>EnlargedCranium</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>SpongyHoles</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>TumorousGrowths</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>Horned</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>BullHorned</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
<li>
<addsHealthDiff>Predator</addsHealthDiff>
<selectionWeight>20</selectionWeight>
</li>
</subOptionsChooseOne>
</RecipeDef>



It's obvious what I'm attempting to do - I don't understand the confusion / inability for anyone to offer answers and/or fixed XML.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 09:06:16 AM
Injector code from their mod:

public static class humanRecipeResolver
{
public static System.Collections.Generic.List<RecipeDef> collectedRecipes = new System.Collections.Generic.List<RecipeDef>();
public static void collect()
{
foreach (RecipeDef current in DefDatabase<RecipeDef>.get_AllDefs())
{
if (current.workSpeedStat != null)
{
if (current.workSpeedStat.defName.Equals("MedicalOperationSpeed") && !current.defName.Equals("Euthanize"))
{
humanRecipeResolver.collectedRecipes.Add(current);
}
}
}
}
public static void injectToHuman()
{
ThingDef named = DefDatabase<ThingDef>.GetNamed("Human", true);
named.recipes.Clear();
foreach (RecipeDef current in humanRecipeResolver.collectedRecipes)
{
named.recipes.Add(current);
}
}
public static void debug()
{
foreach (RecipeDef current in DefDatabase<ThingDef>.GetNamed("Human", true).recipes)
{
Log.Error(current.defName);
}
}
public static void execute()
{
humanRecipeResolver.collect();
humanRecipeResolver.injectToHuman();
humanRecipeResolver.debug();

and

{
public class Loader : ITab
{
protected GameObject gameObject = null;
public Loader()
{
this.gameObject = new GameObject("Injector");
this.gameObject.AddComponent<NewRecipeNurseObject>();
UnityEngine.Object.DontDestroyOnLoad(this.gameObject);
}
protected override void FillTab()
{
}
}



Unless I'm gravely mistaken, this is a lot of work in order to avoid just adding to that recipelist in the XML. Not sure why it's used?!!?
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Rikiki on November 18, 2014, 10:26:01 AM
I have not played with the prosthesis part of the game for now.
My guess is they use the recipe nurse dll to avoid conflicts between mods adding prosthesis parts because
QuoteI recently saw some mods overwriting Core Definitions to add Recipes. This can be "dangerous" for other mods and break them if they use Core data and should be avoided.

You should have a look at this thread (https://ludeon.com/forums/index.php?topic=6640.0).
Title: Re: Disease Code - location? [Biogenic mod]
Post by: skullywag on November 18, 2014, 12:33:50 PM
The reason you havent got an answer on the tags question is the answer is yes/no some are some arent. The ones that arent can be made to via dll modding. I know you like to know whats available via xml before diving into the c# but i think you could answer a lot of these questions yourself with a quick look over the code in ILSpy or something.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 01:22:28 PM
Quote from: skullywag on November 18, 2014, 12:33:50 PM
The reason you havent got an answer on the tags question is the answer is yes/no some are some arent. The ones that arent can be made to via dll modding. I know you like to know whats available via xml before diving into the c# but i think you could answer a lot of these questions yourself with a quick look over the code in ILSpy or something.

I have ILSpy open atm, and am running into a vicious circle.

e.g.

{
public class AddedBodyPartProps
{
public bool isBionic;
public bool isSolid = true;
public float partEfficiency = 1f;
public ThingDef spawnThingOnRemoved;
}
}


This is a core element to the .dll --- all I want to do is add another tag, thus:

{
public class AddedBodyPartProps
{
public bool isBionic;
public bool isMutation;
public bool isSolid = true;
public float partEfficiency = 1f;
public ThingDef spawnThingOnRemoved;
}
}


Then link that extra tag into a new check:

// RimWorld.ThoughtPredicates
public static bool HasMutatedBodyPart(Pawn p)
{
foreach (HealthDiff current in p.healthTracker.bodyModel.healthDiffs)
{
AddedBodyPartProps addedBodyPart = current.def.addedBodyPart;
if (addedBodyPart != null && addedBodyPart.isMutation)
{
return true;
}
}
return false;
}


Dead easy, done in 15 seconds. Add <IsMutation>true / false</isMutation> to all your bodyparts, we're good to go.


Problem: I have to alter the main .dll to do this. What's the best prog to alter it in and how to export just that single element as a new .dll please?
Title: Re: Disease Code - location? [Biogenic mod]
Post by: skullywag on November 18, 2014, 02:06:42 PM
there's a thread on these forums regarding defining xml for dll use. It involves setting the class to use on the xml next to where you put the "Parent=blah" search "define xml" I'm sure it'll pop up.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 03:18:12 PM
This is the thread:

https://ludeon.com/forums/index.php?topic=3046.0


Not so useful, given that I'll still be modding the core bodypart stuff, and I'd already gone one stage better than that thread, aka - direct c coding.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Haplo on November 18, 2014, 03:42:08 PM
What you try to do is change the core code from Tynan, correct?
As long as you don't have access to Tynans sourcecode it is nearly impossible to do this. You can't just overwrite/change main code that is not specified to be virtual or overridable.
If it were easily changable like that, we (modders) wouldn't have so much problems implementing specific codes and maintaining the compatibility with our different mods. That is the reason why we do some things in an overly complicated way when it would be rather easy if we had access to the source itself ;)

Oh and you aren't correct when you say you've done one better with pure c# coding. If you do pure c# coding and want to change a small value, you always have to compile a new dll. The better variant is, when you code in c# and define specific variables in the xml. This way you can do small changes for testings in between a restart of RimWorld :)
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 04:15:34 PM
Quote from: Haplo on November 18, 2014, 03:42:08 PM
What you try to do is change the core code from Tynan, correct?
As long as you don't have access to Tynans sourcecode it is nearly impossible to do this. You can't just overwrite/change main code that is not specified to be virtual or overridable.
If it were easily changable like that, we (modders) wouldn't have so much problems implementing specific codes and maintaining the compatibility with our different mods. That is the reason why we do some things in an overly complicated way when it would be rather easy if we had access to the source itself ;)

Oh and you aren't correct when you say you've done one better with pure c# coding. If you do pure c# coding and want to change a small value, you always have to compile a new dll. The better variant is, when you code in c# and define specific variables in the xml. This way you can do small changes for testings in between a restart of RimWorld :)

Ok, yes, I understand that - which is why I've asked twice for help.

>>Problem: I have to alter the main .dll to do this. <<

I even typed the code out directly:

{
public class AddedBodyPartProps
{
public bool isBionic;
public bool isMutation;
public bool isSolid = true;
public float partEfficiency = 1f;
public ThingDef spawnThingOnRemoved;
}
}

and

// RimWorld.ThoughtPredicates
public static bool HasMutatedBodyPart(Pawn p)
{
foreach (HealthDiff current in p.healthTracker.bodyModel.healthDiffs)
{
AddedBodyPartProps addedBodyPart = current.def.addedBodyPart;
if (addedBodyPart != null && addedBodyPart.isMutation)
{
return true;
}
}
return false;
}


How's about running me through exactly how to enact those changes, please? The <isBionic> tag is a single check that's used no-where else, so duplicating it shouldn't exactly be difficult.

Downloading Visual Studio 2013 as I type this - but, tbh, this is hitting the line between "modding" and "coding". 9gig download to add a single fucking tag. >.>
Title: Re: Disease Code - location? [Biogenic mod]
Post by: skullywag on November 18, 2014, 04:32:37 PM
ummm 9gig, visual studio express will do. Takes minutes.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 04:42:19 PM
Quote from: skullywag on November 18, 2014, 04:32:37 PM
ummm 9gig, visual studio express will do. Takes minutes.

Cancelled the full studio, signed up for express.

It's still 6 gigs.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: skullywag on November 18, 2014, 04:46:14 PM
My installed folder is just over 1 GB, have they changed the free version recently?
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Haplo on November 18, 2014, 05:05:34 PM
For your problem:
This is how it would normally be done, you make a new class that's based on the old class.
As it's based on the old class, you don't need to repeat their variables. They are already there.
What's a bit of a problem in this case is, that you need to tell the program to use your definition instead of the core definition of the class. Normally Tynan did it nicely that you can define the new class in the xml and the game runs with it. As far as I can see it, that isn't really possible with this case, as it is only defined and used inside the code, without any possibility to change it..
Maybe someone else has an idea how to do that, but from my point of view it's not doable, sorry..
This is one of the cases that look really easy and are really hard to do.


public class MyAddedBodyPartProps : AddedBodyPartProps
{
public bool isMutation;
}
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Cat123 on November 18, 2014, 05:07:24 PM
Quote from: skullywag on November 18, 2014, 04:46:14 PM
My installed folder is just over 1 GB, have they changed the free version recently?

Express 2013 for win desktop - MS just made a lot of VS open source etc, so that might have changed things.

I'm going to finish off all the XML I can do & bundle it into an alpha release (which 100% won't work). Getting <statbase> and armor defs onto bodyparts and so on is going to be fun. (JuliaEllie's code is going to get ravaged).

<artificialBodyPartsMoney>
<min>1000</min>
<max>1500</max>
</artificialBodyPartsMoney>
<artificialBodyPartsTags>
<li>Advanced</li>
</artificialBodyPartsTags>
<artificialBodyPartsChance>0.003</artificialBodyPartsChance>


Modding this for pawnkinds_mutants.xml is also uggh. I cannot see in ILSpy where <advanced> is actually defined in relation to the bionic bodyparts that are currently in vanilla.

For some basic cyborgs as an event, obviously something like:

<artificialBodyPartsMoney>
<min>5000</min>
<max>15000</max>
</artificialBodyPartsMoney>
<artificialBodyPartsTags>
<li>Advanced</li>
</artificialBodyPartsTags>
<artificialBodyPartsChance>0.5</artificialBodyPartsChance>


Would work. But... no tags, nothing I can spot that defines which bodyparts are advanced. Logically, it'd be the <isbionic> tag, but nooooo.

Quote from: Haplo on November 18, 2014, 05:05:34 PM
As far as I can see it, that isn't really possible with this case, as it is only defined and used inside the code, without any possibility to change it..
Maybe someone else has an idea how to do that, but from my point of view it's not doable, sorry..
This is one of the cases that look really easy and are really hard to do.

What about just cloning it & using the tag MutatedBodyParts instead?

<HealthDiffDef Name="MutatedBodyPartBase" Abstract="True">
    <naturallyHealed>true</naturallyHealed>
  </HealthDiffDef>


Then the new items would use the cloned class, which would function exactly the same (apart from "<isbionic>" > "isMutation").

p.s.

Tynan is a beast with this code base. Makes content modders depressed though.
Title: Re: Disease Code - location? [Biogenic mod]
Post by: Haplo on November 18, 2014, 05:23:54 PM
Most likely it would be like this:
<HealthDiffDef Class="MutationMod.MutatedBodyPartBase"...>
Then you can read it with your code.
The base code won't access it, but that's really not needed, so yes, it can maybe work.