rbreslow / zs

Fork of JetBoom's Zombie Survival for the "Hot Dad" Garry's Mod community.
Other
1 stars 1 forks source link

Set up default builds for the worth menu #39

Closed johnnymoe closed 4 years ago

johnnymoe commented 4 years ago

This is very easy to do. Just need to assemble some builds given the starting worth and put them into LoadSavedCarts().

These are very important for new players that don't yet know what to spend their worth on. They can pick from a premade build and jump right into the action.

Shared from Pufulet:

function GM:LoadSavedCarts()
    if self.SavedCartsLoaded then return end

    local cartfile = GetCartFile()

    if file.Exists(cartfile, "DATA") then
        GAMEMODE.SavedCarts = Deserialize(file.Read(cartfile)) or {}
    else
        GAMEMODE.SavedCarts[1] = {
            "Gunner",
            {"tossr", "2smgcp", "3smgcp", "2pcp", "3pcp"}
        }
        GAMEMODE.SavedCarts[2] = {
            "Medic",
            {"medkit", "60mkit", "pshtr"}
        }
        GAMEMODE.SavedCarts[3] = {
            "Barricader",
            {"junkpack", "12nails", "8nails", "crphmr", "trinket_blueprints", "trinket_lift_frame"}
        }
    end

    GAMEMODE.SavedCartsLoaded = true
end