Oddity with Iron/horses?

Slowpoke

The Mad Modder
Joined
Sep 30, 2010
Messages
1,321
Under resource type quanity, it has two listings for iron and horses, but only one for everything else. Iron has 6 and 2, horses 4 and 2. Does anyone know why this is, and how to change only the one that is used (or both if they means different things).
 
Looking at how resources get scattered during map generation, it appears that those records are disregarded anyway. The actual values are hardcoded in Lua.
 
Looking at how resources get scattered during map generation, it appears that those records are disregarded anyway. The actual values are hardcoded in Lua.

These aren't the values for how many are on the map, these are how many iron/horse points you get for making an iron mine/pasture.
 
These aren't the values for how many are on the map, these are how many iron/horse points you get for making an iron mine/pasture.
Yeah, the Lua gets that from hardcoded values as well. I've been looking into it in some depth... don't know if the XML values are used as well.

The LUA uses a couple of different versions of the values in a few places. Notably, for the "light" versions of strategic resources used for start location balancing.
 
Yeah, the Lua gets that from hardcoded values as well. I've been looking into it in some depth... don't know if the XML values are used as well.

The LUA uses a couple of different versions of the values in a few places. Notably, for the "light" versions of strategic resources used for start location balancing.

Ah I see what you mean. My first city got me 2 iron, the second iron got me 6. This is frustrating, though, as I can't seem to change the XML values, and I just started modding so I don't know LUA yet :/ Guess I'll have to learn.
 
Ah I see what you mean. My first city got me 2 iron, the second iron got me 6. This is frustrating, though, as I can't seem to change the XML values, and I just started modding so I don't know LUA yet :/ Guess I'll have to learn.
I'm looking at making a more mod-friendly version of that bit of LUA...
 
As I understand, the values in XML are not used.
You'll have to look in "AssignStartingPlots.lua". The functions "GetMajorStrategicResourceQuantityValues()" and "GetSmallStrategicResourceQuantityValues()".
 
I don't even know how to open a lua page at the moment :/ Ah nvmm opening with notepad works. God that thing is huge O.O Alright found what I need to change, now I just have to read the manual to figure out how to change it via modbuddy :)

Edit: Hrm, if I'm reading the pdf correctly (probably not), I need to copypaste the entire AssignStartingPlots.lua into a lua file, and just change these values?

local uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 4, 4, 4, 6, 7, 8;
if self.resource_setting == 1 then -- Sparse
uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 2, 4, 4, 4, 5, 5;
elseif self.resource_setting == 3 then -- Abundant
uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 4, 6, 6, 9, 10, 10;
return uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt

EDIT: Awesome, it worked!
 
I don't even know how to open a lua page at the moment :/ Ah nvmm opening with notepad works. God that thing is huge O.O Alright found what I need to change, now I just have to read the manual to figure out how to change it via modbuddy :)

Edit: Hrm, if I'm reading the pdf correctly (probably not), I need to copypaste the entire AssignStartingPlots.lua into a lua file, and just change these values?

local uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 4, 4, 4, 6, 7, 8;
if self.resource_setting == 1 then -- Sparse
uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 2, 4, 4, 4, 5, 5;
elseif self.resource_setting == 3 then -- Abundant
uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt = 4, 6, 6, 9, 10, 10;
return uran_amt, horse_amt, oil_amt, iron_amt, coal_amt, alum_amt

EDIT: Awesome, it worked!


Thanks for updating us. This is good to know it worked for you.

Also, what PDF are you referring to? Kael's guide?
 
Yup, it had a basic lua example, although I felt that was the least covered part of the guide :/
 
Back
Top Bottom