Scripting in Tabletop Simulator - Intro for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 102

  • @Lavoye
    @Lavoye ปีที่แล้ว +19

    You've got to be one of the best teachers I've ever seen. Very structured and not skipping a thing. All that with a good flow. Well done sir!

  • @SuperWaistcoat
    @SuperWaistcoat 3 ปีที่แล้ว +4

    Bruh, my project was to make a button that makes the die roll and I never thought I'd find a video so straightforward. Thank you!

  • @Spyderjav
    @Spyderjav 3 ปีที่แล้ว +12

    Dude, this is my first Intro to coding ever, and you made it totally accessible and easy to understand. The good people who developed TTS need to pay you to help game designers!

  • @jjsoety
    @jjsoety 3 ปีที่แล้ว +6

    Outstanding series for learning scripting from scratch. I tried to digest the TTS wikis, but found that they assumed too much for the non-coder and skipped lesson one. But here you demystified the API calls and basic function design so anyone could understand. And from that basis, the entire library opens up. Then you went above that and showed practical game applications that anyone could apply. If I were TTS, I'd link your videos into the documentation, since they are a great showcase of the app and a great intro. Well done.

  • @SlendySWIRS
    @SlendySWIRS 2 ปีที่แล้ว +3

    Ryan: "Nothing I do in this session is gonna be particularly useful"
    Practically everyone who got up to this point: "I just got 19 minutes of proof against that statement" ;)
    But seriously, this video is so educational and so clearly explained at the same time which makes it a great tutorial for everyone! Absolutely recommended!

  • @PhonicNoteStudio
    @PhonicNoteStudio 4 ปีที่แล้ว +5

    My first introduction into Lua Scripting for Tabletop Simulator and it was a fantastic time of learning how it's all done. I first saw just how far it could go when someone made Catan a long while back, along with another person who added auto resource card distribution to their version, and it really sparked the interest in me to make my own stuff like that.
    I really liked the video and enjoyed going through the whole process and even having a few bumps and figuring it out on my own. Eventually, I started experimenting with some of the lines of code, trying to get the button to roll two dice at once. Haven't quite figured it out yet, though...
    I definitely intend to go through the rest of your videos to better learn how I can do more of this in the future. This was really helpful. Thanks a whole bunch for opening the door to a really fun experience.

  • @mikeritter7629
    @mikeritter7629 2 ปีที่แล้ว +3

    29:33 i just love how realistic this tutorial is made, even the "standard protocol" of implementing new code is shown :D Jokes aside, very good video! It helped me a lot already

  • @TheGrimmy
    @TheGrimmy หลายเดือนก่อน

    Oh thank goodness it's close enough to C# that I won't have a headache learning this! Thank you so much for spelling it all out :D

  • @jasongravitt5565
    @jasongravitt5565 ปีที่แล้ว +1

    Best practices I wish I knew back when I started! Love it. Spot on job, I look forward to learning more.

  • @middleclassjoe
    @middleclassjoe 4 ปีที่แล้ว +3

    Great intro, Ryan. It’s the series I’ve been waiting for and I’m really looking forward for what’s coming next.
    A couple of things I’d like to see:
    Auto setups
    Exploding dice
    Auto score calculation

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว +3

      Great suggestions Joe, thanks!

    • @middleclassjoe
      @middleclassjoe 4 ปีที่แล้ว +1

      @@LudoLodge I'll add one more: Is there a way to turn off the auto rotation of cards as they move into and/or out of decks? (For games that use card rotation to represent various cards states). Thanks again for all your hard work.

  • @saxman7575
    @saxman7575 3 ปีที่แล้ว +1

    Just starting to learn different programming languages, I definitely appreciate hearing about the best practices upfront! I look forward to watching more of your videos and getting a lot more out of TTS!

  • @DarkshanubiMedia
    @DarkshanubiMedia 4 หลายเดือนก่อน

    Great video, looking forward to going through the rest of this playlist. I am building up to scripting my own board game, which would need to feature things like drawing cards equal to the remaining HP a player has. And somehow figuring out how to script damage tracking across the entire game. Hoping your videos can help me build the foundation I will need to tackle this.

  • @Duke_Blitzein
    @Duke_Blitzein 4 ปีที่แล้ว +1

    This is great! Thank you Ryan. I made my first button! and it's working. I got snagged for a little bit because I had (a) captial/s on the "F" and or "E" on function and end.

  • @caryxiao1603
    @caryxiao1603 4 ปีที่แล้ว +2

    Pretty awesome introduction. I have always felt a little intimidated using Lua since I was a child because my little kid mind years ago tried to mod a game that's in Lua. Didn't realize it was that much similar to a lot of other programming languages I'm now used to writing in.

  • @WegderPain
    @WegderPain 11 หลายเดือนก่อน

    Really really well done tutorial! I am looking forward to the next videos

  • @DaleHarty
    @DaleHarty 3 ปีที่แล้ว

    This is so very helpful and the way you presented the info is so elegant. Thanks so much.

  • @WhiteGaming5883
    @WhiteGaming5883 2 ปีที่แล้ว

    definitely awesome intro to scripting in TTS~!

  • @bizdaretz8679
    @bizdaretz8679 3 หลายเดือนก่อน

    30:41
    No, you are incorrect.... I am **VERY** coding illiterate... and yet... I DO know how to work with FUNCTIONS
    (Thank you Minecraft)
    Your simple video here, has given me ideas for WHAT I should be doing to get TTS to do what I want it to do.
    So thank you, I am genuinely very grateful for this video.

    • @LudoLodge
      @LudoLodge  หลายเดือนก่อน

      So glad I could help! 🙂 -Ryan

  • @TheFowo
    @TheFowo 3 ปีที่แล้ว +2

    Thanks for the series mate! I've been slowly learning scripting throughout last week to script my card game (ideally it'll go to my portfolio to secure that game design job one day). Found your channel today and looks like lots of useful information that will significantly speed up that process. Keep up the great work!

  • @andrewwilson895
    @andrewwilson895 4 ปีที่แล้ว +1

    THANK YOU. I look forward to more scripting tutorials.

  • @mrreddragon4164
    @mrreddragon4164 3 ปีที่แล้ว

    Thanks for making these videos, they were a big help in getting me started in modding for TTS

  • @mFurb988
    @mFurb988 3 ปีที่แล้ว

    Wonderful, great first look at scripting of tabletop simulator thank you.

  • @FerintoshFarmsPhotography
    @FerintoshFarmsPhotography ปีที่แล้ว +1

    I'm totally going to add function onload to randomize the POI's in the flashpoint mod i'm modding.

  • @creepincat7399
    @creepincat7399 3 ปีที่แล้ว

    Great introductory video. Thank you

  • @koyapachi
    @koyapachi ปีที่แล้ว

    Very understandable. You are a great teacher!

  • @LeeHeluo
    @LeeHeluo 3 ปีที่แล้ว

    This tutorial is helpful and easy to understand for a noob like me haha, hope you will make more video about script OuO.

  • @joerihessels8230
    @joerihessels8230 4 ปีที่แล้ว

    Thanks for the introduction Ryan! Looking forward to a tutorial on automatic setups :)

  • @Denzarki
    @Denzarki 3 หลายเดือนก่อน

    you say at the end there is nothing useful for me.. however the explaining putting object specific code onto the object is very useful.. I have taken over someone else's mod and kinda winging it learning what i need to do on the fly and i really didn't know when to move things out of global into the object..
    Also the buttons.. anytime you google it tells you how to make a button using lua, i didn't know you could do it with UI so i can do that now and clean it up :) Thankyou

    • @LudoLodge
      @LudoLodge  หลายเดือนก่อน

      Glad I could help! 🙂 -Ryan

  • @tuff-luck4946
    @tuff-luck4946 4 ปีที่แล้ว +1

    That was good, I’m well beyond beginner at this stage, but everything you explained was clear and easy to follow. Looking forward to some more advanced ideas. My current weakness is xml UI coding. It doesn’t come natural, and I just have to keep iterating until I achieve what I want. I can’t seem to visualize the code the way I can LUA.

    • @merezko4339
      @merezko4339 4 ปีที่แล้ว

      As do I buddy, I can't get my head around the XML, I've done some cool things for my card games but I still can't figure it out, if Ludo could do some tutorials on that I'm subscribed so I can watch those soon hopefully

    • @FabioSpelta
      @FabioSpelta 3 ปีที่แล้ว

      @@merezko4339 lol you're the gui of the mtg importer

    • @merezko4339
      @merezko4339 3 ปีที่แล้ว

      @@FabioSpelta Yep that's me! the one with my face on it :D

  • @pirincio2015
    @pirincio2015 9 หลายเดือนก่อน

    Hi, I saw your video today: just a I hope useful note for everyone: Atom editor no longer support tabletop plugin.

  • @bugwar5545
    @bugwar5545 7 วันที่ผ่านมา

    Nice video. Thanks for making it.

  • @captaindragon
    @captaindragon 3 ปีที่แล้ว +1

    pretty awesome introduction, if come with more projects, it should be better.

  • @marcusburnham9920
    @marcusburnham9920 4 ปีที่แล้ว

    Hey Ryan, thank you so much for these videos. They're really well made and really useful.

  • @jesusmaldonado4596
    @jesusmaldonado4596 3 ปีที่แล้ว

    Thanks for the video, it was really helpful and you're a very nice teacher.

  • @wishmeheaven
    @wishmeheaven 2 ปีที่แล้ว

    Thank you very much for this video.
    If I dream to be a programmer who able to combine my love to board games and programming capabilities does Lua is my best option?
    Or you recommend to learn other programming language?
    One that will actually companies in the world are looking for programmers in, and it is actually possible to fund your life with?

  • @Milhenar
    @Milhenar ปีที่แล้ว

    Actually I think this is very helpful because I'm making a prototype of a The Stars Are Right game on TableTop and the middle zone needs to be randomized onLoad, I just need to know if this will apply to the entire zone of randomization :D

  • @rszarvas
    @rszarvas 2 ปีที่แล้ว

    Great tutorial, thanks!
    It possible to change a specific custom model's color after clicking the button? I'd like to change a lightbulb color for 5 seconds after the button is pressed.

  • @MadMax-mw3og
    @MadMax-mw3og ปีที่แล้ว

    Hey man, Love your work, question: is it worth getting Atom, and whats the difference?

    • @LudoLodge
      @LudoLodge  ปีที่แล้ว +1

      Hey, unfortunately Atom was discontinued, but you might check out Visual Studio Code as it has a similar plugin: github.com/rolandostar/tabletopsimulator-lua-vscode
      The main advantage is that it is just a lot nicer text editor than what is built into TTS, so it tends to be easier to work in without running into weird glitchy behavior.

  • @tommcfly2731
    @tommcfly2731 2 ปีที่แล้ว

    Thanks, very useful.

  • @ТсссПссс
    @ТсссПссс 2 ปีที่แล้ว

    очень хорошо рассказал для новичков, что куда нажимать чтобы начать

  • @pcuimac
    @pcuimac 3 ปีที่แล้ว

    You need to isolate your mic from the desk. Every time you press buttons or put your hand on the desk, it makes a bump noise in the audio track.

  • @Zaki-pi9kq
    @Zaki-pi9kq 3 ปีที่แล้ว

    thank you so much for these videos.

  • @mrluke0660
    @mrluke0660 3 ปีที่แล้ว

    Hey Ryan, this video is great and has helped me on my way to setting up some cool basic tabletop stuff! I just have a question, can you make a button activate a pull-out slide (on a table) or other already scripted events? like making a secondary form of activation? Thanks!

    • @LudoLodge
      @LudoLodge  3 ปีที่แล้ว

      I'm not sure about the slide on the table, but in general, if you want to call a function on a different object, you will want to find that object by GUID and then use the "call" method: api.tabletopsimulator.com/object/#call

  • @milesk2406
    @milesk2406 4 หลายเดือนก่อน

    Hey, great video. I want to add to my game a button that can either say "Start Turn" or "End Turn" depending on when it makes sense. But I want one for each player, and any player can only hit their "Start Turn" button once the player before them has hit their "End Turn" button, AND (unfortunately, this goes on), when a player hits their start turn button I want a card to be drawn from their deck into their hand, unless they have reached the hand limit or their deck is empty, in which I want their discard pile to be shuffled and made into their deck (and then a card is drawn). AND, when they hit the end turn button I want all of the dice that they have drawn from an infinite bag (which act as trackers of how many turns need to pass for an ability to activate) to move one number down, unless it has already reached the "0" side, in which it should do nothing. ...Any chance you could help me with that?

  • @Noisymedal
    @Noisymedal 9 หลายเดือนก่อน

    I'm making a dungeon-generator for Tabletop Simulator as a university project and I'm running into a hurdle that I thought you might be able to help me with. I have thrown this problem at Reddit as well. As it stands, I'm capable of generating a board through a Json file by accessing image files on the local disk, but these dungeons are not visible in multiplayer. I can upload these images to the cloud in-engine, but that defeats the purpose of the generator. Is there a way I can prompt the user to upload the images upon load? I'm seeing a glimmer of hope in Lua scripting (for which I've grasped the very basics) but I can't seem a way to prompt the user with the option to upload the images to the cloud. Is there another example I can reference?

  • @kareemkoh
    @kareemkoh 4 ปีที่แล้ว

    Would you be doing a tutorial of creating / importing figures like meeples, custom miniatures, etc.?

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      I have it on my list to get to at some point!

  • @bigal115
    @bigal115 4 ปีที่แล้ว

    Thank you for the turtorial. Just curious is it possible if you can play music as soon as the game is loaded?

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      I haven't used the Music Player functionality myself, but it looks like there are functions for setting the audio clip and playing it (api.tabletopsimulator.com/musicplayer/), which you would just need to call in the onLoad() event for it to trigger when the game loads.

  • @japanaman2
    @japanaman2 4 ปีที่แล้ว

    What would be useful currently is I want a marble to pass through a scripted zone and then when that happens trigger poker chip generation/deletion (basically payout, and deletion of chips) on betting spaces. and then if able to pay out directly to the hand of players sitting at the table rather then just making chips on the betting spaces.

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      So first you would want to use the "onObjectEnterScriptingZone()" function and check if the object is the marble by comparing the GUID. If it is the marble, then you can create the chips at the appropriate places, and use the "deal()" function if you want the chips to go to specific players' hands.
      You can check out my tutorial on Card Auto-Refill for an example of generating chips at locations: th-cam.com/video/gWRc58QN_ho/w-d-xo.html

    • @japanaman2
      @japanaman2 4 ปีที่แล้ว

      @@LudoLodge Thank you this helps a lot.

  • @reissarud
    @reissarud 3 ปีที่แล้ว

    Thank you !

  • @avennine
    @avennine ปีที่แล้ว

    I am pretty clueless when it comes to scripting, and I had a question. I have 2 hidden zones. I want to bind a key (maybe the ''J'' key, I don't think that is normally used for anything else) that when pressed will change the position of both hidden zones (maybe below the table) so their contents are no longer hidden. and if pressed again, they will move back (making this a toggle switch). how do I do this? I know I prolly need to use addHotkey , but I can't understand how to structure the code and such.

  • @King_Change
    @King_Change 3 ปีที่แล้ว +2

    I was pretty sure I typed the write sequence for the button code and then my button just wasn't clickable and the text was backwards and using some strange characters, do you somehow know why?

    • @King_Change
      @King_Change 3 ปีที่แล้ว

      Nevermind, my checker was upside down ;(

    • @stickmanster914
      @stickmanster914 2 ปีที่แล้ว +1

      @@King_Change Thank you so much for saying that! I was going crazy over that exact same problem

    • @johndragonrider88
      @johndragonrider88 ปีที่แล้ว +1

      I had the same problem! Thank you so much!

  • @connorjensen9699
    @connorjensen9699 3 ปีที่แล้ว

    great video!

  • @dePokke
    @dePokke 4 ปีที่แล้ว

    Would it be possible to have tokens show a 'back side' to certain players, while showing the other side to the 'owner' of the token?
    And to add a 'show hidden' button so that in certain cases you can show the opponent the state that you are seeing?
    As in the many 'blockgames' (Hammer of the Scots, Sekigahara, ...) or as in the old classic 'Stratego' for instance?
    That would prevent players from simply rotating around the board to cheat and watch the front side.

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว +1

      As far as I know, there isn't a way to do this with scripting. It really can just simulate how the game would be at the table, where you also technically can't prevent players from just looking at the other side. Maybe defining some custom saved cameras and then agreeing not to manipulate the camera would be close? But it likely boils down to the players agreeing to not cheat.

    • @dePokke
      @dePokke 4 ปีที่แล้ว

      Yes, that's what I feared. As a fan of the Columbia blockgames (and Sekigahara) I was thinking about this again when I saw your movie about 'invisble hiding zones' (?). So I was hoping that maybe you can have two of these zones over each other (one for each player) and both would see only the 'state' of counters in what their particular zone allows. Or using cards instead of tiles and having the so-called 'hand zone' spread out all over the map. So that the opponent can only see the backside of the card while the player who owns the card can see the front. But I did assume that this was wishful thinking as if it was possible someone would probably have done that before. Thanks for the reply and keep up the good work!

    • @dePokke
      @dePokke 4 ปีที่แล้ว

      [Quote: Maybe defining some custom saved cameras and then agreeing not to manipulate the camera would be close?]
      To continue on this: Would it be possible to trigger some warning if any of the seated players rotates their view so that they end up at the opponent's backside?
      Or even block such attempts in a script? That would have the same effect as hiding pieces from the non-owner.

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว +1

      @@dePokke The short answer is that there is probably SOME way to accomplish that kind of thing with scripting, it's just a matter of how "hacky" or unconventional your approach would need to be. Hard to say for sure without really diving in and giving it a try, but let me know if you figure it out!

  • @ciitrix3529
    @ciitrix3529 3 ปีที่แล้ว

    Nice video 😁

  • @ShaharHarshuv
    @ShaharHarshuv ปีที่แล้ว

    Am I actually expected to work with the built in code editor? It doesn't syntax-color the code, has no auto-completion features / syntax error checking, and it really struggles with large files. Is there any alternative?

    • @LudoLodge
      @LudoLodge  ปีที่แล้ว +2

      There used to be an official Atom editor plugin that I did a tutorial for, but now Atom has been discontinued. However, it looks like this VS Code plugin is similar, and probably your best bet: github.com/rolandostar/tabletopsimulator-lua-vscode

  • @adrianwaynereavill7899
    @adrianwaynereavill7899 2 ปีที่แล้ว

    Good video

  • @zerobadideas
    @zerobadideas 4 ปีที่แล้ว

    I have programming experience, but for some reason I was hesitant to bother with TTS scripting. This was very informative, thank you.
    But I must be losing it, because I tried that simple "local die = getobjectbyid(guid)" and it returns a nil value. I can use getallobjects and use a for loop to list them, but if i try to get an id value, they somehow don't exist.

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      I would double check that you specifically called getObjectFromGUID, that the GUID for sure matches the object, and that you put the GUID in quotes, e.g. getObjectFromGUID("a1b2c3").

    • @zerobadideas
      @zerobadideas 4 ปีที่แล้ว

      @@LudoLodge yeah, i don't know what it's deal was, but it seems to work fine now. User error, most certainly. Thanks for responding, though.
      I also didn't think I needed Atom, since I already have two text editors (np++ and vscode), but the integration with TTS is wonderful. I actually thought TTS was broken when I would right click an object an go to scripting and the scripting window didn't open (because it was opening new tabs in Atom)
      And I realized a good way (for me, at least) to get familiar with it all was to open a scripted mod for a game I'm familiar with and just read the code, so I went for the scripted Clank! mod. It's a little over-engineered, so that's perfect lol

  • @herrvorragend325
    @herrvorragend325 3 ปีที่แล้ว

    thanks, appreciate it =)

  • @BennettProductions99
    @BennettProductions99 2 ปีที่แล้ว

    I would love to know how to tie this kind of function to a hot key rather than a button

    • @LudoLodge
      @LudoLodge  2 ปีที่แล้ว

      TTS has got you covered! api.tabletopsimulator.com/base/#addhotkey

  • @foodforthemoon7
    @foodforthemoon7 3 ปีที่แล้ว

    How did you add the button? I can’t find buttons in any menu. Tx

    • @LudoLodge
      @LudoLodge  3 ปีที่แล้ว

      If you watch from 23:00, you can see how the button is added through scripting. 👍🏻

  • @stopaskingme
    @stopaskingme 3 ปีที่แล้ว

    I have a question
    How to remove sript from object?

    • @LudoLodge
      @LudoLodge  3 ปีที่แล้ว

      I think technically every object always has a script attached, but you should be able to open the script editor for that object and just delete all of the code.

  • @agentskazzers3482
    @agentskazzers3482 ปีที่แล้ว

    Is it possible to make Ai Opponents?

  • @Alex-qf9js
    @Alex-qf9js 4 ปีที่แล้ว

    How to make fillable pdfs perhaps?

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      I'm not sure I follow, do you mean like a user interface where the players can fill out a form?

    • @Alex-qf9js
      @Alex-qf9js 4 ปีที่แล้ว

      @@LudoLodge Character sheets for RPG groups is what I'm thinking but pretty sure that there are wider applications / implications.

    • @LudoLodge
      @LudoLodge  4 ปีที่แล้ว

      @@Alex-qf9js Got it, good idea!

  • @Tomatriox
    @Tomatriox 3 ปีที่แล้ว

    I have a prototype that I think is impossible to put in Tabletop simulator. I tried various things but nothing really works. It's 8 different D4 that are tumbling from face to face to go foward. The rotate anchor only remembers 1 position and don't care about what face is facing where, before and after tumbling. Here's a little video that shows how the pieces are moving on the board: th-cam.com/video/qaY_5BiKQfE/w-d-xo.html

  • @good4usoul
    @good4usoul 3 ปีที่แล้ว

    If you don't set a width and height to your button, you're gonna have a bad time.

    • @good4usoul
      @good4usoul 3 ปีที่แล้ว

      If your fontsize is bigger than your height, you're gonna have a bad time.

  • @VielofDarkness
    @VielofDarkness 3 ปีที่แล้ว +1

    Damn Dude, you took 10 minutes to actually get started with talking about how to do anything. It gets painful to sit through a bunch of chit chat, just to get to something helpful.

    • @LudoLodge
      @LudoLodge  3 ปีที่แล้ว +1

      It is meant to be an introduction for complete beginners, so hopefully the bookmarked chapters make it easy to skip ahead if you feel you already know the basics. :)

  • @ArdentSM
    @ArdentSM 3 ปีที่แล้ว

    *casually uses programming and scripting language interchangably*

    • @LudoLodge
      @LudoLodge  3 ปีที่แล้ว

      Scripting is still programming. :) Scripting languages are typically interpreted versus compiled, but that's getting a little into the weeds.

    • @ArdentSM
      @ArdentSM 3 ปีที่แล้ว +1

      @@LudoLodge yep! The first minute or so of the video taught me how to get to the scripting API site, aswell as how to open the editor. I now have atom installed, and haven't looked at most of the video, but that's all I needed. Thank you for being clear and concise, earned a like and subscribe
      :)