autoplace_settings does not work with landfill prototype?

Bugs that are actually features.
Post Reply
User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

autoplace_settings does not work with landfill prototype?

Post by Godmave »

This works as expected, the whole surface filled with dirt-6

Code: Select all

    
    local newSurface = game.create_surface(surfaceName, {
        starting_area = "none",
        water = "none",
        cliff_settings = { cliff_elevation_0 = 1024 },
        default_enable_all_autoplace_controls = false,
        autoplace_controls = autoplace_controls,
        autoplace_settings = {
            decorative = { treat_missing_as_default = false },
            entity = { treat_missing_as_default = false },
            tile = {
                treat_missing_as_default = false,
                settings = {
                    ["dirt-6"] = {
                        frequency = "normal",
                        size = "normal",
                    }
                }
            },
        }
    })
This does NOT work, the whole surface is filled with default grass tiles :(

Code: Select all

    
    local newSurface = game.create_surface(surfaceName, {
        starting_area = "none",
        water = "none",
        cliff_settings = { cliff_elevation_0 = 1024 },
        default_enable_all_autoplace_controls = false,
        autoplace_controls = autoplace_controls,
        autoplace_settings = {
            decorative = { treat_missing_as_default = false },
            entity = { treat_missing_as_default = false },
            tile = {
                treat_missing_as_default = false,
                settings = {
                    ["landfill"] = {
                        frequency = "normal",
                        size = "normal",
                    }
                }
            },
        }
    })

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: autoplace_settings does not work with landfill prototype?

Post by Rseding91 »

Landfill doesn't have an autoplace defined in the prototype and so you can't generate a surface with it. Just like how you can't generate a surface with concrete.

You would need to define 'autoplace' in the prototype before it can be used for map generation.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

Re: autoplace_settings does not work with landfill prototype?

Post by Godmave »

Just in case someone stumbles over this.
The solution is to add the following to the data.lua of your mod.

Code: Select all

data.raw['tile']['landfill']["autoplace"] = {}

Post Reply

Return to “Not a bug”