[NFP] Adding strategic resource and power-plant

Mulle_Meck

Chieftain
Joined
Jul 27, 2021
Messages
2
I am new to modding so I might have bitten off more than I can chew, but you never learn without adversity and persistency so here it goes. I am making a new civ and wanted to add a powerplant as their UI. The idea was that their UU would generate a unique strategic resource that the powerplant then would use.
I figured that to generate a resource from a unit you would simply put the resource upkeep as a negative so that isn't what's stopping me (although that assumption might be wrong), but I haven't found anyone talking about implementing new strategics or powerplants, and the code dictating their behaviour is scattered across a lot of different files so understanding how the official ones work is quite hard. Any pointers would be of great help because I've been scratching my head trying to figure this out for over a week.
 
For the File that contains the strategic Resources, you could check Resources.xml in the base game folder. For the Power Plant, you could find it at Expansion2_Buildings.xml at the Expansion 2 Data Folder. Hope this helps. I will give you a better direction once i found out myself.
 
So on the resource front it'd look something like:

INSERT INTO Types
(Type, Kind )
VALUES ('RESOURCE_MY_RESOURCE', 'KIND_RESOURCE' );
INSERT INTO Resources
(Row Frequency, ResourceClassType , Name , ResourceType , RevealedEra, PrereqTech )
VALUES ('0' , 'RESOURCECLASS_STRATEGIC , LOC_RESOURCE_MY_RESOURCE_NAME , RESOURCE_MY_RESOURCE , '7' , TECH_NUCLEAR_FISSION')

I have also looked into the Expansion2 resources.xml and there it seems to add more things on top of the already existing parameters, but I don't quite understand how these are defined at the same time as the vanilla parameters.
 
Back
Top Bottom