Skip to content

Commit

Permalink
[FIX] Compatibility
Browse files Browse the repository at this point in the history
- Fixed compatibility issues by adding dynamic prerequisite setting for
Blueprints
- Updated "About" with note that mod should be loaded after any
Research-altering mods
  • Loading branch information
NoahKYoung committed Jul 20, 2018
1 parent 4be9ae0 commit 9cce293
Show file tree
Hide file tree
Showing 24 changed files with 178 additions and 204 deletions.
4 changes: 3 additions & 1 deletion About/About.xml
Expand Up @@ -4,7 +4,9 @@
<author>Smuffle, LOLKAT_KOMRAD_94</author>
<targetVersion>0.18.1722</targetVersion>
<url>https://ludeon.com/forums/index.php?topic=37649.0</url> <!--Will have to enter forum post link-->
<description>This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
<description>**NOTE: Load this mod after any mod that adds, removes or changes Research Projects.**

This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
These are rare items that can be dropped by enemies or bought at traders. Using one will consume it and unlock a random, researchable technology if the blueprint is under or equivalent to your era; otherwise, it will give you some progress towards the technology.

There are four types of blueprints:
Expand Down
Binary file modified Assemblies/RimworldDiscoverTechs.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions Assemblies/RimworldDiscoverTechs.dll.config
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
69 changes: 4 additions & 65 deletions Defs/ResearchProjectDefs/ResearchProjects_Blueprints.xml
Expand Up @@ -10,13 +10,7 @@
<tab>Blueprints</tab>
<techLevel>Neolithic</techLevel>
<prerequisites>
<li>RecurveBow</li>
<li>Pemmican</li>
<li>PassiveCooler</li>
<li>Devilstrand</li>
<li>PsychoidBrewing</li>
<li>Brewing</li>
<li>Bedrolls</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>0</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -31,13 +25,7 @@
<techLevel>Medieval</techLevel>
<prerequisites>
<li>NeolithicBlueprint</li>
<li>Beds</li>
<li>CarpetMaking</li>
<li>Smithing</li>
<li>Stonecutting</li>
<li>ComplexClothing</li>
<li>LongBlades</li>
<li>Greatbows</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>1</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -53,47 +41,7 @@
<prerequisites>
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>DrugProduction</li>
<li>Electricity</li>
<li>PsychiteRefining</li>
<li>WakeUpProduction</li>
<li>GoJuiceProduction</li>
<li>PenoxycylineProduction</li>
<li>Batteries</li>
<li>Refining</li>
<li>NutrientPaste</li>
<li>SolarPanels</li>
<li>AirConditioning</li>
<li>Autodoors</li>
<li>Hydroponics</li>
<li>ElectricSmelting</li>
<li>PackagedSurvivalMeal</li>
<li>ElectricCremation</li>
<li>ColoredLights</li>
<li>Machining</li>
<li>IEDs</li>
<li>IEDIncendiary</li>
<li>Mortars</li>
<li>Gunsmithing</li>
<li>BlowbackOperation</li>
<li>GasOperation</li>
<li>PrecisionRifling</li>
<li>SmokepopBelt</li>
<li>MicroelectronicsBasics</li>
<li>TubeTelevision</li>
<li>GunTurrets</li>
<li>Firefoam</li>
<li>MoisturePump</li>
<li>GeothermalPower</li>
<li>TransportPod</li>
<li>MedicineProduction</li>
<li>MultiAnalyzer</li>
<li>LongRangeMineralScanner</li>
<li>GroundPenetratingScanner</li>
<li>DeepDrilling</li>
<li>VitalsMonitor</li>
<li>ComponentAssembly</li>
<li>MultibarrelWeapons</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>2</researchViewX>
Expand All @@ -111,16 +59,7 @@
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>IndustrialBlueprint</li>
<li>Cryptosleep</li>
<li>PoweredArmor</li>
<li>ShieldBelt</li>
<li>ChargedShot</li>
<li>ShipBasics</li>
<li>ShipCryptosleep</li>
<li>ShipReactor</li>
<li>ShipEngine</li>
<li>ShipComputerCore</li>
<li>ShipSensorCluster</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>3</researchViewX>
Expand Down
4 changes: 3 additions & 1 deletion RELEASE/TechnologyBlueprints/About/About.xml
Expand Up @@ -4,7 +4,9 @@
<author>Smuffle, LOLKAT_KOMRAD_94</author>
<targetVersion>0.18.1722</targetVersion>
<url>https://ludeon.com/forums/index.php?topic=37649.0</url> <!--Will have to enter forum post link-->
<description>This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
<description>**NOTE: Load this mod after any mod that adds, removes or changes Research Projects.**

This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
These are rare items that can be dropped by enemies or bought at traders. Using one will consume it and unlock a random, researchable technology if the blueprint is under or equivalent to your era; otherwise, it will give you some progress towards the technology.

