I used this tutorial to learn how to add new resources to the game. Worked like a charm upto the latest patch and or G&K.
Since I installed these and used the new AssignStartingPlots.lua from the expansion I can not get it too work as intended, get a runtime error pointing to a part of the file I have not changed.
)Code:[24457.961] Runtime Error: [string "C:\Users\Asus\Documents\My Games\Sid Meier'..."]:7535: attempt to perform arithmetic on field '?' (a nil value) stack traceback: [string "C:\Users\Asus\Documents\My Games\Sid Meier'..."]:7535: in function 'ProcessResourceList' [string "C:\Users\Asus\Documents\My Games\Sid Meier'..."]:9802: in function 'PlaceStrategicAndBonusResources' [string "C:\Users\Asus\Documents\My Games\Sid Meier'..."]:9983: in function 'PlaceResourcesAndCityStates' [string "Assets\Maps\Continents.lua"]:321: in function 'StartPlotSystem' [string "Assets\DLC\Expansion\Gameplay\Lua\MapGenera..."]:815: in function <[string "Assets\DLC\Expansion\Gameplay\Lua\MapGenera..."]:779> [C]: ? [24472.235] CivilopediaScreen: SetSelectedCategory(12
I am at a brickwall regarding this, I have tried different values in the AssignStartingPlots.lua on these 4 lines:
Code:amounts_of_resources_placed = table.fill(0, 54), -- Stores amounts of each resource ID placed. WARNING: This table uses adjusted resource ID (+1) to account for Lua indexing. Add 1 to all IDs to index this table. luxury_assignment_count = table.fill(0, 54), -- Stores amount of each luxury type assigned to regions. WARNING: current implementation will crash if a Luxury is attached to resource ID 0 (default = iron), because this table uses unadjusted resource ID as table index. luxury_low_fert_compensation = table.fill(0, 54), -- Stores number of times each resource ID had extras handed out at civ starts. WARNING: Indexed by resource ID. region_low_fert_compensation = table.fill(0, 27); -- Stores number of luxury compensation each region received
Going from the tutorial and comparing his AssignStartingPlots.lua with the original he increased these values by 1 for the copper resource added so I increased this by 1 for each resource I added(9 in total), now back when I was learning this I kinda remember that if I forgot to add a +1 to these it threw this kind of error at me. But now with the expansion, get this error regardless of what I try.
I'll include the AssignStartingPlots.lua I have modded so ya can have alook see. If ya want the XML's just say and i'll post them too.
Its loads and places resources, even the new ones, marsh shows up as black tiles otherwise I might well have missed it
You can access my modded file here on the OP since I cant posed attachments here .