Tabletop Simulator

Tabletop Simulator

Not enough ratings
Table Position Finder
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc
File Size
Posted
6.085 KB
5 Dec, 2016 @ 5:11pm
1 Change Note ( view )

Subscribe to download
Table Position Finder

Description
A simple token you can position on the table and have it output its coordinates to the notes on the side of the screen. It pre-formats all coordinates, and if you enter a number into the description it will add that much to the Y (height) element automatically.

A useful mini-tool I made for myself while scripting. Used to find positions of things I intend to put onto a table without any guess work.
3 Comments
Habanero 6 Mar @ 6:09pm 
@BIGFETA Thanks, that's exactly what I checked here for.
BIGFETA 1 Dec, 2024 @ 12:19am 
Hello

the code doesn't allow for the coordinates to clear when you delete the object.

The following code should fix that

function update()
local pos = self.getPosition()
local heightOffset = self.getDescription()
local x = math.floor(pos.x*100+0.5) / 100
local y = (math.floor(pos.y*100+0.5) / 100)
local z = math.floor(pos.z*100+0.5) / 100

if heightOffset ~= "" then
y = y + tonumber(heightOffset)
end

setNotes("{"..x..", "..y..", "..z.."}")
end

function onDestroy()
setNotes("") -- Clear the notes when the object is deleted
end

Kind Regards
pming 1 Nov, 2019 @ 11:25pm 
LOL! Never mind...I made the 'graphical designer mistake' of assuming you were getting the upper left point of the text box with the gizmo. This gizmo is to be placed...
IN THE MIDDLE OF THE TEXT FIELD YOU WANT TO MAKE.
(Just figured I'd all-caps that so others won't make the same mistake I did)