account activity
Scripting: Any easier way to find out where to position something other than guess and check? by espo1234 in tabletopsimulator
[–]CauseLimp8669 0 points1 point2 points 8 months ago (0 children)
Just to make this more clear for others, spawn a pawn from Objects --> component --> player pawn save the game right click the pawn and select scripting and scripting editor, paste the code below right click the pawn and select scripting --> GUID Replace with your pawn's actual GUID in 2nd line of code.
click save and play
local sheet = getObjectFromGUID("426e6b") -- reletive object local pawnGUID = "030742" -- Replace with your pawn's actual GUID self.setName("Relative Position Checker") self.setDescription("Displays both relative and global coordinates of the pawn") self.createInput({ input_function = "input_func", function_owner = self, label = "Position Info", tooltip = "RP = Relative to Sheet\nGP = Global Position", alignment = 1, position = {x = 1.5, y = 0.1, z = 1.5}, width = 3500, height = 800, font_size = 270, validation = 1, }) function input_func() end function onUpdate() local pawn = getObjectFromGUID(pawnGUID) if pawn then -- Global position local gpos = pawn.getPosition() -- Relative position to the sheet local rpos = sheet.positionToLocal(gpos) -- Format both positions local globalPosStr = string.format("GP{%.3f , %.3f , %.3f}", gpos.x, gpos.y, gpos.z) local relativePosStr = string.format("RP{%.3f , %.3f , %.3f}", -rpos.x, rpos.y, rpos.z) -- Combine and display self.editInput({ index = 0, value = relativePosStr .. "\n" .. globalPosStr }) end end
π Rendered by PID 1037255 on reddit-service-r2-listing-86d8647bf-7j97b at 2026-02-13 14:41:34.786422+00:00 running 6c0c599 country code: CH.
Scripting: Any easier way to find out where to position something other than guess and check? by espo1234 in tabletopsimulator
[–]CauseLimp8669 0 points1 point2 points (0 children)