Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
XML:
<Button
onClick = "hideOrShowHand"
id = "Hide Show Control"
width = "100"
height = "50"
text = "Hide/Showl"
position = "0 0 - 30"
rotation = "180 0 0"
/>
LUA:
function hideOrShowHand (player, option, id)
print(player.color)
print('Not Hid2')
print(Turns.getNextTurnColor())
print(player.getHandObjects())
end
But I have no idea what "held_by_color" should do? It's not in the API...Maybe you thought of https://api.tabletopsimulator.com/player/instance/#gethandobjects ?
PS; I tinkered around with hand visibilities for specific players, and that seems quite an annoying thing to do...so, good luck.
1.But it seams to be not possible to assign a button to a player and if that button is clicked in another players turn the cards cannot be shown or hide. Does somebody have an idea?
2. How I can access a button that is created in lua script? With self.createButton(...)? I tried to get the GUIID somehow but it doesn't work. Any idea?
Greetings
2) With the GUID of the object its attached on
For the second issue: I know that I can access the guild if the button is clicked and the attached function is runned because the object is an parameter of the function. But if I create the button over the method
self.createButton(….)
button2=getObjectByGuiid()
I want to access the previously created button directly after its creation in the Lua script, without clicking it. (did not use the xml or gui to create the button)
So I think I need it’s GUIID to get the object with getObjectByGuiId() method directly after its creation in the code. The createButton method returns just a boolean and not the object itself. Any idea to solve that issue? Is there another way to do that?
https://api.tabletopsimulator.com/object/#editbutton
But you would still need the GUID of the object the button is attached to (the "self" in the creation).
So, say you have a card/token with an attached button. The inbound creation method of the card would read:
Later on, you want to edit the label, triggered by from somewhere else. Then it would read:
You just have to check what index that specific button has (0 is always the first one you created, then 1, 2 and so on).
The guiid for the first created object is therefore “1“?
Concerning how much you already have: The API is your friend ;) https://api.tabletopsimulator.com/object/#getbuttons
So
http://lua-users.org/wiki/TablesTutorial
So maybe i was to inprecise: I tried to creat buttons in the Global file for every player in the near of their handzones within the LUA. But it seems to me that i cannot create buttons close to the handzones in the global. So i adapted my approch to add the buttons with each of the handzones lua files. I think there is no other way to read out all handzones of seated player to add them within the global file, right?
1.Now I want to make a button that only shows an icon. Therefore I loaded up an asset as "eye.png". The icon is not displayed! Any idea why? My plan is to change the icon afterwards within the executed method or somehow like a toggle button. Do you have an idea or somebody else?
This is the code:
function onload()
-- Parameters that create the button
hideButton = {
click_function = 'hideOrShowHand',
function_owner = self,
position = {x=-0.7, y=0.25, z=1.1},
width = 100,
height = 50,
icon = "eye",
iconwidth = 100,
iconAlignment = "Left",
font_size = 50,
tooltip = "Add wound",
color = {r=1, g=0, b=0}
}
self.createButton(hideButton) -- create add wound button
end
2. Do you have any idea how to lock the view to a top down perspectiv? i was able to set the view as top down but it is not possible to lock that in context of position. i want to enable the zooming but therefore i need a way to read out the camera distance. Just can set it by lookat()-Method. So that it cannot be manipulated by other players in context of movement xy axis but enable zooming? Or simply lock the camera perspective to a fixed camera position for all hot seat players.
Thanks again for you help! :) I wish a nice weekend to you.
Regarding "reading the handzones for seated players": sounds about right for me.
I think 1) breaks down to the icon name - it should not be "eye" but the full path of the uploaded decal (you created a dical, right? Cause you need to, for it to work as a button icon)
And 2) that's tricky. There was a discussion some time ago from a wargamer that wanted to lock other players view on their baords (some Battelships style behaviour). The discussion edned with "get thrustworthy friends that don't peek where they are not supposed to ;)