1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

How to prevent terrain from generating at the edges of the map

Discussion in 'Civ5 - Map Scripts' started by ogl1986, Mar 4, 2017.

  1. ogl1986

    ogl1986 Chieftain

    Joined:
    Mar 4, 2017
    Messages:
    1
    Gender:
    Male
    Hello

    I really need your help. Could you please tell me how to prevent terrain from generating at the edges of the map.
    Please find img enclosed.

    How to prevent that? Is it possible to exclude two hexes from top and bottom to not generate any terrain on em?

    I have found a thread with line to not generate ice next to coasts and that was great, but a lot of times map is generating like this one on enclsed image.

    The same situation is with mountains sometimes there are too many of them in one place, like a cluster. Where and how can I change this?

    I would really appreciate any help in this matter.

    Thanks!

    Peter
     

    Attached Files:

    Last edited: Mar 4, 2017
  2. Bobert13

    Bobert13 Prince

    Joined:
    Feb 25, 2013
    Messages:
    345
    This question belongs in another section but I'll go ahead and answer it to the best of my ability here.

    I'd need to see your code to advise a "best" option but in all cases you could always do a pass after initially generating tile types and set all of the tiles in the top and bottom rows to PlotTypes.PLOT_OCEAN. That might look something like this:

    Code:
    local y = 0
    for x = 0,W - 1,1 do
               local plot = Map.GetPlot(x,y);
               plot:SetPlotType(PlotTypes.PLOT_OCEAN, false, false)
    end
    
    y = H - 1
    for x = 0,W - 1,1 do
               local plot = Map.GetPlot(x,y);
               plot:SetPlotType(PlotTypes.PLOT_OCEAN, false, false)
    end
    Note, you'll need "W" and "H" variables setup as the mapconstants for width and height. Likely you already have them in your code somewhere under a different name but pulling them would look something like this:
    Code:
    local W,H = Map.GetGridSize()
     

Share This Page