Tabletop Simulator

Tabletop Simulator

The Strange Character Sheet
Position-finding tool
I made a position-finding tool script to find the relative position coordinates needed to make a custom sheet for this!

All you have to do is
1. Create an object (I used a player pawn)
2. Right-click the pawn > Scripting > Scripting Editor
3. paste the script below into the script section
4. Change the GUID below to the GUID of the sheet you want to measure coordinates on.

Then you can pick up and drop the pawn anywhere and then copy the text from the textbox to paste!

Yes, I learned fast and took a decent amount of time to do this.

(This is based off of this base script:
https://www.reddit.com/r/tabletopsimulator/comments/52abkn/comment/d7ilk66/?utm_source=share&utm_medium=web2x&context=3
)

UPDATE: I properly got the textbox to update while held too, for additional information!

-- ---------------------------------------------------------
--Input GUID of object to check position of tool in respect to object/sheet:
--CHANGE THE GUID HERE TO YOUR SHEET'S GUID
local sheet = getObjectFromGUID("eda22b")

self.setName("Relative Position Checker")
self.setDescription("Use this checker to find cordinate on sheet")


self.createInput({
input_function = "input_func",
function_owner = self,
label = "{x , y , z}",
tooltip = "{x , y , z}",
alignment = 1,
position = {x=1.5, y=0.1, z=1.5},
width = 3500,
height = 500,
font_size = 323,
validation = 1,
})
function input_func()

end


pickedUp = false
function onCollisionEnter()
Check_Position()

end


function onObjectPickUp()
pickedUp = true
end
function onObjectDrop()
pickedUp = false

end
function onUpdate()
if pickedUp then
Check_Position()
end

end


function Check_Position()
pos = sheet.positionToLocal(self.getPosition())

-- print("\nThe relative position of this checker is:\nX: "..-pos[1]..",\nY: "..pos[2]..",\nZ: "..pos[3]..".")
self.editInput({
index = 0,
value = "{"..-string.format("%.3f",pos[1]).." , "..string.format("%.3f", pos[2]).." , "..string.format("%.3f",pos[3]).."}"
})
end
Last edited by Ruuyn - The Crit Sanvich; 29 Dec, 2021 @ 1:09pm
< >
Showing 1-1 of 1 comments
Added "while held" update functionality!
< >
Showing 1-1 of 1 comments
Per page: 1530 50