Tabletop Simulator

Tabletop Simulator

Raise/Lower Hidden Zones
Jack 2 May, 2019 @ 11:13am
little expansion on the original idea
so i added the ability to choose between which FoW is affected. you need to get the GUID from the save file. also added a timer so you can't spam the button and confuse it and it thinks that it needs to lower it when it already is.

function onload() buttonEnabled = true self.createButton({ click_function = 'toggleZone', label = 'Toggle FoW', function_owner = self, position = {0, 0.3, 0}, rotation = {0, 0, 0}, width = 800, height = 250, font_size = 100}) end local zoneGuids = { ['256ce6'] = true, ['061c55'] = true, ['0440c3'] = true, ['8037de'] = true, } local offset = { x = 0, y = -10, z = 0 } function toggleZone() if buttonEnabled == false then return else buttonEnabled = false for _,o in ipairs(getAllObjects()) do if zoneGuids[o.getGUID()] and not o.isSmoothMoving() then o.translate(offset) end end offset.x = -1*offset.x offset.y = -1*offset.y offset.z = -1*offset.z end Wait.time(function() buttonEnabled = true end,2) -- 2 second disable end

also you can change it easily to move it to sides and so on. the check if it's a FogOfWar is removed since i only am adding guid's from FoW anyway.
Last edited by Jack; 2 May, 2019 @ 11:17am
< >
Showing 1-1 of 1 comments
ShotDownChoppa 25 Sep, 2023 @ 11:48pm 
Great work, thank you for doing this!
< >
Showing 1-1 of 1 comments
Per page: 1530 50