Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Cat123

#31
Help / Re: Disease Code - location? [Biogenic mod]
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.
#32
Help / Re: Disease Code - location? [Biogenic mod]
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?
#33
Help / Re: [Biogenics Mod] Random tables, Traits and more
November 18, 2014, 12:28:24 PM
Quote from: Rikiki on November 18, 2014, 12:08:19 PM
You can do it using a kind of apparel (a fake armor for example).
I use it for the alert speaker in M&Co. Security enforcement mod.

This may change in alpha 8 with all the changelog "stats cleanup".

I'll take a look.

On thoughts: currently this is the brute force way to give universally:

foreach (Pawn current in GenLinq.InRandomOrder<Pawn>(list))
{
current.psychology.thoughts.TryGainThought(new Thought(ThoughtDef.Named("SolarFlareSubEventACosmicRadiation")));
}
result = true;
}
else
{
result = false;
}

Found them:

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


Colonist left unburied:

public static bool ColonistLeftUnburied(Pawn p)
{
if (p.Faction != Faction.OfColony)
{
return false;
}
List<Thing> list = Find.ListerThings.ThingsListMatching(ThingRequest.ForGroup(ThingRequestGroup.Corpse));
if (list != null)
{
for (int i = 0; i < list.Count; i++)
{
Corpse corpse = (Corpse)list[i];
if (corpse.Age > 80000 && corpse.sourcePawn.Faction == Faction.OfColony && !corpse.IsInAnyStorage())
{
return true;
}
}
}
return false;
}



Observedthoughts are given by the parent object, thus: public Thought GiveObservedThought()
{
if (!this.sourcePawn.RaceProps.humanoid)
{
return null;
}
Thing thing = this.StoringBuilding();
if (thing == null)
{
bool flag = false;
CompRottable comp = base.GetComp<CompRottable>();
if (comp != null && comp.Stage != RotStage.Fresh)
{
flag = true;
}
if (flag)
{
return new Thought_Observation(ThoughtDef.Named("ObservedLayingRottingCorpse"), this);
}
return new Thought_Observation(ThoughtDef.Named("ObservedLayingCorpse"), this);
}
else
{
if (!(thing.def.defName == "GibbetCage"))
{
return null;
}
if (this.sourcePawn.Faction == Faction.OfColony)
{
return new Thought_Observation(ThoughtDef.Named("ObservedGibbetCageFullColonist"), this);
}
return new Thought_Observation(ThoughtDef.Named("ObservedGibbetCageFullStranger"), this);
}
}


Hmm.


#34
Help / Re: [Biogenics Mod] Random tables, Traits and more
November 18, 2014, 11:51:27 AM
Can you add <permaThought>XXX</permaThought> to conditional thoughtdefs in thoughts_conditionsSpecial.xml and still have it work?
Does the tag <MentalBreakThreshold>work in thoughts_conditionsSpecial.xml?


No, neither work.

Means you can't currently alter pawn MentalBreakThresholds over time. Bleh.
#35
Help / Re: Disease Code - location? [Biogenic mod]
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?!!?
#36
Help / Re: Disease Code - location? [Biogenic mod]
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.
#37
Help / Re: [Biogenics Mod] Random tables, Traits and more
November 17, 2014, 04:30:46 PM
Quote from: Tynan on November 17, 2014, 03:59:06 PM
Traits are personality traits. They have nothing to do with the health system; if you want to create a linkage there you'll have to code it yourself.

I'll take that as:

Question: Is it currently possible to activate / give pawns traits outside of birth generation? Also, is it possible to tie not just Skills, but specific stats to a trait?

Answer: No, not without coding it yourself: hierarchy is set as Trait highest and set on birth (?).

  <TraitDef>
    <defName>Masochist</defName>
    <commonality>0.2</commonality>
    <degreeDatas>
      <li>
        <label>masochist</label>
        <description>For NAME, there's something exciting about getting hurt. HECAP doesn't know why, HE's just wired differently.</description>
      </li>
    </degreeDatas>
  </TraitDef>


This is a personality trait that is conditional on external factors.

