Dynamic Resource Genes - KonradHeinser/EBSGFramework GitHub Wiki
If you've look at, or even created, resource genes, you know that the process is a sprawling mess of C# with utilities you can't even use. Dynamic Resource Genes(DRGs) seeks to simplify the process of creating new resource genes a lot by turning all of that stuff into something achievable with just xml. This was accomplished by first making me contemplate murder as I double the work normally involved in making a resource gene, then refining whatever that process made into one DRGExtension and many comps.
Now for minor caveats. Interacting with other resources is limited. There is an ability to convert from one DRG to another, but that cannot convert with Hemogen, any SHG resource, or any resource added by a mod that isn't a DRG, unless you use the standard individual cost comps. You also won't get a special alert for your resource, just a generic "low on a resource". There isn't a way to specify what resource, so I left it as a generic alert that points to all pawns with a low resource level.
Enough rambling though, let's get into coding the Resource Gene. If you're just starting, these are in the order you are most likely to need them. For a more complete example of this in use, see SHG - Just the Radiomancer.
Basic Mod Extension for genes
<modExtensions>
<li Class="EBSGFramework.DRGExtension">
</li>
</modExtensions>
- The Genes : Set up the main resource gene and drain/regen genes
- Resource Packs : Add a special ingestion outcome doer that alters the resource
- Craving and Overcharge Hediffs : Hediffs that appear when the resource runs out or sits at the maximum for extended periods of time
- Resource Using Abilities : Make abilities that use(or give) the resource
- Converting Resources : Make abilities that convert one DRG resource into another
- Special DRG Abilities : Make abilities similar to non-DRG ones that scale based on a variable amount of the consumed resource
- Special DRG Hediffs : Make hediffs that do various things and usually allow for more interaction between DRGs than normal