As someone who has only a rudimentary knowledge of programming, your channel has been wonderful. I've been adding scripting to a TTS mod as a way to learn-by-doing, and this video in particular helped me solve one immediate problem and at least three others that I wasn't even aware of at the time. Like you said in the video, it's something a little simple, but not knowing that you can do something or why you might want to can be a huge blocking point. A future video going a little more in-depth on loops, and how/when to use them, would be great.
Would this work using one button to call another. Im using a memory bag to place a Deck Building Table for a TCG mod i built. I want to hide the bag and make my own buttons to instead do the place and retract functions built into the Memory Bag.
Hi! I'm hoping you still look at comments from time to time. I'm struggling with setting up a function to lock some of the items on my table, and a separate one which unlocks them. The kicker is that I need to perform this function on objects that are leaving an infinite bag, so I don't know their GUID's. I feel like this is a Scripting Zone job but I've only started LUA about a week or so ago and haven't done any of that yet.
I'm looking into making a variation of continental rummy, turned based and round based in Tabletop Simulator. Will you ever make a series on creating a full game in TTS? Preferably Continental Rummy🤣... Kidding on the last part, but I would be interested in seeing the mechanics on how to end and start a new round and score keeping
After each video you post, I wonder 'how do you not have more of a following?' Your videos are focused, easy to follow, and most importantly: useful! I've watched most of them multiple times. Keep it up! Also a question: how might I track a 'round' so as to call a function at the beginning of each new one? (round in this case being all players have taken their turns and are ready for another cycle.)
Hi, incredible videos! just one question, I have a selfmade boardgame and I want to make a presentation video using the TTS. Can you tell me if its possible and how can I do it? thank you in advance
Is it possible to declare/change the value of another object's variable? For example, if the Global object has a variable "round" that starts the game equal to 1, could a button on a black checker set that value to 2 in a way that persists on the Global object? I feel like there must be a way!
I figured it out! If anyone else is wondering, use the function setVar(). It works exactly like getVar() as Ryan used it in the card drafting video, except that after the variable name you add a comma and then the new value before closing the parenthesis. So in the round count example, the function on the checker might look like function myFunction() Global.setVar("round", 2) end or perhaps more usefully, function myFunction() Global.setVar("round", Global.getVar("round") + 1) end
I'm struggling with custom asset bundles. I'm trying to trigger an animation without having to right click on the game object to access the context menu and manually click on the trigger numbers, but I'm in way over my head with the scripting. I'm trying to trigger my animations like TTS' RPG Kit miniatures.
Hi Ludo Lounge! I've been trying desperately to find out how to script a script zone deck shuffle - as a new deck formed via previous scripting to add decks together. I want to be able to get whatever is in a zone to shuffle, and I have scoured the web for ideas and came up empty. Hopefully you (or others) can offer some advice.
Hey, I likely won't be making a TTS UI Scripting video anytime soon, but maybe my earlier video on custom counter tokens will help: th-cam.com/video/3uCT0zK5fc8/w-d-xo.html. I also followed it up with a video where I talk through the code.
Have you made a video where with one click of a button you can move objects into a bag and back to the table in such a position in which they were laid out?
is there any way to flip an object with a button? if so how (i cant figure it out, i also have a bunch more questions but dont want to make this a huge comment) Great videos btw they all have been helpful
What Im trying to do is, have a bunch of marbles, select them and I want the game to be able to count how many marbles there are and show it on the screen... How do I do it?
Watch the 5th video in this series about scripting zones.. you could tell it to get objects in a scripting zone and then i assume you would put # in front of it to get the number of objects in that zone.. if you wanted it to be specifically marbles then you would have to do a loop that loops through the objects in the scripting zone and +1 to a count if its description marble or something like that
Where can I get help with a me-specific problem? I don't think many (if any) other people are trying to do what I'm trying to do. Maybe? So, it may not warrant a video.
I'm trying to create a code on tabletop where i could, with a press of a button (which i would create inside tabletop) take an array of SPECIFIC cards from a deck, cards which i would specify their GUID inside a LUA table, but so far i could only make a code that takes a single specific card from the deck (since i put their GUID directly on the takeObject parameters), does anyone knows a code that takes the GUID from a table and put it in the takeObject parameters?
You will likely want to loop over your table, and call takeObject for each GUID. So something like: CARD_GUIDS = { "7ff48a", "e4ede2", "a42138" } for _, card_guid in ipairs(CARD_GUIDS) do takeObject({guid: card_guid}) end And the takeObject parameter table would likely include more than just the guid. Hope that helps, I also talk about looping over a table of GUIDs in my card refill video: th-cam.com/video/gWRc58QN_ho/w-d-xo.html
@@LudoLodge Thank you so much for the reply, i realized that i had a problem in making FOR loops. I just started to learn coding and it took me way to long than it should to make this simple code. But with some help and your videos I came up with this: ****It takes the cards i specified on GLOBAL and it puts them inside a bag**** DECK_GUID = Global.getVar('DECK_GUID') BAG_GUID = Global.getVar('BAG_GUID') CONJ_CARDS = Global.getTable('CONJ_CARDS') function puxarCarta() --- Puxar Carta means Pull a Card in Portuguese --- local Bag = getObjectFromGUID(BAG_GUID) local BagPos = Bag.getPosition() local BagX = BagPos[1] local BagY = BagPos[2] + 3 local BagZ = BagPos[3] local deck = getObjectFromGUID(DECK_GUID) local size = #CONJ_CARDS for i = 1, size do deck.takeObject({flip = true, position = {BagX, BagY, BagZ}, guid = CONJ_CARDS[i]}) end end Thank you very much ^^
Would you be interested in doing a Video Tutorial On making custom status sheets? I cannot find a single video tutorial on the subject! Let me Give you a couple examples of what I mean a Yahtzee score card or more specifically a Role playing game character sheet that you can fill out. I'm trying to Build a Mod to play certain table top role playing games. I can do gfx 2d/3d i just need the scripting involved to take pdf character sheets and be able to fill them out in TTS.
Was following along and couldn't figure out why it wasn't working, your head covered up the end of the brackets after "deckPos[3]"... working: local deck = getObjectFromGUID("cc1787") function onLoad() DealPlayerCount() end function DealPlayerCount() local deckPos = self.getPosition() for i = 1, 5 do self.takeObject({flip=true, position={deckPos[1] + (3 * i), deckPos[2], deckPos[3]}}) end end
As someone who has only a rudimentary knowledge of programming, your channel has been wonderful. I've been adding scripting to a TTS mod as a way to learn-by-doing, and this video in particular helped me solve one immediate problem and at least three others that I wasn't even aware of at the time. Like you said in the video, it's something a little simple, but not knowing that you can do something or why you might want to can be a huge blocking point.
A future video going a little more in-depth on loops, and how/when to use them, would be great.
Would this work using one button to call another. Im using a memory bag to place a Deck Building Table for a TCG mod i built. I want to hide the bag and make my own buttons to instead do the place and retract functions built into the Memory Bag.
Hi, please tell me how to prescribe to each card in the deck a different strength from 1 to 5. Several decks of 21 cards
Hi! I'm hoping you still look at comments from time to time. I'm struggling with setting up a function to lock some of the items on my table, and a separate one which unlocks them. The kicker is that I need to perform this function on objects that are leaving an infinite bag, so I don't know their GUID's. I feel like this is a Scripting Zone job but I've only started LUA about a week or so ago and haven't done any of that yet.
I'm looking into making a variation of continental rummy, turned based and round based in Tabletop Simulator. Will you ever make a series on creating a full game in TTS? Preferably Continental Rummy🤣...
Kidding on the last part, but I would be interested in seeing the mechanics on how to end and start a new round and score keeping
After each video you post, I wonder 'how do you not have more of a following?' Your videos are focused, easy to follow, and most importantly: useful! I've watched most of them multiple times. Keep it up!
Also a question: how might I track a 'round' so as to call a function at the beginning of each new one? (round in this case being all players have taken their turns and are ready for another cycle.)
These are fantastic. Any chance you could consider doing a tutorial on adding general text fields for notes?
Hi, incredible videos! just one question, I have a selfmade boardgame and I want to make a presentation video using the TTS. Can you tell me if its possible and how can I do it? thank you in advance
Is it possible to declare/change the value of another object's variable?
For example, if the Global object has a variable "round" that starts the game equal to 1, could a button on a black checker set that value to 2 in a way that persists on the Global object? I feel like there must be a way!
I figured it out! If anyone else is wondering, use the function setVar(). It works exactly like getVar() as Ryan used it in the card drafting video, except that after the variable name you add a comma and then the new value before closing the parenthesis. So in the round count example, the function on the checker might look like
function myFunction()
Global.setVar("round", 2)
end
or perhaps more usefully,
function myFunction()
Global.setVar("round", Global.getVar("round") + 1)
end
Great stuff as usual.
I'm struggling with custom asset bundles. I'm trying to trigger an animation without having to right click on the game object to access the context menu and manually click on the trigger numbers, but I'm in way over my head with the scripting. I'm trying to trigger my animations like TTS' RPG Kit miniatures.
Hi Ludo Lounge!
I've been trying desperately to find out how to script a script zone deck shuffle - as a new deck formed via previous scripting to add decks together. I want to be able to get whatever is in a zone to shuffle, and I have scoured the web for ideas and came up empty. Hopefully you (or others) can offer some advice.
Would you be interested in making a video for UI scripting in TTS? Particularly scoreboards and other interaction panels
Hey, I likely won't be making a TTS UI Scripting video anytime soon, but maybe my earlier video on custom counter tokens will help: th-cam.com/video/3uCT0zK5fc8/w-d-xo.html.
I also followed it up with a video where I talk through the code.
I wonder is there a list with all command like "onLoad() onClick()" etc. I searched the web but I can't find a website which lists them.
I think this is what you're looking for: api.tabletopsimulator.com/events/. 🙂
Have you made a video where with one click of a button you can move objects into a bag and back to the table in such a position in which they were laid out?
is there any way to flip an object with a button? if so how (i cant figure it out, i also have a bunch more questions but dont want to make this a huge comment)
Great videos btw they all have been helpful
What Im trying to do is, have a bunch of marbles, select them and I want the game to be able to count how many marbles there are and show it on the screen... How do I do it?
Watch the 5th video in this series about scripting zones.. you could tell it to get objects in a scripting zone and then i assume you would put # in front of it to get the number of objects in that zone.. if you wanted it to be specifically marbles then you would have to do a loop that loops through the objects in the scripting zone and +1 to a count if its description marble or something like that
Where can I get help with a me-specific problem? I don't think many (if any) other people are trying to do what I'm trying to do. Maybe? So, it may not warrant a video.
I'm trying to create a code on tabletop where i could, with a press of a button (which i would create inside tabletop) take an array of SPECIFIC cards from a deck, cards which i would specify their GUID inside a LUA table, but so far i could only make a code that takes a single specific card from the deck (since i put their GUID directly on the takeObject parameters), does anyone knows a code that takes the GUID from a table and put it in the takeObject parameters?
You will likely want to loop over your table, and call takeObject for each GUID. So something like:
CARD_GUIDS = {
"7ff48a",
"e4ede2",
"a42138"
}
for _, card_guid in ipairs(CARD_GUIDS) do
takeObject({guid: card_guid})
end
And the takeObject parameter table would likely include more than just the guid. Hope that helps, I also talk about looping over a table of GUIDs in my card refill video: th-cam.com/video/gWRc58QN_ho/w-d-xo.html
@@LudoLodge Thank you so much for the reply, i realized that i had a problem in making FOR loops. I just started to learn coding and it took me way to long than it should to make this simple code.
But with some help and your videos I came up with this:
****It takes the cards i specified on GLOBAL and it puts them inside a bag****
DECK_GUID = Global.getVar('DECK_GUID')
BAG_GUID = Global.getVar('BAG_GUID')
CONJ_CARDS = Global.getTable('CONJ_CARDS')
function puxarCarta() --- Puxar Carta means Pull a Card in Portuguese ---
local Bag = getObjectFromGUID(BAG_GUID)
local BagPos = Bag.getPosition()
local BagX = BagPos[1]
local BagY = BagPos[2] + 3
local BagZ = BagPos[3]
local deck = getObjectFromGUID(DECK_GUID)
local size = #CONJ_CARDS
for i = 1, size do
deck.takeObject({flip = true, position = {BagX, BagY, BagZ}, guid = CONJ_CARDS[i]})
end
end
Thank you very much ^^
Good work.
BUT
You're using cards all the time. Can I use the same methods in a pile of tiles or tokens?
NVM, the answer is yes.
Would you be interested in doing a Video Tutorial On making custom status sheets? I cannot find a single video tutorial on the subject! Let me Give you a couple examples of what I mean a Yahtzee score card or more specifically a Role playing game character sheet that you can fill out. I'm trying to Build a Mod to play certain table top role playing games. I can do gfx 2d/3d i just need the scripting involved to take pdf character sheets and be able to fill them out in TTS.
Was following along and couldn't figure out why it wasn't working, your head covered up the end of the brackets after "deckPos[3]"...
working:
local deck = getObjectFromGUID("cc1787")
function onLoad()
DealPlayerCount()
end
function DealPlayerCount()
local deckPos = self.getPosition()
for i = 1, 5 do
self.takeObject({flip=true, position={deckPos[1] + (3 * i), deckPos[2], deckPos[3]}})
end
end