Scripting in Tabletop Simulator - Intro for Beginners

Поделиться
HTML-код

Комментарии • 93

  • @Lavoye
    @Lavoye Год назад +13

    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 года назад +3

    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!

  • @saxman7575
    @saxman7575 2 года назад +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!

  • @Spyderjav
    @Spyderjav 3 года назад +11

    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!

  • @PhonicNoteStudio
    @PhonicNoteStudio 3 года назад +4

    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.

  • @jasongravitt5565
    @jasongravitt5565 Год назад +1

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

  • @jjsoety
    @jjsoety 2 года назад +5

    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.

  • @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

  • @creepincat7399
    @creepincat7399 2 года назад

    Great introductory video. Thank you

  • @DaleHarty
    @DaleHarty 2 года назад

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

  • @caryxiao1603
    @caryxiao1603 3 года назад +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.

  • @andrewwilson895
    @andrewwilson895 3 года назад +1

    THANK YOU. I look forward to more scripting tutorials.

  • @joerihessels8230
    @joerihessels8230 3 года назад

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

  • @marcusburnham9920
    @marcusburnham9920 3 года назад

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

  • @Duke_Blitzein
    @Duke_Blitzein 3 года назад +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.

  • @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.

  • @WhiteGaming5883
    @WhiteGaming5883 2 года назад

    definitely awesome intro to scripting in TTS~!

  • @koyapachi
    @koyapachi Год назад

    Very understandable. You are a great teacher!

  • @WegderPain
    @WegderPain 5 месяцев назад

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

  • @jesusmaldonado4596
    @jesusmaldonado4596 3 года назад

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

  • @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!

  • @tommcfly2731
    @tommcfly2731 Год назад

    Thanks, very useful.

  • @Zaki-pi9kq
    @Zaki-pi9kq 3 года назад

    thank you so much for these videos.

  • @SlendySWIRS
    @SlendySWIRS 2 года назад +1

    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!

  • @middleclassjoe
    @middleclassjoe 3 года назад +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  3 года назад +3

      Great suggestions Joe, thanks!

    • @middleclassjoe
      @middleclassjoe 3 года назад +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.

  • @connorjensen9699
    @connorjensen9699 3 года назад

    great video!

  • @LeeHeluo
    @LeeHeluo 2 года назад

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

  • @captaindragon
    @captaindragon 3 года назад +1

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

  • @reissarud
    @reissarud 3 года назад

    Thank you !

  • @ciitrix3529
    @ciitrix3529 3 года назад

    Nice video 😁

  • @tuff-luck4946
    @tuff-luck4946 3 года назад +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 3 года назад

      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

  • @adrianwaynereavill7899
    @adrianwaynereavill7899 2 года назад

    Good video

  • @herrvorragend325
    @herrvorragend325 3 года назад

    thanks, appreciate it =)

  • @FerintoshFarmsPhotography
    @FerintoshFarmsPhotography Год назад +1

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

  • @pirincio2015
    @pirincio2015 3 месяца назад

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

  • @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

  • @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.

  • @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?

  • @user-ts3ln8by8y
    @user-ts3ln8by8y 2 года назад

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

  • @bigal115
    @bigal115 3 года назад

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

    • @LudoLodge
      @LudoLodge  3 года назад

      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.

  • @Milhenar
    @Milhenar 8 месяцев назад

    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

  • @MadMax-mw3og
    @MadMax-mw3og Год назад

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

    • @LudoLodge
      @LudoLodge  Год назад

      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.

  • @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.

  • @ktrldkhaos
    @ktrldkhaos 3 года назад

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

    • @LudoLodge
      @LudoLodge  3 года назад

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

  • @Noisymedal
    @Noisymedal 3 месяца назад

    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?

  • @avennine
    @avennine 8 месяцев назад

    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.

  • @japanaman2
    @japanaman2 3 года назад

    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  3 года назад

      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: ruclips.net/video/gWRc58QN_ho/видео.html

    • @japanaman2
      @japanaman2 3 года назад

      @@LudoLodge Thank you this helps a lot.

  • @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 Год назад +1

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

    • @johndragonrider88
      @johndragonrider88 7 месяцев назад +1

      I had the same problem! Thank you so much!

  • @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  Год назад +1

      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

  • @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. 👍🏻

  • @dePokke
    @dePokke 3 года назад

    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  3 года назад +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 3 года назад

      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 3 года назад

      [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  3 года назад +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!

  • @zerobadideas
    @zerobadideas 3 года назад

    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  3 года назад

      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 3 года назад

      @@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

  • @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

  • @agentskazzers3482
    @agentskazzers3482 8 месяцев назад

    Is it possible to make Ai Opponents?

  • @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.

  • @Alex-qf9js
    @Alex-qf9js 3 года назад

    How to make fillable pdfs perhaps?

    • @LudoLodge
      @LudoLodge  3 года назад

      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 3 года назад

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

    • @LudoLodge
      @LudoLodge  3 года назад

      @@Alex-qf9js Got it, good idea!

  • @Tomatriox
    @Tomatriox 2 года назад

    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: ruclips.net/video/qaY_5BiKQfE/видео.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 2 года назад

    *casually uses programming and scripting language interchangably*

    • @LudoLodge
      @LudoLodge  2 года назад

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

    • @ArdentSM
      @ArdentSM 2 года назад +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
      :)