Modding Strategic Resources

Discussion in 'Civ5 - Creation & Customization' started by Kasdar, May 29, 2011.

  1. Kasdar

    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>
    
     
  2. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    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.
     
  3. Kasdar

    Kasdar Warlord

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    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?
     
  4. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    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.)
     
  5. Kasdar

    Kasdar Warlord

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    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
     
  6. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    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).
     
  7. Kasdar

    Kasdar Warlord

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    Hmm I seem not to have the import into VFS option

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

    Attached Files:

  8. Kasdar

    Kasdar Warlord

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    edit: ammended last post sorry for extra post
     
  9. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    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.
     
  10. Kasdar

    Kasdar Warlord

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    Thank you, updating the sdk worked, now I have the option you mentioned.
     

Share This Page