1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Easy way to add more natural wonders?

Discussion in 'Civ5 - Creation & Customization' started by NaturalWonder, Jul 14, 2012.

  1. NaturalWonder

    NaturalWonder Chieftain

    Joined:
    Jul 14, 2012
    Messages:
    10
    Hey guys, I'm a huge Civ fan and have been really enjoying Civ5 lately. Anyway, I really like natural wonders and was wondering if there is a simple way to mod a map (say the archipelago map or continents map) to spawn more natural wonders. It seems like a "normal" sized map always produces 5, but I think it would be cool to have 10 or something.

    I'm new to the forum, so if there is a thread where this has already been done feel free to redirect me there.

    If it's important I'm using a Mac, play Civ5 through Steam and have all the DLC including the God/Kings expansion.

    Thanks!
     
  2. Pouakai

    Pouakai It belongs in a museum. Moderator

    Joined:
    Jun 16, 2010
    Messages:
    7,120
    Location:
    Aotearoa
    I would presume it would be possible to add more natural wonders on a proper map (Like the Earth map, it's not actually a script) through WorldBuilder, but I'm not sure about the map scripts
     
  3. NaturalWonder

    NaturalWonder Chieftain

    Joined:
    Jul 14, 2012
    Messages:
    10
    Let me see if I get what you are saying. So through Worldbuilder I could manually add more wonders onto a map? But this wouldn't allow me to randomly generate a map with more natural wonders? Thanks for your help in any case.

    Also it seems as though I can't download Worldbuilder at the moment. Perhaps because Steam is too busy.
     
  4. Pouakai

    Pouakai It belongs in a museum. Moderator

    Joined:
    Jun 16, 2010
    Messages:
    7,120
    Location:
    Aotearoa
    You can randomly generate maps in worldbuilder, but you would have to manually add the extra wonders in and you would know where everything is
     
  5. NaturalWonder

    NaturalWonder Chieftain

    Joined:
    Jul 14, 2012
    Messages:
    10
    Ah OK, that's what I thought you meant. Obviously I'd rather have the wonders scattered randomly, but that is pretty good too. Thanks!

    If anyone can give me some advice on a script I can use let me know.
     
  6. NaturalWonder

    NaturalWonder Chieftain

    Joined:
    Jul 14, 2012
    Messages:
    10
    In case anyone is wondering, I'm making progress. I'm sure most modders know this stuff already, but here is where I am:

    1) User > Library > Application Support > Steam > SteamApps > common > Civ 5

    2) Right Click the Civ5 Gods/Kind Application and choose "show package contents"

    3) Contents > Home > assets > DLC > Expansion > Gameplay

    Under XML you can open Terrain then CIV5Features to view a list of tiles, including the 15 Natural Wonders.

    Lua seems to have the scripts I want to change though. From looking at the map files they are calling the script AssignStatingPlots.lua, so open that up. Right now I'm browsing that and trying to find where it assigns the number of natural wonders for a map. Hopefully I can change a single number and be done :)

    Edit: Found this part in AssignStatingPlots.lua

    -- Determine how many NWs to attempt to place. Target is regulated per map size.
    -- The final number cannot exceed the number the map has locations to support.
    local worldsizes = {
    [GameInfo.Worlds.WORLDSIZE_DUEL.ID] = 2,
    [GameInfo.Worlds.WORLDSIZE_TINY.ID] = 3,
    [GameInfo.Worlds.WORLDSIZE_SMALL.ID] = 4,
    [GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = 5,
    [GameInfo.Worlds.WORLDSIZE_LARGE.ID] = 6,
    [GameInfo.Worlds.WORLDSIZE_HUGE.ID] = 7
    }
    local target_number = worldsizes[Map.GetWorldSize()];
    local iNumNWtoPlace = math.min(target_number, iNumNWCandidates);
    local selected_NWs, fallback_NWs = {}, {};
    for loop, NW in ipairs(NW_eligibility_order) do
    if loop <= iNumNWtoPlace then
    table.insert(selected_NWs, NW);
    else
    table.insert(fallback_NWs, NW);
    end
    end

    So it seems like all I need to do is change this part. The first thing I will try is to replace the worldsizes with bigger numbers.
     
  7. Pouakai

    Pouakai It belongs in a museum. Moderator

    Joined:
    Jun 16, 2010
    Messages:
    7,120
    Location:
    Aotearoa
    Awesome that you found that. I'm not sure how the lua tables are updated, as I've got very little knowledge in that. But I would presume updating that section there through a mod (Not in base game, very dangerous) would change the ammount of natural wonders to be placed.
     
  8. NaturalWonder

    NaturalWonder Chieftain

    Joined:
    Jul 14, 2012
    Messages:
    10
    Hahaha, I just went ahead and edited it for the base game (I had created a backup file, so I assumed worst comes to worst it would be OK) and it worked!

    I started a game on a Standard size Pangaea map and my starting warrior found the Grand Mesa in like 5 turns and the game said there were 11 more Natural Wonders still to find!
     
  9. Barathor

    Barathor Chieftain

    Joined:
    May 7, 2011
    Messages:
    1,199
    Yes, the LUA function is what you want to change. There's also an XML value in Civ5Worlds.xml, but that doesn't seem to be used or have any effect.

    Either edit AssignStartingPlots.lua itself and make the changes to: function AssignStartingPlots:placeNaturalWonders()

    (This will affect all your maps when using this mod.)

    or

    Copy function AssignStartingPlots:placeNaturalWonders() into a LUA map script (such as a custom one you've created or one you use most often) and make the changes there.

    (This will affect only that map script and others will be unaffected)

    I'm not very experienced with LUA, so I don't know if there's a slicker way to do it. Some functions you don't even need to copy over to the map script and you can just change a list of variables and send them over as "args" when you call the function. But, as far as I know, this one doesn't look like you can do that.
     
  10. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    7,996
    Location:
    Near Portsmouth, UK
    It's hard coded; there's even a comment that says it should be moved out into XML! Looks like a job half-complete ;)
     
  11. GerrardCapashen

    GerrardCapashen Benalish Master-at-Arms

    Joined:
    Dec 7, 2002
    Messages:
    1,416
    Location:
    Texas, U.S.A.
    Thread necro!

    I tried doing this, and I never get more than 8 even when I have the max set to 14. Is there something else I have to modify?
     
  12. Danmacsch

    Danmacsch Geheimekabinetsminister

    Joined:
    Jan 14, 2014
    Messages:
    1,273
    Location:
    Copenhagen, Denmark
    I would also like to know this. Can't really find any new info confirming that it can/can't be done.
     
  13. kaspergm

    kaspergm Chieftain

    Joined:
    Aug 19, 2012
    Messages:
    3,694
    No, modifying AssignStartingPlots.lua should be the only change necessary - I say that with some confidence because I've done this change myself, and it works as intended. I suppose some hiccups may arise if you try to place a very large number of natural wonders on a very small map, simply because there will not be enough elegible spots. Are you sure that the game is actually using your modified ASP.lua - i.e. have you imported the file correctly?
     
  14. Danmacsch

    Danmacsch Geheimekabinetsminister

    Joined:
    Jan 14, 2014
    Messages:
    1,273
    Location:
    Copenhagen, Denmark
    Does this also apply for custom natural wonders?
     
  15. Barathor

    Barathor Chieftain

    Joined:
    May 7, 2011
    Messages:
    1,199
    To increase the total, you just need to increase the values per world size in PlaceNaturalWonders(). Though, as kaspergm said, to increase the chances of getting that total onto the map (especially if it's large -- like 14!!), you'll need to tinker with the ripple radius of placements. Otherwise, they'll easily block each other out.

    NW's block other NW's in a radius equal to: (height of map) / 5

    Also, remember, civ starts block out NW's too in a radius equal to: 4
    (Though, you shouldn't really need to decrease that, even with many civs -- it would unbalance things further. It's just something to keep in mind when determining the other ripple radius.)

    Just do a search for "self:placeResourceImpact(x, y, 6" and you'll find both of them (6 is the natural wonder layer) and modify the last value.
     
  16. Barathor

    Barathor Chieftain

    Joined:
    May 7, 2011
    Messages:
    1,199
    If you mean ones which use the custom method, then yes.

    If you mean new ones added to the game, then yes (if you're also not using a new placement method).
     
  17. GerrardCapashen

    GerrardCapashen Benalish Master-at-Arms

    Joined:
    Dec 7, 2002
    Messages:
    1,416
    Location:
    Texas, U.S.A.
    I figured out the problem I was having. If you have BNW, you have to modify the AssignStartingPlots.lua in the Expansion2 folder. Since I was following these instructions from after GnK, I only modified the GnK file. For those that have BNW, just make sure you change the correct file.

    I set the standard amount of NWs on standard maps to be 12. I've seen 12-13 spawn each time now, because the Great Barrier Reef will almost always spawn and thus increase the number of NWs you can find by 1.

    On a related note, does anybody know how to make NWs avoid city-states? Having CSes grab half the NWs on the map is kind of annoying.
     
  18. GerrardCapashen

    GerrardCapashen Benalish Master-at-Arms

    Joined:
    Dec 7, 2002
    Messages:
    1,416
    Location:
    Texas, U.S.A.
    http://forums.civfanatics.com/showthread.php?t=508236

    Google helped me out here, so I figured I'd reply to myself to help out anybody else who wants to grab those tasty NWs for themselves. I haven't tried this yet myself but I don't see any reason it wouldn't work.
     
  19. kaspergm

    kaspergm Chieftain

    Joined:
    Aug 19, 2012
    Messages:
    3,694
    Oh thanx very much for the link to the information about Natural Wonder / City State ripple number. I had myself considered changing the placement order of the two, but was woried that it might cause issues, so haven't come to it now. This seems a lot easier - if you do try it out, please let us know how it plays out!
     
  20. Dancing boy

    Dancing boy Chieftain

    Joined:
    Mar 12, 2015
    Messages:
    1
    First of all thank you for a GREAT help! I have been wanting to do this for ages - but never even known it was possible!!

    However, I haven't been successful. So I hope you can offer additional help to a poor NW desperate soul! :)
    I have found a APS.lua file. I have modified the numbers of allowed NW in the different size maps AND I have altered the (x, y, 6 (height of map) / 5) to (height of map) / 4 for all the wonders individually. But I still don't see any change?!

    I'm playing on Mac and steam. And I have installed both GaK and BNW. But still when I look through my Civ5 files, I can only find one folder with .lua files - the one I have modified.
    I have located this under the path: steam/steam apps/common/sid meier's civilization v/assets/gameplay/lua/assignstartingplots

    Should I be looking for another file to modify?? Or when I modify the file (in textedit) do I then need to do something else than just save it?
     

Share This Page