You need two basic things to create new mineable resource which will auto-gen (requires a new world).
Look at the existing xml defs for "RockBase" and it's derived objects (such as Granite). They define the rock for the maps. The other thing you need is something to mine which, for the core rocks, is "chunks." Metals work almost identically and you will see how pretty quick.
Within a few hours I was able to create an aluminium production chain by mining bauxite rock into bauxite chunks which get turned into alumina at the stone cutting workbench and smelted with "industrial chemicals" (made at another workbench) to produce aluminium. Not sure if I will make anything of it, it was just an personal challenge to figure out the systems involved and increasing levels of complexity.
xml to create mineable bauxite rock:
/Mods/modName/Defs/ThingDefs/Bauxite.xml
Look at the existing xml defs for "RockBase" and it's derived objects (such as Granite). They define the rock for the maps. The other thing you need is something to mine which, for the core rocks, is "chunks." Metals work almost identically and you will see how pretty quick.
Within a few hours I was able to create an aluminium production chain by mining bauxite rock into bauxite chunks which get turned into alumina at the stone cutting workbench and smelted with "industrial chemicals" (made at another workbench) to produce aluminium. Not sure if I will make anything of it, it was just an personal challenge to figure out the systems involved and increasing levels of complexity.
xml to create mineable bauxite rock:
/Mods/modName/Defs/ThingDefs/Bauxite.xml
Code Select
<?xml version="1.0" encoding="UTF-8"?>
<Defs>
<!--======================= Bases ==============================-->
<ThingDef Name="ResourceBase" Abstract="True">
<thingClass>ThingWithComps</thingClass>
<label>unspecified resource</label>
<category>Item</category>
<resourceReadoutPriority>Middle</resourceReadoutPriority>
<useHitPoints>true</useHitPoints>
<selectable>true</selectable>
<altitudeLayer>Item</altitudeLayer>
<stackLimit>75</stackLimit>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
</comps>
<alwaysHaulable>true</alwaysHaulable>
<drawGUIOverlay>true</drawGUIOverlay>
<rotatable>false</rotatable>
<pathCost>15</pathCost>
</ThingDef>
<!--======================= Natural Building Base ==============================-->
<ThingDef Name="BuildingNaturalBase" Abstract="True">
<category>Building</category>
<selectable>true</selectable>
<drawerType>MapMeshOnly</drawerType>
</ThingDef>
<!--======================= Natural Rock Base ==============================-->
<ThingDef Name="RockBase" ParentName="BuildingNaturalBase" Abstract="True">
<thingClass>Mineable</thingClass>
<graphicPath>Things/Building/Linked/Rock_Atlas</graphicPath>
<graphicClass>Graphic_Single</graphicClass>
<linkDrawerType>CornerFiller</linkDrawerType>
<altitudeLayer>BuildingTall</altitudeLayer>
<passability>Impassable</passability>
<castEdgeShadows>true</castEdgeShadows>
<fillPercent>1</fillPercent>
<coversFloor>true</coversFloor>
<neverMultiSelect>true</neverMultiSelect>
<rotatable>false</rotatable>
<saveCompressible>true</saveCompressible>
<filthLeaving>RockRubble</filthLeaving>
<holdsRoof>true</holdsRoof>
<staticSunShadowHeight>1.0</staticSunShadowHeight>
<blockLight>true</blockLight>
<mineable>true</mineable>
<statBases>
<Flammability>0</Flammability>
<Beauty>-2</Beauty>
</statBases>
<building>
<isInert>true</isInert>
<isNaturalRock>true</isNaturalRock>
<soundMined>CollapseRock</soundMined>
<canBuildNonEdificesUnder>false</canBuildNonEdificesUnder>
</building>
<linkFlags>
<li>Rock</li>
<li>MapEdge</li>
</linkFlags>
</ThingDef>
<!--======================= Chunk Base ==============================-->
<ThingDef Name="ChunkBase" Abstract="True">
<category>Item</category>
<thingClass>Thing</thingClass>
<altitudeLayer>Item</altitudeLayer>
<passability>PassThroughOnly</passability>
<fillPercent>0.4</fillPercent>
<statBases>
<MaxHitPoints>300</MaxHitPoints>
<Flammability>0</Flammability>
<Beauty>-10</Beauty>
</statBases>
<selectable>true</selectable>
<neverMultiSelect>true</neverMultiSelect>
<pathCost>55</pathCost>
<graphicOverdraw>false</graphicOverdraw>
<drawerType>MapMeshOnly</drawerType>
<randomizeRotationOnSpawn>true</randomizeRotationOnSpawn>
<designateHaulable>true</designateHaulable>
<saveCompressible>true</saveCompressible>
<stackLimit>1</stackLimit>
<tradeability>Never</tradeability>
</ThingDef>
<!--======================= Bauxite Rock ==============================-->
<ThingDef ParentName="RockBase">
<defName>Bauxite</defName>
<label>bauxite</label>
<description>Bauxite, an aluminium ore, is the world's main source of aluminium.</description>
<defaultColor>(169,131,120)</defaultColor>
<statBases>
<MaxHitPoints>1000</MaxHitPoints>
</statBases>
<building>
<mineableThing>ChunkBauxite</mineableThing>
<mineableDropChance>1</mineableDropChance>
</building>
</ThingDef>
<!--======================= Bauxite Chunk ==============================-->
<ThingDef ParentName="ChunkBase">
<defName>ChunkBauxite</defName>
<label>bauxite chunk</label>
<graphicPath>Things/Item/Chunk/ChunkStone</graphicPath>
<graphicClass>Graphic_Random</graphicClass>
<soundDrop>ChunkRock_Drop</soundDrop>
<defaultColor>(169,131,120)</defaultColor>
<thingCategories>
<li>StoneChunks</li>
</thingCategories>
</ThingDef>
</Defs>
