mapgeneration override

Place to get help with not working mods / modding interface.
Post Reply
safan
Fast Inserter
Fast Inserter
Posts: 126
Joined: Mon Dec 23, 2013 7:26 pm
Contact:

mapgeneration override

Post by safan »

I want a planet with only desert biome, no water and not a single tree. Can i force this? Where should i start?

i don't find https://forums.factorio.com/wiki/inde ... cification helpful.

thanks.

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

Re: mapgeneration override

Post by prg »

safan wrote:I want a planet with only desert biome, no water and not a single tree. Can i force this? Where should i start?

i don't find https://forums.factorio.com/wiki/inde ... cification helpful.

thanks.
Don't think it's possible to tell the map generator to do this for you, but you can kludge something together yourself like this:

Code: Select all

require "defines"

script.on_event(defines.events.on_chunk_generated, function(event)
    local tiles = {}
    for x = event.area.left_top.x, event.area.right_bottom.x do
        for y = event.area.left_top.y, event.area.right_bottom.y do
            table.insert(tiles, {name="sand", position={x, y}})
        end
    end
    event.surface.set_tiles(tiles)
    for _, tree in pairs(event.surface.find_entities_filtered{area=event.area, type="tree"}) do
        tree.destroy()
    end
end)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Post Reply

Return to “Modding help”