If you look at point 2)d), I'm attempting to do the same thing, but slightly dynamically. i.e. A pawn with <nudist> gets a conditional +mood mod if they're not wearing clothes (binary conditional on external event). 2)d) = a pawn with a <mutation> enters the Mutation spectrum and is designed to work so that as conditionals are met (progressively more mutations) traits are unlocked, making the pawn more and more likely to suffer a breakdown / have unhappiness mood effects.

The two are conceptually very similar, my example is merely treating # of installed bodyparts = the same as clothes, but in a dynamic fashion. Has no real ties to the health system ~ I should probably move the spectrum to a thought.conditional, which is why I asked about them.

So, the question was if it actually needed more code: I guess I look for the     <activePredicate>ThoughtPredicates.MasochistLittlePain</activePredicate> code then and set a global so that all pawns have a neutral <mutation> trait on birth ("humanity") that is then triggered. e.g.

  <TraitDef>
    <defName>Humanity</defName>   
<commonality>10</commonality>
    <degreeDatas>
      <li>
        <label>baseline human</label>
        <description>NAME's body is unchanged since birth. HECAP is happy in their own skin</description>
        <degree>0</degree>
      </li>


Then add the -negatives as mutations in thoughts_conditionsspecial.xml

I'm guessing that would work without massive recoding? i.e. if traits are static and cannot change, then that's what I have to code.

Quote from: Tynan on November 17, 2014, 03:59:06 PMDefine thought predicates by creating a static class with a method in it and referencing that. Use a decompiler to look at the existing code.

Ok, so there's no XML expressions for any of this, got you. I presume that the "observedX" conditionals (for dead bodies etc) are also purely in the code base? i.e. do you have a flag system which can be attached to pawns? if so, is it just in the code base? [set mutation flag = 1, 2, 3, 4 means "observedX" and thoughts_conditionsspecial.xml can effect both the pawn with the condition and those viewing it].


Sounds good, but irksome that we can't modify traits on the fly.


Quote from: Tynan on November 17, 2014, 03:59:06 PMI had a lot of trouble understanding your post; it would be good if you could write your questions clearly and in an encapsulated way so they can be answered one by one.

This thread: https://ludeon.com/forums/index.php?topic=7390.0 preceeded this one. There are specific questions about if certain XML tags work in different classes in there. e.g.

Can you add <statBases> to bodyparts?
<subOptionsChooseOne> < is there a subtag for weighting on this, and does it work outside the pawndefs?
Can you add <permaThought>XXX</permaThought> to conditional thoughtdefs in thoughts_conditionsSpecial.xml and still have it work?
Does the tag <MentalBreakThreshold>work in thoughts_conditionsSpecial.xml?

e.g. We change 2)d) trait into a singular trait, and then throw the dynamic stuff into thoughts_conditionsSpecial.xml:

<TraitDef>
    <defName>HomoSapiensSapiens</defName>   
<commonality>10</commonality>
    <degreeDatas>
      <li>
        <label>baseline human</label>
        <description>NAME's body is unchanged since birth. HECAP is happy in their own skin</description>
      </li>
  </degreeDatas>
  </TraitDef>

and

     <ThoughtDef>
    <defName>HasMinorMutation</defName>
        <label>minor mutation</label>
        <description>NAME's body has changed from the human normal in a small but noticable way. HECAP feels ostracized and unnatural.</description>
        <statModifiers>
<MentalBreakThreshold>6</MentalBreakThreshold>
        <permaThought>MoodOffsetMinorMutation</permaThought>
        </statModifiers>
<activePredicate>ThoughtPredicates.HasMinorMutation</activePredicate>
    <requiredTraits>
      <li>HomoSapiensSapiens</li>
    </requiredTraits>
      </li>
    </ThoughtDef>



As you can spot, some of those tags are currently only defined for other files: do they still work? (as you can see - I can easily change the way a mechanic works, but I then run into questions about if tags work... sigh)

At the moment I'm looking to use whatever XML stuff is available from the alpha7 build without coding additional gubbins. The point is to see what the engine can do, not whether or not I can code a similar game experience (I can't, and it's not worthwhile to do it).


