AssignStartingPlots.lua question

DazL

Chieftain
Joined
May 11, 2006
Messages
41
Im trying to add 1 custom resource and can't figure out where I go wrong exactly.

Initially I just downloaded the More Luxuries mod to see what was exactly changed. It didnt look to complicated.
To see if my resource xml (cannabis) and its icons/art was working correctly, I just replaced one resource in this mod with my resource and adjusted the AssignStartingPlots.lua accordingly (replaced tea with cannabis all over).

Everything worked fine. Resource spawned and icons were showing correctly too.

But what I would really want is to start the mod from scratch, so I took the AssingStartingPlots.lua from the BNW expansion and added 1 resource.

After that I keep getting this error;

Code:
Map Script: Placing Resources and City States.
 Map Script: Map Generation - Assigning Luxury Resource Distribution
 Map Script: -
 Map Script: Region#	13	 of type 	1	 has been assigned Luxury ID#	21
 Map Script: -
 Map Script: Region#	2	 of type 	1	 has been assigned Luxury ID#	16
 Runtime Error: C:\Users\DazL\Documents\My Games\Sid Meier's Civilization 5\MODS\DazL's Mod (v 1)\Core\Lua\AssignStartingPlots.lua:7784: attempt to compare nil with number
stack traceback:
	C:\Users\DazL\Documents\My Games\Sid Meier's Civilization 5\MODS\DazL's Mod (v 1)\Core\Lua\AssignStartingPlots.lua:7784: in function 'AssignLuxuryToRegion'
	C:\Users\DazL\Documents\My Games\Sid Meier's Civilization 5\MODS\DazL's Mod (v 1)\Core\Lua\AssignStartingPlots.lua:7950: in function 'AssignLuxuryRoles'
	C:\Users\DazL\Documents\My Games\Sid Meier's Civilization 5\MODS\DazL's Mod (v 1)\Core\Lua\AssignStartingPlots.lua:9926: in function 'PlaceResourcesAndCityStates'
	Assets\Maps\Pangaea.lua:446: in function 'StartPlotSystem'
	Assets\DLC\Expansion2\Gameplay\Lua\MapGenerator.lua:815: in function <Assets\DLC\Expansion2\Gameplay\Lua\MapGenerator.lua:779>
	=[C]: ?

I thought the solution might be in these lines;

Code:
		amounts_of_resources_placed = table.fill(0, 45), -- 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, 45), -- 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, 45), -- 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, 22); -- Stores number of luxury compensation each region received

I tried increasing the 45, but that didn't resolve the issue.

I attached the AssignStartingPlots.lua I'm trying to use (renamed to .txt). Anybody can point me in the right direction? Thanks a ton in advance =)
 

Attachments

I'm sorry... I should have noticed the lua sub-section of this forum...
 
Back
Top Bottom