[1.0] Variable Bleed Rate Framework

Started by ilikegoodfood, September 26, 2018, 05:24:52 AM

Previous topic - Next topic

ilikegoodfood

This is a very simple framework (a single line injection) that enables manipulation of the Total Bleed Rate of a pawn through the introduction of the BleedRate Capacity.

The Total Bleed Rate is now determined as the sum of all injuries' bleed rates multiplied by the BleedRate Capacity.
The BleedRate Capacity can be effected by hediffDefs, such as medicines, poisons, injuries, etc., just like all other pawn Capacities.

LICENSE:
This mod was made to be a standalone framework for the use of other mods. Credit would be appreciated, but there's only so much room for credits, so it's not a must.

DOWNLOADS:
1.0
Steam Workshop
Direct Download (Dropbox)

B19
Steam Workshop
Direct Download (Dropbox)

USE:
To enable this mod either:
1) Make your mod dependant on this one, which will require your user to make sure that they have downloaded this mod and loaded it before your own.
2) Copy the Variable Bleed Rate.dll into your mod's assembly folder and merge the included Defs with your own.
2a) If your mod doesn't already have the 0Harmony.dll assembly, copy that over too. It will not work without it.

FREQUENTLY ASKED QUESTIONS:
Q) Why make a Framework mod for something so small?
A) While it is an extremely small and extremely simple mod, it provides a much needed base functionality to those who are not familiar with the C# side of RimWorld modding, and prevents potential conflicts between mods that create the same effect in different ways.
If we all use the framework from the get-go, then all of our mods will work together.

Razzoriel

Hi, can you provide a framework for stats that interfere with Hediff ticking? It seems like you could expand that through messing with the blood loss hediff, which slowly recovers the pawn. As in, people with diseases cannot produce as much blood as they could, for instance.

ilikegoodfood

Unfortunately I'm very much a beginner at modding RimWorld myself. As I mentioned in the description, this framework is about as simple as it's possible for any C# mod to get, requiring only one line of code to be injected into the base game's functionality.

If I'm understanding your request correctly though, you're saying that you want people who are ill with other conditions to recover blood (recover from blood loss) at a slower rate. The game only has, to my understanding, two tick-rates, short and long ticks. You wouldn't want to be messing with those.

To make such a change, you'd need to investigate the HediffDef for Blood Loss, specifically it's recovery rate. There are a number of HediffCompProperties_Immunizable that allow you to define how a condition gets better. As far as I know though, making blood loss recover more slowly when certain other hediffs effect a pawn is not correctly possible in XML, and is beyond my own abilities.

If you're seriously interested in making such a mod yourself, you can always post in the Help section. People are generally helpful, but they won't do things for you. You'll have to poke around and learn a lot of how the game works for yourself with existing resources.


ilikegoodfood

Updated version for 1.0 has been released.

ilikegoodfood

Updated version for 1.0.2282.

Due to its tiny size, this update was an almost total rework. It now only uses a Capacity, instead of previous versions which used a Capacity and a Stat. It has also had a compatibility feature implemented for an upcomming release.

Trunken


ilikegoodfood

A small update that changes how VBRF identifies the presence of VEF. The new method should be considerably better on load performance (although with such a small mod, you are unlikely to notice it).