Anyhow, thanks for the response.
#38
Quick coding question:

Why aren't the various recipes added to races_humanoid.xml? It appears there's a specific list already coded. From core thingdefs:

    <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>


I'm confused, because power claw is on that list, but your mod lists it as originating from you (!)

So, basically - why isn't this list used as a master list for surgeries?

Also, -- <modifiers>
      <activities>
        <li>
          <activity>Manipulation</activity>
          <changeBy>0.3</changeBy>
        </li>
      </activities>
    </modifiers>
    <verbs>
      <li>
        <verbClass>Verb_MeleeAttack</verbClass>
        <cooldownTicks>60</cooldownTicks>
        <meleeDamageAmount>22</meleeDamageAmount>
        <meleeDamageDef>Scratch</meleeDamageDef>
      </li>
    </verbs>


Can you place other tags into the <modifiers> tags? e.g. armor / skill mods? e.g.

    <statBases>
      <DamageDeflection_Blunt>0.1</DamageDeflection_Blunt>
      <DamageDeflection_Piercing>0.1</DamageDeflection_Piercing>
    </statBases>

or

    <skillGains>
      <li>
        <key>Shooting</key>
        <value>3</value>
      </li>
    </skillGains>


i.e. can bodyparts have those tags? (and if not, dammit, why not! ;) ). I know you can alter the HP of organs, but I'm looking for something a little wilder - I know that the base category of <activity> governs most other skills, but I'd prefer much finer tuning than just a blanket "improve everything". e.g. A sharp-shooter's eye should give +shooting, but not anything else governed by the sight <activity>.


p.s.

Thank you for this mod, not only does it play well, but has been a core element to making my own mod, it's incredibly helpful!
#39
Help / Re: Disease Code - location? [Biogenic mod]
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?
#40
Help / Re: Disease Code - location? [Biogenic mod]
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.
#41
Help / Re: Disease Code - location? [Biogenic mod]
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)
#42
Help / Re: Disease Code - location? [Biogenic mod]
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.
#43
Quote from: JuliaEllie on November 16, 2014, 05:38:55 PM
well mainly because the game isnt open source I guess :D but anyone can call from another assembly/namespace just like we do it with the original rimworld assemblies. What you think about seems to be something like Forge I tried to arrange such a thing a few times but it seems like we all prefer to be hermits :D  New Recipe Nurse is the only standard we could decide on so far :D

Don't even get me started on why there aren't master Excel sheets used to export to XML instead of the current stuff (!).

Meh, I'm talking big without producing anything. I'll make my little mod, then see what the oldtimers think.
#44
Quote from: JuliaEllie on November 16, 2014, 05:29:23 PM
Actually its the best thing you can have because you can do whatever you like. You can make your own tools, libraries, features, you could even make a completely different game out of it. Absolute creative freedom - without this many mods wouldnt have been possible.

And why do we convert .dll functions into XML base on the main branch?

Hint: so that it's not repeated 1,000,000 times in each individual mod.

I'm not in the mood atm, but I'm fairly sure I know what your .dll does - it's stripping # off <skill> totals from <saved data> pawns, saving them elsewhere (temp), doing a bit of RNG to keep whichever ones and then copy/pasting them.

Now, you might use that for a cloning process. I see that as possibly being very useful for dynamic event procedural generation, where you're stripping (dead) pawns of damage stats, averaging it over time to weigh a "colony threat level" around their kill zone. Then saving it, and porting it into a RNG where I can weight that number against much more dangerous events (that would be totally unfair with smaller colonies).

See?

But since it's a .dll, fuck it.
#45
Quote from: JuliaEllie on November 16, 2014, 05:25:07 PM
Because the xmls do nothing on their own. They are only config files for the .dlls. I only use them to declare very basic stuff or stuff Im too lazy to make in c#. Theoredically its possible to make things only declared by a Def type and DefName and do the rest in the .dll.


Yeah, I know that.

It's awful practice to have .dlls that aren't in the main branch used for mods though. Fucking terrible.