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

Removing One Tile Islands

Discussion in 'Civ5 - Map Scripts' started by josephrandall, Jul 12, 2017.

  1. josephrandall

    josephrandall Chieftain

    Joined:
    Oct 10, 2015
    Messages:
    66
    Is there any way to remove the one/two tile islands on maps such as Pangaea maps ?
     
  2. Bobert13

    Bobert13 Prince

    Joined:
    Feb 25, 2013
    Messages:
    345
    You'd have to add some custom stuff to the existing scripts but yes. If you're familiar with Lua, you could dig into either of my map scripts and see what I've done regarding single tile islands. GeneratePlotTypes() is the function where I'm killing single-tile mountain islands. I'm doing so with a table of mountain tiles I stored from just above in the same method but the detection and removal of tiles is essentially the same you'd just be iterating on every tile on the map instead of a table (an example of that is also just above where I'm messing with islands). The only custom helper method I see being used at first glance is a spiral/neighbor iterator.
     
  3. josephrandall

    josephrandall Chieftain

    Joined:
    Oct 10, 2015
    Messages:
    66
    I'm sorry I have no experience with Lua, I have been looking at your code, but can't make much sense of it.
    This is the part of the code your talking about, right ??

    -- Gets rid of most single tile mountains in the oceans. -- Bobert13
    for k = 1,#mountainTab,1 do
    local i = mountainTab[k]
    local plot = Map.GetPlotByIndex(i)
    local tiles = GetSpiral(i,1,1)
    local landCount = 0
    for n=1,#tiles do
    local ii = tiles[n]
    if ii ~= -1 then
    local nPlot = Map.GetPlotByIndex(ii)
    if nPlot:GetPlotType() == PlotTypes.PLOT_HILLS then
    landCount = landCount + 1
    elseif nPlot:GetPlotType() == PlotTypes.PLOT_LAND then
    landCount = landCount + 1
    end
    end
    end
    if landCount == 0 then
    local roll1 = PWRandInt(1,4)
    if roll1 == 1 then
    plot:SetPlotType(PlotTypes.PLOT_LAND,false,true)
    else
    plot:SetPlotType(PlotTypes.PLOT_HILLS,false,true)
    end
    end
    end
     
  4. josephrandall

    josephrandall Chieftain

    Joined:
    Oct 10, 2015
    Messages:
    66
    Actually, I think I have removed them, using the newest version of Planet Simulator, thanks

    Thanks.
     

Share This Page