There are four types of blueprints:
Expand Down
Binary file not shown.
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
Expand Up @@ -10,13 +10,7 @@
<tab>Blueprints</tab>
<techLevel>Neolithic</techLevel>
<prerequisites>
<li>RecurveBow</li>
<li>Pemmican</li>
<li>PassiveCooler</li>
<li>Devilstrand</li>
<li>PsychoidBrewing</li>
<li>Brewing</li>
<li>Bedrolls</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>0</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -31,13 +25,7 @@
<techLevel>Medieval</techLevel>
<prerequisites>
<li>NeolithicBlueprint</li>
<li>Beds</li>
<li>CarpetMaking</li>
<li>Smithing</li>
<li>Stonecutting</li>
<li>ComplexClothing</li>
<li>LongBlades</li>
<li>Greatbows</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>1</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -53,47 +41,7 @@
<prerequisites>
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>DrugProduction</li>
<li>Electricity</li>
<li>PsychiteRefining</li>
<li>WakeUpProduction</li>
<li>GoJuiceProduction</li>
<li>PenoxycylineProduction</li>
<li>Batteries</li>
<li>Refining</li>
<li>NutrientPaste</li>
<li>SolarPanels</li>
<li>AirConditioning</li>
<li>Autodoors</li>
<li>Hydroponics</li>
<li>ElectricSmelting</li>
<li>PackagedSurvivalMeal</li>
<li>ElectricCremation</li>
<li>ColoredLights</li>
<li>Machining</li>
<li>IEDs</li>
<li>IEDIncendiary</li>
<li>Mortars</li>
<li>Gunsmithing</li>
<li>BlowbackOperation</li>
<li>GasOperation</li>
<li>PrecisionRifling</li>
<li>SmokepopBelt</li>
<li>MicroelectronicsBasics</li>
<li>TubeTelevision</li>
<li>GunTurrets</li>
<li>Firefoam</li>
<li>MoisturePump</li>
<li>GeothermalPower</li>
<li>TransportPod</li>
<li>MedicineProduction</li>
<li>MultiAnalyzer</li>
<li>LongRangeMineralScanner</li>
<li>GroundPenetratingScanner</li>
<li>DeepDrilling</li>
<li>VitalsMonitor</li>
<li>ComponentAssembly</li>
<li>MultibarrelWeapons</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>2</researchViewX>
Expand All @@ -111,16 +59,7 @@
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>IndustrialBlueprint</li>
<li>Cryptosleep</li>
<li>PoweredArmor</li>
<li>ShieldBelt</li>
<li>ChargedShot</li>
<li>ShipBasics</li>
<li>ShipCryptosleep</li>
<li>ShipReactor</li>
<li>ShipEngine</li>
<li>ShipComputerCore</li>
<li>ShipSensorCluster</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>3</researchViewX>
Expand Down
Binary file added RELEASE/TechnologyBlueprintsv1.0.1.zip
Binary file not shown.
Binary file modified Sources/.vs/RimworldDiscoverTechsMod/v15/.suo
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion Sources/RimworldDiscoverTechs/About/About.xml
Expand Up @@ -4,7 +4,9 @@
<author>Smuffle, LOLKAT_KOMRAD_94</author>
<targetVersion>0.18.1722</targetVersion>
<url>https://ludeon.com/forums/index.php?topic=37649.0</url> <!--Will have to enter forum post link-->
<description>This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
<description>**NOTE: Load this mod after any mod that adds, removes or changes Research Projects.**

This mod adds Technology Blueprints to the game. Discover the secrets of any research by using them!
These are rare items that can be dropped by enemies or bought at traders. Using one will consume it and unlock a random, researchable technology if the blueprint is under or equivalent to your era; otherwise, it will give you some progress towards the technology.

There are four types of blueprints:
Expand Down
@@ -0,0 +1,60 @@
using Verse;
using System;
using RimWorld;
using System.Collections.Generic;

namespace RimworldDiscoverTechs
{
[StaticConstructorOnStartup]
class RimworldDiscoverTechsClass
{
static RimworldDiscoverTechsClass()
{
Log.Message("### Technology Blueprints mod loaded. ###");

// Go through research projects, create lists according to techLevels, then add those projectDefs as prerequisites to each technology blueprint researchDef accordingly.
// First we create lists
List<ResearchProjectDef> listOfBPs = new List<ResearchProjectDef>(4);
List<List<ResearchProjectDef>> listOfResearchLists = new List<List<ResearchProjectDef>>(4);

List<ResearchProjectDef> researchProjectsNeolithic = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Neolithic);
listOfResearchLists.Add(researchProjectsNeolithic);
ResearchProjectDef NeolithicBP = researchProjectsNeolithic.Find((ResearchProjectDef x) => x.defName == "NeolithicBlueprint");
researchProjectsNeolithic.Remove(NeolithicBP);
listOfBPs.Add(NeolithicBP);

List<ResearchProjectDef> researchProjectsMedieval = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Medieval);
listOfResearchLists.Add(researchProjectsMedieval);
ResearchProjectDef MedievalBP = researchProjectsMedieval.Find((ResearchProjectDef x) => x.defName == "MedievalBlueprint");
researchProjectsMedieval.Remove(MedievalBP);
listOfBPs.Add(MedievalBP);

List<ResearchProjectDef> researchProjectsIndustrial = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Industrial);
listOfResearchLists.Add(researchProjectsIndustrial);
ResearchProjectDef IndustrialBP = researchProjectsIndustrial.Find((ResearchProjectDef x) => x.defName == "IndustrialBlueprint");
researchProjectsIndustrial.Remove(IndustrialBP);
listOfBPs.Add(IndustrialBP);

