Modding Strategic Resources

Kasdar

Warlord
Joined
Jul 29, 2006
Messages
268
Location
Minnesota
I am wondering if the following code would do what I think it should. by changing all iron deposits to have either 1 or 4 iron in them instead of 2 or 6

Code:
	<Update>
		<Where ResourceType="RESOURCE_IRON" Quantity="6"/>
		<!-- The quantity for major iron deposits -->
		<Set Value="4"/>
		<!-- "6" -->
	</Update>
	<Update>
		<Where ResourceType="RESOURCE_IRON" Quantity="2"/>
		<!-- The quantity for minor iron deposits -->
		<Set Value="1"/>
		<!-- "2" -->
	</Update>
 
Those XML stubs do nothing, they're a remnant from Civ4. If you want to edit the quantities of strategic resources, you have to replace the game's existing copy of AssignStartingPlots.lua with your own version. Specifically, there are three subroutines within that gigantic file relating to quantity (one for large deposits, one for smalls, and a special one for ocean-based Oil).

Map scripts can override these specific routines without editing the rest of the file, but mods have to replace the whole thing at once.
 
aw thats to bad, wish they wouldnt have left stuff like that in there to confuse us novice modders.

edit: ok so lets say I made modifications to the AssignStartingPlots.lua how do I get my mod to load the new version?
 
edit: ok so lets say I made modifications to the AssignStartingPlots.lua how do I get my mod to load the new version?

For any art assets or variations of existing Lua or non-GameData XML, you just need to set the "Import into VFS" value in the file's Properties to "True". It'll then automatically replace the stock version with your own when you load the mod. You do NOT do the OnModActivated or InGameUIAddin setups that you use for user-made XML/Lua.

Note that changes to these routines will be incompatible with certain map scripts (Highlands, Great Plains, Lakes, or any pre-made Earth maps), because for whatever stupid reason, the devs chose to have maps override mods instead of the other way around, and these are the maps that use their own versions of the resource quantities. (As a result, these are also incompatible with mods like mine that add new resources.)
 
I am sorry I dont quite understand this, where do I find the "Import into VFS" value? I looked in the file properties but only see the options

Advanced: Build Action
Custom Tool
Custom Tool NameSpace

Misc: Filename
Full Path
 
Open the mod in ModBuddy. Right-click on the XML/Lua/whatever file's name, in the list window on the right-hand side. At the bottom will be "Properties". Click that. It'll open a new small window with three fields (File name, Full path, and Import into VFS).
 
Hmm I seem not to have the import into VFS option

Edit:unless I am missing something, ss posted for confirmation.
 

Attachments

  • Properties.jpg
    Properties.jpg
    62.2 KB · Views: 66
edit: ammended last post sorry for extra post
 
It looks like your SDK might be out of date; the VFS option was added in December, in the Misc block, so if you haven't updated it since then you won't have the option. Go into Steam, right-click on your SDK and make sure the updates are set to happen automatically.

Also, apparently the MacOS version of the SDK doesn't have it, from what some people have said. But it looks like you have a Windows version, so it SHOULD be there.
 
Thank you, updating the sdk worked, now I have the option you mentioned.
 
Back
Top Bottom