Help to remove necessary biomes

Place to get help with not working mods / modding interface.
Post Reply
Zigov
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 12, 2017 10:22 am
Contact:

Help to remove necessary biomes

Post by Zigov »

Hello
I need help with my first mod. Mod idea are - add only desert biome and remove some trees.
I figure out, how can remove trees, who I don't wont, but I stuck on removing terrain biomes.
I don't understand, how can remove all biomes except sand biome.
I found code, who can remove biomes:
viewtopic.php?p=144563#p144563

Code: Select all

for _, name in pairs({"dirt", "dirt-dark", "sand", "sand-dark", "grass-dry"}) do
    data.raw.tile[name] = nil
end
But when I copy this code into the my data-updates.lua I get error - Error in assignID, tile with name "grass" does not exist.
Can someone help me - where or what is wrong in my code ?
Here is my code from the data-updates.lua file:

Code: Select all

for _, name in pairs({"dirt", "dirt-dark", "grass", "sand-dark", "grass-medium", "grass-dry"}) do
    data.raw.tile[name] = nil
end

data.raw.decorative = nil

for _, tree in pairs(data.raw.tree) do
    for _, badword in pairs({"green-coral", "tree%-01", "tree%-02", "tree%-03", "tree%-04", "tree%-05", "tree%-06", "tree%-07", "tree%-08", "tree%-09"}) do
        if string.match(tree.name, badword) then
            data.raw.tree[tree.name] = nil
        end
    end
end

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Help to remove necessary biomes

Post by prg »

Code: Select all

for _, i in pairs{5, 3, 2, 1} do table.remove(data.raw.fire["fire-flame"].burnt_patch_alpha_variations, i) end
data.raw.item.landfill.place_as_tile.result = "sand"
data.raw.tile.water.allowed_neighbors = { "sand" }
data.raw.tile["water-green"].allowed_neighbors = { "sand" }
You'd also need to make new graphics for the coastline (base game only contains water -> grass) and adjust data.raw["water(-green)"].variants to use those.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Zigov
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 12, 2017 10:22 am
Contact:

Re: Help to remove necessary biomes

Post by Zigov »

Now I get desert :D , thanks for help.
Now I have different problem, as other biomes are disabled, water fill it places - now water are too much :shock: . I start think maybe now better need to remove water at all.
Maybe someone can help with code - who remove all water.

Post Reply

Return to “Modding help”