Tweaks
21 days ago
2.0
91
Planets Environment Cheats

g Very nice!

19 days ago

Really like the mod, thank you.
Joining two ends
Needs flipping

It would be great if there was a hot key to flip a single selected cliff.

18 days ago
local function flipCliffSelectedEvent(event)
    local player = game.get_player(event.player_index)
    if not player then return end

    local entity = player.selected
    if entity and entity.valid and entity.type == "cliff" then
        local cliff = entity
        local new = flipOrientation(cliff.cliff_orientation)
        rotateCliff(cliff, new)
    end
end

script.on_event("Cliff-Flip-Selected", flipCliffSelectedEvent)
18 days ago
(updated 18 days ago)
data:extend({
    {
        type = "custom-input",
        name = "Cliff-Flip-Selected",
        key_sequence = "R",
        include_selected_prototype = true,
    }
})
18 days ago

Thanks! Does this only happen when the cliffs are forming a complete circle? Also there is a mod setting I included to allow rotation of a single cliff by hovering and pressing R like inserters. Keep in mind there are 20 rotations for cliffs and the hit boxes are weird. I will try to work on a fix this week if I have time. Again thank you!

18 days ago

If the lines to be joined are separate, it either places with the correct orientation or flips both lines to be the same orientation as being placed.

More pics:
Two lines
Joined

Two lines
Joined

17 days ago
(updated 17 days ago)

I mod Placable Cliffs to my preferences, but a few of the item/recipe properties you might want to add:

local recycling = {}
if mods["quality"] then recycling = require("__quality__/prototypes/recycling") end

if mods["Placable-cliffs"] then
    local cliffs = data.raw["cliff"]
    local items = data.raw["item"]
    local recipes = data.raw["recipe"]
    local technologies = data.raw["technology"]

    local mod_cliffs = { "cliff" }
    if mods["space-age"] then
        mod_cliffs = {
            "cliff",
            "cliff-fulgora",
            "cliff-gleba",
            "cliff-vulcanus",
        }
    end

    for _, mod_cliff in ipairs(mod_cliffs) do
        local cliff = cliffs[mod_cliff]
        if cliff then
            cliff.minable = { mining_time = 1.0, result = mod_cliff, count = 1 }
        end

        local item = items[mod_cliff]
        if item then
            item.localised_name = { "", { "entity-name." .. mod_cliff } }
            item.stack_size = 50
            item.subgroup = "terrain"
            item.order = "c[landfill]-b[" .. mod_cliff .. "]"
            item.weight = 20 * kg
        end

        -- hide "pc-" recipes, make new with standard names (propagates some item properties)
        local original_recipe = recipes["pc-" .. mod_cliff]
        if original_recipe then
            local recipe = table.deepcopy(original_recipe)

            recipe.name = mod_cliff
            recipe.category = "crafting"
            recipe.enabled = false
            recipe.ingredients = { { type = "item", name = "landfill", amount = 5 } }

            data:extend({ recipe })

            if mods["quality"] then
                recycling.generate_recycling_recipe(recipes[mod_cliff])
            end

            original_recipe.enabled = false
            original_recipe.hidden = true

            if technologies["landfill"] and technologies["landfill"].effects then
                table.insert(technologies["landfill"].effects, { type = "unlock-recipe", recipe = mod_cliff })
            end
        end
    end

    local custom_controls = data.raw["custom-input"]
    custom_controls["Cliff-Flip-Selected"].key_sequence = "R"
    custom_controls["Cliff-Flip"].key_sequence = "SHIFT + R"
end
17 days ago
(updated 17 days ago)

Tell me more about your idea for the blueprints? I think it will require adding hidden entities and dealing with blueprints can get rather messy.

17 days ago
(updated 15 days ago)

To help with joining two ends of a circle.
control.lua:
replace line #120 with:

            if adjacent_ends[1].cliff_orientation == adjacent_ends[2].cliff_orientation then
                rotateCliff(cliff, adjacent_ends[1].cliff_orientation)
            else
                rotateCliff(cliff, dir1 .. "-to-" .. dir2)
            end

New response