#Machinery

1 messages · Page 1 of 1 (latest)

fallow mountain
#

Chat for help, or suggestions about the new "machines" or a remake at least lol

trail zinc
#

I'll help you with your first machine. Just put this in a file, and load BM first

---@class BuildingMenu
local BuildingMenu = require("BuildingMenu01_Main")
require("BuildingMenu04_CategoriesDefinitions")


local benchSawRecipe = {
    neededTools = {
        "BlowTorch",
        "WeldingMask",
        "Screwdriver",
    },
    neededMaterials = {
        {
            Material = "Base.ElectronicsScrap",
            Amount = 28
        },
        {
            Material = "Radio.ElectricWire",
            Amount = 4
        },
        {
            Material = "Base.SheetMetal",
            Amount = 1
        },
        {
            BuildingMenu.generateGroupAlternatives({
                    {
                        Item = "Base.CarBattery1",
                        Multiplier = 1,
                    },
                    {
                        Item = "Base.CarBattery2",
                        Multiplier = 1,
                    },
                    {
                        Item = "Base.CarBattery3",
                        Multiplier = 1,
                    }
                }, 1, "Material"
            )
        },
    },
    useConsumable = {
        {
            Consumable = "Base.BlowTorch",
            Amount = 5
        },
        {
            Consumable = "Base.WeldingRods",
            Amount = BuildingMenu.weldingRodUses(5)
        }
    },
    skills = {
        {
            Skill = "MetalWelding",
            Level = 5,
            Xp = 25
        }
    }
}

--- Tooltip_BuildingMenuObj_BenchSaw and Tooltip_BenchSaw_Description need to be defined in a Tooltip_EN.txt file
local function addMachinesToMenu()
    local machinesObjects = {
        BuildingMenu.createObject(
            "Tooltip_BuildingMenuObj_BenchSaw",
            "Tooltip_BenchSaw_Description",
            BuildingMenu.onBuildSimpleFurniture,
            benchSawRecipe,
            true,
            {
                completionSound = "generator",
                maxTime = 500,
                isMid = true
            },
            {
                sprite = "machinestile_3",
                northSprite = "machinestile_3",
            },
            "BenchSaw"
        ),
        --- You can add as many objects here as you want with BuildingMenu.createObject()
    }
    --- IGUI_BuildingMenuCat_Machines and IGUI_BuildingMenuSubCat_Machines need to be defined in a IG_UI_EN.txt file in Translate
    BuildingMenu.addObjectsToCategories(
        getText("IGUI_BuildingMenuTab_General"),
        getText("IGUI_BuildingMenuCat_Machines"),
        "machinestile_3",
        getText("IGUI_BuildingMenuSubCat_Machines"),
        "machinestile_3",
        machinesObjects
    )
end

local function addCategoriesToBuildingMenu()
    addMachinesToMenu()
end
Events.OnGameStart.Add(addCategoriesToBuildingMenu)
fallow mountain
trail zinc
#

If you want to add them in another Tab, you can change IGUI_BuildingMenuTab_General to another name, for example IGUI_BuildingMenuTab_Machines