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>
⚠️ **GitHub.com Fallback** ⚠️