Adding Strategic Resources - Help Needed

Jennar

Chieftain
Joined
Nov 25, 2008
Messages
55
I'm trying to add food types to strategic resources and am running into some issues. I've found out where the quantity produced per tile is located but I can't seem to get it to implement. Was curious if anyone else had better luck with this type of modding or if some the veterans already know where to look. Thanks in advance.
 
Resources aren't implemented in XML anymore (regardless of what the XML file includes).

I direct your attention to the file AssignStartingPlots.lua instead. ;)

Good luck, I'm struggling with adding a new strategic resource myself. At present, can't define a FONT_ICON for new resources so you have to pick an existing one.
 
Ahh if even Dale struggles with this it's no wonder why I totally failed. :D I tried to make all luxuary and food resources to strategic resources instead. For every grain you can build one bakery, jewel stores turns gems into happiness and so on. Would have been fancy if it would have worked. :D
 
If you want, I've got a beta of Hardwood strategic resource on the hub. Take a look at what I've done to get it working and to help your effort. :)

I would suggest using something like WinMerge to compare the default AssignStartingPlots.lua and my AssignStartingPlots.lua file to find where I've changed things.
 
I went through your mod and the LUA file. All I can see in that LUA is that you are defining how to set up the map in the game. You'r XML files for the resource don't differ from mine. So I must be missing something in that LUA that defines the resource as strategic for the game. Is it perhaps the list and amt values? Getting this working is gonna be 90% of my mod. lol.
 
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic". ;)
 
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic". ;)

Must it be a unit? If a building requires a "bonus" resource will that do as well?
 
Here's a tip:

In the game it will show as a "bonus" resource until you make a unit require it. Then it becomes "strategic". ;)

:head desk:

And here I was looking for something far more complicated.
 
I havent had a chance to play around with the SDK, but had question for Dale.

Say you assign Cotton as a requirement for a Naval unit, or Ivory for Elephant units.
Does the game treat Cotton/Ivory as a Strategic or Luxury resource? or both?

Converting a luxury to a strategic is not as simple. Here's where a couple of the XML tags for resources are actually used. You need to change the resource type (I think it says RESOURCE_LUXURY, don't have the files in front of me) and then define the XML to tell the engine how many units of the resource to plant. Then modify AssignStartingPlots.lua to plant the resource as a strategic not a luxury.
 
Alright running into more issues with this. Using Dale's mod as a road map I've come across a bunch of stuff. The plating of luxury resources, strategic resources, bonus resources and fish are completely different (yes, fish has it's own category of placement, weird). There is no place that I have found where you can simply tell the game to place a number of resources instead of just the resource. You would almost have to remove all references to the old resource from the LUA and recode it. This is horribly inefficient and unnecessarily cumbersome. Second the way it is handled makes all resource based mods unnmodular. This has to do with the fact that each mod would need it's own version of the AssignStartingPlots.LUA file that would be exclusive to the mod. Unlike XML modding where you update the database resources, because of the way they are handled, do not update and instead need specific LUA coding to get them to work.

Adding and removing resources was infinitely easier in CIV4 then it is now in CIV5, The first definitive step backwards in modding capability that I've seen in this iteration.

I'm sure there has to be a better way to do this then hard coding the LUA every time you add a resource. The frustration level for me has hit a critical mass, so I'm done for the night, perhaps tomorrow will shed light on how to do this easier.
 
Let me just say that when I found out resources were hardcoded in that lua file.....

I screamed for a month! ;)
 
Back
Top Bottom