tu_79
Deity
Settings?I attempted to do this and my lightly modded Oval generated a map with no Strategics at all. Was working fine with the unmodded patch previous to this.
Settings?I attempted to do this and my lightly modded Oval generated a map with no Strategics at all. Was working fine with the unmodded patch previous to this.
I had the same thing, also on Oval. Standard size and settings.I attempted to do this and my lightly modded Oval generated a map with no Strategics at all. Was working fine with the unmodded patch previous to this.
Settings?
Here you have all the changes agreed, except for the extra trees around capitals. @azum4roll, do you want to try?
Replace the file in MODS/(6x) Community Balance Overhaul -Compatibility files/LUA.
Edit. I've modified how major deposit works. Now if it is set to be 4 horses, it will produce randomly 2, 3 or 4 horses per deposit.
Edit 2. Forgot to reduce stones on hills. Fixed!
I downloaded and tried it, also got the marsh like tundra. Perhaps I didn't follow the instructions correctly? What needs to be done?Marsh looking like tundra means the code hasn't been properly executed (some error occurred). You can check Lua.log for details.
Alternatively, try my version![]()
Extract directly into the 6a folder (it's correct if it asks you whether to replace), then preferably delete cache and restart the game. I tested on Continents, so if some other map doesn't work please upload the Lua.log here.I downloaded and tried it, also got the marsh like tundra. Perhaps I didn't follow the instructions correctly? What needs to be done?
I think this is related to texture sets. Every large continent is set to a set of textures: asian, african, american, ... I noticed that one of these textures misses some sprites.I'm testing this at the moment, and I noticed an odd visual bug. The marsh feature has the appearance of tundra lol.
Spoiler :Spoiler :
Edit: I'm noticing some other things, but unsure if it's from this or something else (I also just installed the 9/8 hotfix and am using the Really Advanced Setup mod at the moment). The colouration of the terrain features looks a little different to usual. Also, there are no ancient ruins turning up so far (although I don't have the 'no ancient ruins' box ticked in the map settings).
Documents\My Games\Sid Meier's Civilization 5\cacheHow/where do I delete the cache?![]()
Holy shirt!FeatureGenerator was modified to make each jungle plot have 25% chance to be grassland.
I know why the @tu_79 script doesn't work. math.round isn't a thing in Lua.
-- added by azum4roll: give some variance to strategic amounts
local rand = Map.Rand(10000, "ProcessResourceList - Lua") / 10000
quantity = math.max(1, math.floor(0.5 + quantity * (1 - 0.5 * rand)))
resources_to_place = {
{self.horse_ID, math.ceil(horse_amt * 0.7), 100, 2, 3}
};
self:ProcessResourceList(40 * resMultiplier, 1, self.desert_wheat_list, resources_to_place);
self:ProcessResourceList(70 * resMultiplier, 1, self.tundra_flat_no_feature, resources_to_place);
if self.strategicData[plotIndex] == 0 then
local x = (plotIndex - 1) % iW;
local y = (plotIndex - x - 1) / iW;
local res_plot = Map.GetPlot(x, y)
if res_plot:GetResourceType(-1) == -1 then -- Placing this strategic resource in this plot.
local res_addition = 0;
if res_range[use_this_res_index] ~= -1 then
res_addition = Map.Rand(res_range[use_this_res_index], "Resource Radius - Place Resource LUA");
end
local quantity = res_quantity[use_this_res_index]
-- added by azum4roll: give some variance to strategic amounts
local rand = Map.Rand(10000, "ProcessResourceList - Lua") / 10000
quantity = math.max(1, math.floor(quantity * (1 - 0.5 * rand)))
res_plot:SetResourceType(res_ID[use_this_res_index], quantity);
if (Game.GetResourceUsageType(res_ID[use_this_res_index]) == ResourceUsageTypes.RESOURCEUSAGE_LUXURY) then
self.totalLuxPlacedSoFar = self.totalLuxPlacedSoFar + 1;
end
self:PlaceResourceImpact(x, y, impact_table_number, res_min[use_this_res_index] + res_addition);
placed_this_res = true;
self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] = self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] + res_quantity[use_this_res_index];
end
end
-- added by azum4roll: give some variance to strategic amounts
local rand = Map.Rand(99, "ProcessResourceList - Lua") / 100
local quantity = res_quantity[use_this_res_index]
quantity = math.max(1, math.floor(1 + 0.5 * quantity * (1 + rand))) --tu_79 fix
res_plot:SetResourceType(res_ID[use_this_res_index], quantity);
if (Game.GetResourceUsageType(res_ID[use_this_res_index]) == ResourceUsageTypes.RESOURCEUSAGE_LUXURY) then
self.totalLuxPlacedSoFar = self.totalLuxPlacedSoFar + 1;
end
self:PlaceResourceImpact(x, y, impact_table_number, res_min[use_this_res_index] + res_addition);
placed_this_res = true;
self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] = self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] + quantity; -- tu_79 fix
You have to overwrite the modinfo file too so the game reads the new FeatureGenerator.Also, I didn't see any grassland jungle unfortunately?
Not that I know of, and I'd rather not CTD for a mapscript failure. It's obvious anyway with those marshes.Is there a way to prevent the game from starting in case the map script don't reach the end?
I intended for tundra/desert major horses to range 2-4 (normal ones are 3-5). Minor horses stay 2.EDIT.
Also, I think it would have more variability by having the amount of the deposits be chosen randomly between max amount and half this value. Would you try this?
Edit 2.Code:-- added by azum4roll: give some variance to strategic amounts local rand = Map.Rand(10000, "ProcessResourceList - Lua") / 10000 quantity = math.max(1, math.floor(0.5 + quantity * (1 - 0.5 * rand)))
I'm testing this formula now, and it gives horses in amounts from 2 to 5. Maybe the deposits of 2 horses come from the minor deposits, so the general generator is producing deposits from 3 to 5 units.The formula does not give proper results.Maybe
"quantity = math.max(1, math.floor(quantity * (1 - 0.5 * rand)))"
Consider also changing the max value for horses generated in tundra and desert, I'm sure it is not working as intended:
Right now the max amount for horses is 4. Horses in tundra are Ceil(4*0.7) = 3.Code:resources_to_place = { {self.horse_ID, math.ceil(horse_amt * 0.7), 100, 2, 3} }; self:ProcessResourceList(40 * resMultiplier, 1, self.desert_wheat_list, resources_to_place); self:ProcessResourceList(70 * resMultiplier, 1, self.tundra_flat_no_feature, resources_to_place);
I think it should be Floor(4*0.5) = 2, with a minimum of 1.
meaning: math.max(1, math.floor(horse_amt * 0.5))
Oops. That only affects the logged value though. Uploaded the fix.EDIT 3. Here's something I don't get. Check this.
The original code creates a resource with "res_quantity[use_this_res_index]" as the strategic amount in the deposit. It then discounts this same value from the amount of resources placed. But since you added a new variable "quantity", the amount actually placed and the amount the the script thinks it has been placed don't match, do they?Code:if self.strategicData[plotIndex] == 0 then local x = (plotIndex - 1) % iW; local y = (plotIndex - x - 1) / iW; local res_plot = Map.GetPlot(x, y) if res_plot:GetResourceType(-1) == -1 then -- Placing this strategic resource in this plot. local res_addition = 0; if res_range[use_this_res_index] ~= -1 then res_addition = Map.Rand(res_range[use_this_res_index], "Resource Radius - Place Resource LUA"); end local quantity = res_quantity[use_this_res_index] -- added by azum4roll: give some variance to strategic amounts local rand = Map.Rand(10000, "ProcessResourceList - Lua") / 10000 quantity = math.max(1, math.floor(quantity * (1 - 0.5 * rand))) res_plot:SetResourceType(res_ID[use_this_res_index], quantity); if (Game.GetResourceUsageType(res_ID[use_this_res_index]) == ResourceUsageTypes.RESOURCEUSAGE_LUXURY) then self.totalLuxPlacedSoFar = self.totalLuxPlacedSoFar + 1; end self:PlaceResourceImpact(x, y, impact_table_number, res_min[use_this_res_index] + res_addition); placed_this_res = true; self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] = self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] + res_quantity[use_this_res_index]; end end
Not sure. It works better when deposit sizes are big, since you are discounting a percentage. And you are giving a 20% chance to have something bigger, 20% for something smaller, 60% for the stated max value.80%-120% variance is more natural than a 50%-100% one, don't you think?