Jump to content

Recommended Posts

Hey all,

My friend and I have been playing DST, and we don't love that Winona can't take players with her when she uses the Portasol. I was wondering if anyone could help me modify the functionality of the Portasol to take nearby players with her when she uses it. 

I feel like this shouldn't be too difficult seeing as how there is already functionality to take nearby items with her, but I don't have any modding experience so I could be completely wrong.

I was able to find the relevant part of the LUA, I just don't know how to go about changing it without breaking anything.

image.png.9d60036101d7bd47cfd0586934612ecf.png

I would be really appreciative if anyone can help me with this!

local radius_tp = 50
AddClassPostConstruct("components/remoteteleporter", function(inst)
	inst.OldTeleport = inst.Teleport
    inst.Teleport = function(self, doer)
        local posx, posy, posz = doer.Transform:GetWorldPosition()
        doer:AddTag("doer_tp")
        players = TheSim:FindEntities(posx, posy, posz, radius_tp, {"player"}, {"doer_tp"})
        inst:OldTeleport(doer)
        for _,player in pairs(players) do
            inst:OldTeleport(player)
        end
        doer:RemoveTag("doer_tp")
    end
end)

You don't need to do anything else because, for now, the only item that uses this is the teleportation umbrella. The downside is that other players don't make any animations when being teleported, and they spawn in exactly the same spot. I don't know if that could cause bugs.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...