Tabletop Simulator

Tabletop Simulator

Wizardcards TTS: A Table for Playing the World's First, Best, and Woodgiest TCG
Amuzet 2020 年 8 月 17 日 下午 8:53
Scripting Bugs and Suggestions
This is for in case there are any bugs with this table.
Also the first post is for a suggestion of how to keep the play mats from being shown while players USE ALT to zoom in on cards!

THE CODE TO PUT INTO GLOBAL:
local mats={} --How the mats Change their state function changeState(o,c,a) local name=o.getName() local n=mats[name] if a then n=n-1 else n=n+1 end if n<1 then n=#o.getStates()+1 elseif n>1+#o.getStates()then n=1 end local m=o.setState(n) m.setLock(true) mats[name]=n m.setName(name) m.interactable=false if m.getButtons()then m.editButton({index=0,label='Current State: '..mats[name]}) else B(m,name)end end function B(o) o.createButton({ label='Current Image: '..mats[o.getName()], function_owner=self, click_function='changeState', width=1500,height=300,font_size=200, scale={0.2,0.2,0.2},position={0,0,-1.2}, font_color={1,1,1},color={0,0,0}, tooltip='Change current mat image!' })end --Objects named K become uninteractable --In this case K is UNINTERACTABLE local K='UNINTERACTABLE' function onLoad(d) for _,o in ipairs(getAllObjects())do if o.getName():find(K)then o.interactable=false local s=o.getStates() --If an object we are setting uninteractable has states rename them and slap a button on them! if s then local n=1 while mats[K..n]do n=n+1 end local k=K..n o.setName(k) mats[k]=1 B(o) end end end end
You can put these on any objects you don't want messed with or mats you don't want zoomed in on. Like the player areas!
< >
正在显示第 1 - 1 条,共 1 条留言
Rattleboneses  [开发者] 2020 年 8 月 19 日 下午 2:16 
Thanks for the reccomendation! I'm not very experienced with scripting in general, but I'll give it a whirl! :D
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50