cf_nz
Prince
Excellent. Nice work.
Hi,
A was trying to use this mod component to build a small minimod for myself, however, I am having trouble with it and was hoping you could help me. I am trying to add a new strategic resource to the game. The new resource appears correctly in the tech tree and in the strategic resources bar. However, it isn't added to the map.
In the FireTuner I have the following error messages after the GenericPopup: Loaded Popup messages:
Runtime Error: [string "C:\Users\Me\Documents\My Games\Sid..."]:9: attempt to call global 'OnMapResourceGenerator' (a nil value)
Runtime Error: Error loading C:\Users\Me\Documents\My Games\Sid Meier's Civilization 5\MODS\Mods\Brick by Brick (v 1)\LUA\AddNewResource.lua.
It seems to be connected that the include("ResGenerator.lua"); isn't properly included, sadly I am not any good at any LUA scripting, so I am asking here for help.
Any thoughts on this error message and how to avoid it?
Many thanks in advance!
Try setting "Import Into VFS" to True for each lua file (in Modbuddy Right click on the lua file and select properties).
Can't seem to get it to work. I have tried everything I can in the resource file, but nothing changes.
When I get in the game, my Cocoa resource uses the Marble Icon and has invisible art. Sometimes in firetuner I can see: "Map Script: Failed to place 2 units of Marble."
Not sure what the fixation on Marble is. I can change the resource to a modern or rush resource, remove all aspects of luxury from Cocoa, and it is always the same. It uses Marble whether I try a new icon, or use info for Spices.
I am sure it will work as in Chocolate example in my first post.
Try these:
- For your Art files always save as DDS DTX3 or DTX5.
- Set "Import into VFS" to true to all Art files
- Set "Import into VFS" to true to all Lua files
- Enable "Reload Landmark System" in mod properties
- Sometimes resetting the game makes things work
if nothing work then post your mod file here so that I check it (Isolate the Cocoa Resource files in your mod into a new mod then post it here).
First, is that the MaxLattitude doesn't seem to limit how north the resources wander. Having Coffee grow on Snowy hills near the poles is a little off.
So my main request involves the ability to set disables for specific terrain/feature types. Such as no snow/desert, or no forests, etc.
Could you make an advanced setup option that would allow players to tweak the quantity of resources placed? Preferably ~5 settings, ranging from sparse to abundant.
-- Now multiply quantity with modifiers
iQuantity = iQuantity * option_modifier *NumCivs_modifier;
iQuantity = [COLOR="Red"][B]1.5 * [/B][/COLOR]iQuantity * option_modifier *NumCivs_modifier;
I didnt include max latitude in the algorithm.. this will be a good addition to next vesrion.
that depends of your settings on TerrainBooleans and FeatureBooleans, if you dont put desert in TerrainBooleans you will not get a resource on desert.
If you are talking about combination like for example Terrain Grass but no forest, then this needs extra work.. I will consider adding this to next version because I need this option myself![]()
There is an easy way to modify this in lua, edit ResGenerator.lua and go to the following lines:
Code:-- Now multiply quantity with modifiers iQuantity = iQuantity * option_modifier *NumCivs_modifier;
Now add your modifier to Quantity, like for example:
Code:iQuantity = [COLOR="Red"][B]1.5 * [/B][/COLOR]iQuantity * option_modifier *NumCivs_modifier;
So the 1.5 would multiply the values I have set in the generator by 1.5? And I would duplicate those 2 blocks of code for each option with a different modifier? Or just duplicate the last block?
I want a new option in advanced setup that lets you choose from several different modifiers, such as .5, 1, 1.5, 2, etc.
if New_Resource_Class == "RESOURCECLASS_LUXURY" then
if resource_option == 1 then option_modifier = 0.75;
elseif resource_option == 2 then option_modifier = 1;
elseif resource_option == 3 then option_modifier = 1.2;
elseif resource_option == 4 then option_modifier = 1.1;
elseif resource_option == 5 then option_modifier = 1;
end
elseif New_Resource_Class == "RESOURCECLASS_RUSH" or New_Resource_Class == "RESOURCECLASS_MODERN" then
if resource_option == 1 then option_modifier = 0.75;
elseif resource_option == 2 then option_modifier = 1;
elseif resource_option == 3 then option_modifier = 1.5;
elseif resource_option == 4 then option_modifier = 1;
elseif resource_option == 5 then option_modifier = 1.2;
end
elseif New_Resource_Class == "RESOURCECLASS_BONUS" then
if resource_option == 1 then option_modifier = 0.75;
elseif resource_option == 2 then option_modifier = 1;
elseif resource_option == 3 then option_modifier = 1.2;
elseif resource_option == 4 then option_modifier = 1.1;
elseif resource_option == 5 then option_modifier = 1;
end
end
OptionName OptionID
Sparse 1
Standard 2
Abundant 3
Legendary Start 4
Strategic Balance 5
Random 6
if New_Resource_Class == "RESOURCECLASS_LUXURY" then
if resource_option == 1 then option_modifier = 0.75;
elseif resource_option == 2 then option_modifier = 1;
elseif resource_option == 3 then option_modifier = 1.2;
elseif resource_option == 4 then option_modifier = 1.1;
elseif resource_option == 5 then option_modifier = 1;
I think this need a bit more explanation from me:
the code here :
Code:if New_Resource_Class == "RESOURCECLASS_LUXURY" then if resource_option == 1 then option_modifier = 0.75; elseif resource_option == 2 then option_modifier = 1; elseif resource_option == 3 then option_modifier = 1.2; elseif resource_option == 4 then option_modifier = 1.1; elseif resource_option == 5 then option_modifier = 1;
This translates into:
Luxury Resouce => resource_option = 1 (Sparse) => Modifier = 0.75
Luxury Resouce => resource_option = 2 (Standard) => Modifier = 1
......
and so on.
note that these modifiers are only for new added resources and changing them will not affect Vanilla resources.