Jump to content

Winter buffer for new starters


Recommended Posts

So overall, I love DSG, but one thing I think can be improved in is some sort of cold-buffer for people joining the game during the winter months.

 

I have, on several occasions, spawned at the portal in the dead of winter with no wamring gear, with no resources (all resources previously scavenged), and before I have had chance to find the main base, or make my own, I die from the cold in about one minute.

 

I think it would be great if players who start in the winter time got some sort of immunity to the cold for a day or two, or a free thermal stone, or a winter hat...just to give them a fighting chance when they first spawn in.

 

The current game I'm working on has left me as a ghost hanging out at an abandoned base, after dying of the cold almost instantly, waiting to be revived by a fellow player who has presumably gone walkabout. if I had a cold-buffer I could be doing something. looks like the ghost next to me is amusing themself by slowly destroying the base.

 

*taps fingers* :/

post-576456-0-00510900-1421511813_thumb.

@Garfwferrg, I think new spawning players should get a thermal stone, 2 wood and 3 grass only during winter. Just enough to keep them alive for a day. This allows them to heat their thermal stone and stay warm while they either wait for help or are getting ready to adventure off.

This is what I use personally when I'm hosting on my own server (this is not a published mod, I just have a mod that only runs server side that does a bunch of tweaks\changes)

 

It gives every player a free pickaxe, axe, grassarmor and winterhat if its winter. I also made it so that any of these starter items get removed from the world if they are dropped (so they do not clutter the game if noobs keep joining and dying :p)

 

Every player also gets one free campfire. The campfire uses BufferBuild (meaning you can place it from the build menu without spending resources).

 

 

local OnPlayerSpawn = function(src, player)
    player.prev_OnNewSpawn = player.OnNewSpawn
    player.OnNewSpawn = function()

        local freebuildmode = player.components.builder.freebuildmode
        player.components.builder.freebuildmode = true
        player.components.builder:BufferBuild("campfire")
        player.components.builder.freebuildmode = freebuildmode
        
        local start_items = { "pickaxe", "axe" }
        
        for _,v in pairs(start_items) do
            local item = GLOBAL.SpawnPrefab(v)
            
            item.components.inventoryitem:SetOnDroppedFn(item.Remove)
            
            player.components.inventory:GiveItem(item)
        end   
         
        local start_equipped_items = { "armorgrass" }
        
        if GLOBAL.TheWorld.state.iswinter then
            table.insert(start_equipped_items, "winterhat")
        end
        
        for _,v in pairs(start_equipped_items) do
            local item = GLOBAL.SpawnPrefab(v)
            
            item.components.inventoryitem:SetOnDroppedFn(item.Remove)
            
            player.components.inventory:GiveItem(item)
            player.components.inventory:Equip(item)
        end
        if player.prev_OnNewSpawn ~= nil then
            player:prev_OnNewSpawn()
            player.prev_OnNewSpawn = nil
        end
    end
end


local function ListenForPlayers(inst)
    if GLOBAL.TheWorld.ismastersim then
        inst:ListenForEvent("ms_playerspawn", OnPlayerSpawn)
    end
end

AddPrefabPostInit("world", ListenForPlayers)

 

This is what I use personally when I'm hosting on my own server (this is not a published mod, I just have a mod that only runs server side that does a bunch of tweaks\changes)

 

It gives every player a free pickaxe, axe, grassarmor and winterhat if its winter. I also made it so that any of these starter items get removed from the world if they are dropped (so they do not clutter the game if noobs keep joining and dying :razz:)

 

Every player also gets one free campfire. The campfire uses BufferBuild (meaning you can place it from the build menu without spending resources).

 

 

local OnPlayerSpawn = function(src, player)

    player.prev_OnNewSpawn = player.OnNewSpawn

    player.OnNewSpawn = function()

        local freebuildmode = player.components.builder.freebuildmode

        player.components.builder.freebuildmode = true

        player.components.builder:BufferBuild("campfire")

        player.components.builder.freebuildmode = freebuildmode

        

        local start_items = { "pickaxe", "axe" }

        

        for _,v in pairs(start_items) do

            local item = GLOBAL.SpawnPrefab(v)

            

            item.components.inventoryitem:SetOnDroppedFn(item.Remove)

            

            player.components.inventory:GiveItem(item)

        end   

         

        local start_equipped_items = { "armorgrass" }

        

        if GLOBAL.TheWorld.state.iswinter then

            table.insert(start_equipped_items, "winterhat")

        end

        

        for _,v in pairs(start_equipped_items) do

            local item = GLOBAL.SpawnPrefab(v)

            

            item.components.inventoryitem:SetOnDroppedFn(item.Remove)

            

            player.components.inventory:GiveItem(item)

            player.components.inventory:Equip(item)

        end

        if player.prev_OnNewSpawn ~= nil then

            player:prev_OnNewSpawn()

            player.prev_OnNewSpawn = nil

        end

    end

end

local function ListenForPlayers(inst)

    if GLOBAL.TheWorld.ismastersim then

        inst:ListenForEvent("ms_playerspawn", OnPlayerSpawn)

    end

end

AddPrefabPostInit("world", ListenForPlayers)

 

 

Excessive, yet Super Nice! Great work as always, Sarcen :D

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...