List<ResearchProjectDef> researchProjectsSpacer = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Spacer);
listOfResearchLists.Add(researchProjectsSpacer);
ResearchProjectDef SpacerBP = researchProjectsSpacer.Find((ResearchProjectDef x) => x.defName == "SpacerBlueprint");
researchProjectsSpacer.Remove(SpacerBP);
listOfBPs.Add(SpacerBP);

// Then we update the prereqs
for (int i = 0; i < listOfBPs.Count; i++)
{
Log.Message("Checking " + listOfBPs[i].defName);

foreach (ResearchProjectDef researchProject in listOfResearchLists[i])
{
listOfBPs[i].prerequisites.Add(researchProject);
Log.Message("+ Prerequisite " + researchProject.defName);
}
}

Log.Message("Technology Blueprints: modified prerequisites for Technology Blueprints research projects.");
Log.Message("### We hope you enjoy Technology Blueprints!###");
}
}
}
Expand Up @@ -10,13 +10,7 @@
<tab>Blueprints</tab>
<techLevel>Neolithic</techLevel>
<prerequisites>
<li>RecurveBow</li>
<li>Pemmican</li>
<li>PassiveCooler</li>
<li>Devilstrand</li>
<li>PsychoidBrewing</li>
<li>Brewing</li>
<li>Bedrolls</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>0</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -31,13 +25,7 @@
<techLevel>Medieval</techLevel>
<prerequisites>
<li>NeolithicBlueprint</li>
<li>Beds</li>
<li>CarpetMaking</li>
<li>Smithing</li>
<li>Stonecutting</li>
<li>ComplexClothing</li>
<li>LongBlades</li>
<li>Greatbows</li>
<!-- Autofilled from code-->
</prerequisites>
<researchViewX>1</researchViewX>
<researchViewY>0</researchViewY>
Expand All @@ -53,47 +41,7 @@
<prerequisites>
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>DrugProduction</li>
<li>Electricity</li>
<li>PsychiteRefining</li>
<li>WakeUpProduction</li>
<li>GoJuiceProduction</li>
<li>PenoxycylineProduction</li>
<li>Batteries</li>
<li>Refining</li>
<li>NutrientPaste</li>
<li>SolarPanels</li>
<li>AirConditioning</li>
<li>Autodoors</li>
<li>Hydroponics</li>
<li>ElectricSmelting</li>
<li>PackagedSurvivalMeal</li>
<li>ElectricCremation</li>
<li>ColoredLights</li>
<li>Machining</li>
<li>IEDs</li>
<li>IEDIncendiary</li>
<li>Mortars</li>
<li>Gunsmithing</li>
<li>BlowbackOperation</li>
<li>GasOperation</li>
<li>PrecisionRifling</li>
<li>SmokepopBelt</li>
<li>MicroelectronicsBasics</li>
<li>TubeTelevision</li>
<li>GunTurrets</li>
<li>Firefoam</li>
<li>MoisturePump</li>
<li>GeothermalPower</li>
<li>TransportPod</li>
<li>MedicineProduction</li>
<li>MultiAnalyzer</li>
<li>LongRangeMineralScanner</li>
<li>GroundPenetratingScanner</li>
<li>DeepDrilling</li>
<li>VitalsMonitor</li>
<li>ComponentAssembly</li>
<li>MultibarrelWeapons</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>2</researchViewX>
Expand All @@ -111,16 +59,7 @@
<li>NeolithicBlueprint</li>
<li>MedievalBlueprint</li>
<li>IndustrialBlueprint</li>
<li>Cryptosleep</li>
<li>PoweredArmor</li>
<li>ShieldBelt</li>
<li>ChargedShot</li>
<li>ShipBasics</li>
<li>ShipCryptosleep</li>
<li>ShipReactor</li>
<li>ShipEngine</li>
<li>ShipComputerCore</li>
<li>ShipSensorCluster</li>
<!-- Autofilled from code-->
</prerequisites>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>3</researchViewX>
Expand Down

0 comments on commit 9cce293

Please sign in to comment.