Lua Build Series - Basic Data Screen!! - Stormworks

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024
  • Join MrNJersey where he shows you how to build a simple and clean LUA data screen here in Stormworks in the 1st episode of the LUA Build Series.
    👨‍👩‍👦‍👦MrNJersey Gaming Offical Discord Server: / discord
    👕MrNJersey Gaming Offical Merch: teespring.com/....
    🐦MrNJersey Twitter: / mrnjersey
    🧡MrNJersey Patreon Page: / mrnjersey
    STORMWORKS: BUILD AND RESCUE
    Join a world where you design, create and pilot your own sea-rescue service. Release your inner hero as you battle fierce storms out at sea to rescue those in need. Stormworks: Build and Rescue is a rich and dramatic physics playground. Take your custom-designed, block-based and programmable vehicles into fierce oceanic storms. Plan and execute thrilling rescues in a variety of challenging crisis scenarios. Export and share your meticulously designed vehicles and missions with other players via the Steam workshop. Stormworks: Build and Rescue - create, rescue and release your inner hero! Stormworks: Build and Rescue - Create, Rescue and release your inner hero!
    Workstation & Gaming PC: www.amazon.co....
    Audio Setup: www.amazon.co....
    Please note that links above are affiliate links -- clicking them earns me a small commission if you make a purchase and helps support my TH-cam channel. Thank you!
    Intro Audio: Holy Tension Batman (TH-cam Audio Library)
    Series Audio: Night Snow (TH-cam Audio Library)
    Outro Audio: They Might Not - Puddle of Infinity (TH-cam Audio Library)

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

  • @rny420
    @rny420 4 ปีที่แล้ว +117

    Finally someone does a tutorial series on this. I needed it so bad. I wished that you do this kind of LUA tutorials a while ago but I didn't want to bother you so I didn't ask for it. Amazing work! Hyped for the future tutorials :)

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

      More screen Tutorials

  • @toindebas3912
    @toindebas3912 4 ปีที่แล้ว +120

    I don’t even own the game, but these vids are just so interesting

    • @Ram-lr6ud
      @Ram-lr6ud 4 ปีที่แล้ว +21

      get the game! you won't regret it

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

      I bought it yesterday lol

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

      @@yous1034 Noice, hope you like it, personally I LOVE the game : )

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

      Bought it today and it didn't fail to entertain me, so if you haven't you should. You won't regret it, and sandboxes are always fun.

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

      Quick get it the price will rise get it before it rises

  • @julianocastro9954
    @julianocastro9954 4 ปีที่แล้ว +24

    I was baited into programming when I bought this game, but still i'm proud of myself by learning something new, nice video!

  • @hen.5136
    @hen.5136 ปีที่แล้ว +2

    I know you probably won’t see this, but thank you for everything you’ve done for this community. Your tutorials are easy to follow and understand, and you explain things in a way that just makes sense. I went from knowing nothing about coding to making my own computer screen purely out of code. Thank you, NJ.

  • @Ram-lr6ud
    @Ram-lr6ud 4 ปีที่แล้ว +27

    Good video, man. I've been avoiding Lua, cause it's a headache, but thanks to you it's a little easier to get into it.

  • @erikbregnsbo9962
    @erikbregnsbo9962 4 ปีที่แล้ว +18

    Amazing! I am super glad that you have decided to dedicate a series to this, to promote our understanding of this! I really needed this! Keep up the nice work : )

  • @aslan1504
    @aslan1504 4 ปีที่แล้ว +8

    Beautiful! Btw instead of copy-pasting code you can use loops, that will make your code more concise, flexible, and easy to read.

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

      Is there a good source to learn about loops? I'd like my code a bit elegant but I have studied to become a chemical engineer and not a programmer so there is much to learn.

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

      @@mortisCZ for i = 1, 5, 1 do
      //your repeating code here
      end
      How this works? Pretty easy. First comes For, this is loop itself. First argument (i = 1) is starting point for our loop, second one (5) determines where to stop loop (can be not only a number but a variable too), last one (1) is the number (it also could be a variable), which will be added to iterator (variable i which we initialized before in loop) every loop. And your code executes from "do" to "end".
      Example:
      for i = 1, 5, 1 do
      print(i)
      end
      This code will output: 1 2 3 4 5.
      Feel free to ask more, I'll be happy to help (I'm a programmer btw)!

  • @cptray-steam
    @cptray-steam ปีที่แล้ว +2

    Instead of String format, you can use math.floor here is how to use it:
    With this data fed in:
    X = 5.7896431056
    Y = 12.7896431056
    Instead of having this:
    gpsX = input.getNumber(1)
    gpsY = input.getNumber(2)
    Output =
    5.7896431056
    12.7896431056
    Use this:
    gpsX = math.floor(input.getNumber(1))
    gpsY = math.floor(input.getNumber(2))
    Output =
    5
    12
    I hope that makes sense.

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

      its says error near =

  • @rudog-ll4qp
    @rudog-ll4qp 4 หลายเดือนก่อน

    This is the best tutorial you explain it so well and the fact that you do it step by step is amazing.

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

    if you want to type less, then instead of typing out your draw functions five more times simply concatenate your Strings e.g "screen.drawTextBox(1, 1, w, 6, "Fuel: " .. string.format("%0.0f", fuel))", The two periods after the "Fuel" are the Concat operator for Lua.I also left out the H_Sync, and V_Sync as when left out they default to the upper left if anyone would like to know how String concatenation works please let me know and i'll be happy to discuss it :)

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

    Never have I had to learn an new programing language for a video game, but I can't say I'm disappointed I did.

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

    Thank you so much for doing these, I have been struggling with LUA for ages and this is a real help.

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

    I don't know if this works in stormworks lua but in the original lua you can put variables behind text by closing your quotation marks and writing two dots and the you can write your variable behind the dots

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

      It works just like normal lua. "Text"..value makes it a lot cleaner sometimes

  • @alpha.clicks7588
    @alpha.clicks7588 4 ปีที่แล้ว +2

    Yesss, finally someone makes a tutorial on this. Thank you sooo much.

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

    I’m making a cruise ship and this will be very helpful

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

    Very cool video. Also thanks to yandex translator, he helped me watch a video with simultaneous translation. (I am Russian)

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

    Thank you for this tutorial. Those LUA screens have been a bit of a mystery to me. You clear up alot of confusion.

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

    Thanks to you I now have an Idea how LUA works. Thank you!

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

    This guy needs more subs

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

    Excellent videos, to the point, easy to follow, and a simple learning curve. Great quality videos!

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

    How do you know what tutorial I need........ that's epic dude
    Thank you very much👍

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

    no idea how this works, but my brain hurts, good tutorial! was very cool!

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

    It is better to use CamelCase (first letters of words are capital and words are together) for public variables (without "local" before name of the variable, so it can be used in entire script and not only in the one function) and pascalCase (first letter always not capital but first letters of other words still capital, and words are still together) for private ones (local myVariable = 2 + 2).
    Also, it isn't so good to use such short variable names if word more than 4 letters long, this can very decrease readability of code by others.

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

    This helped me so much. I am working on a workshop creation and I wanted to try lua so this was a huge help.

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

    Hahahaha shit. I just made my own yesterday after watching all your lua tutorials. Would have been nice to have a day ago!

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

    Turns out: LUA isnt that hard, Im just dumb. Thanks for teaching us!

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

    Nice, some more Lua

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

      Finally, someone who’s first and doesn’t say “first”

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

      @@Andreaspolis did you just say it twice 🤨

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

      @@TomKaisa did someone say 3rd reply

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

    Would you do more LUA please????? Nobody else does this and it helps a lot ! Maybe a basic missile targeting system?

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

      That’s more composite stuff and yeah or are you doing auto pilot

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

    Awesome video, I'm very much looking forward to this series. Keep the good work

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

    Awesomeeeee!!! this is gonna be a great and very needed series.

  • @Korii_01
    @Korii_01 3 หลายเดือนก่อน +1

    When I saw the programming language is Lua (which is the only language I know) I thought to myself: "It's time to overcomplicate this"

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

    Great tutorial! Hope to see bar graphs and screen dials soon!

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

    Спасибо, всё кратко и понятно)
    Best guy who makes stormworks videos is you!

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

    Ahh finaly getting lua, thanks! Just building a 4 engine display.

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

    I was waiting for this series! Great vid!

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

    fyi you can double click item in the inventory to "equip it" so you dont need to keep pressing the button at the bottom to close it :D

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

    I’ve been waiting for this for so long!

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

    This game is awesome, I bought besiege but this is what I really wanted!!!

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

    I can now make advance information screens for my fleet:)

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

    Saving my time 14:58

  • @Moosey.47
    @Moosey.47 4 ปีที่แล้ว

    This video is amazing thanks NJ ❤👌😊

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

    as any experienced coder would say, please do not include spaces in the variable names, periods, or any symbols (numbers are fine), it will cause the code assume that that was where the variable name ends and it will produce an error saying it needs to be an = sign if im not wrong, i havent coded LUA in so long i dont even know anymore

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

      Thank you kindly sir! This solved the issue I was having just by removing the spaces.

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

    Very Informative !

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

    thx man this realy helped keep up the good vids :D

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

    Nice job!

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

    Can you make the next video on how to make a 2 function graph?

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

    I can’t get the numbers to show up it just says 0 on them all except for one of them

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

      Oh wait never mind

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

    Could you do a tutorial on how to make a door you need a code to open like you did on your train?

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

      save your pincode in a memory block or use a constant number.
      subtract real pincode from guessed pincode, if answer is 0, the pincode was guessed correctly
      e.g.
      1234 - 1234 = 0
      1234 - 1235 = -1
      1234 - 3782 = (not zero)
      then only open door if result is 0

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

    I remember trying to make a Lua map but somewhere while copying it I slipped up and it didn't work. Little did I know that control C control V existed😅

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

    I did it exactly the way you did it but i used a 1x2 monitor, and all my numbers didn't align right. But still a good tutorial

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

    Can you also make a tutorial of the helpful lua site for stormworks. And a position hold system so your ship could stay in place. Thanks for the helpful vid.

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

    Nice

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

    Get him to 1million

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

    i had problems like a random setnumber command showing up now there is just 64.0 and the same 64.0 showing under the first one

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

    Yep I am safe

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

    Nice, realy interesting

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

      Is better for u to add ur done script on text file

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

    I was shocked when he said "more advanced" 23:30

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

    do the monitors work different now or what because it doesnt work even though iv done excactly what u did

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

    i dont want have to much number before the ( . ) what format should i use? help pls

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

    Thanks man ;)

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

    rly interesting and helpful. When is the next one?

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

    Wish this is more space efficient and simpler than a 1by1 dial.

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

    So I have a question, I input all of the code correctly and the screen messes up as such it goes backwards. meaning the display is flipped and i dont know how to fix, Should I contact devs?

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

    I need help i scripted all corretly but the screen bsod and says tick failuer can you help me thanks

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

    I’ll wait for more advanced tutorial cause I know everything you’ve done in the video. (By the way I know it from your earlier tutorials ) :D

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

    There is one major problem with 0 decimal places for batt it will stay as one and switch to zero after getting under 0.50

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

    Hello, am I the only one not getting the stats from the engine 19:56 ? I use a 4 engine setup. I’m doing it step by step in as in the video but still it doesn’t work for me. Any suggestions?

  • @user-ky2ko4eq1k
    @user-ky2ko4eq1k 2 ปีที่แล้ว

    When I right string format lua get error

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

    1 block is 32x32

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

    what confuses me is how did you know to name wich

  • @88werwolfhun88
    @88werwolfhun88 4 ปีที่แล้ว

    Amazing video, i have one stupid question. There is Power Consumption in the game? And if so, how i can write it to the screen. So i can see if my generator is keeping up with the consumption

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

      Berserker I know Im late but there is power consumption

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

    Хей, круто! Кто русский ставим лайк )

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

    How to creat a laser missile guided ?(My english is bad because i speak frenche 😛)

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

    Can you connect multiple screens to the same video output of the microcontroller? If yes, what will the width and height read if they're different in size?

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

      Ok ima try this now

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

      Just did it now
      The results gave me a whole new idea on how lua-video works
      I made a lua controller which displays the connected screens width n height and hooked it to 3 screens with different dimensions (1×1, 1×2, 3×3)
      Each screen displayed its own width and height (32 32, 64 32, 96 96)
      Thanks for giving this idea

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

    Yea me to

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

    How do u copy and paste

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

    This appears not to work anymore as % is an invalid option

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

    Survival Series when?

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

    I wonder if we could get anime textures to stormworks

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

    17:18

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

    man bro for some reason my code says x.0f instead of the values

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

    So Lua isn't a roblox only code type?

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

    why does it not work i have done everything step by step and it still doesn't work

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

    For some reason my screen is appearing green like the monitor is. Edit: I fixed it just did some mistakes

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

    When I add a string format thing, I get an error. It says, “bad argument #2 to ‘format’ (number expected, not gil)” Everything is copied exactly the same as yours is

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

    I have an idea for mrnjersey new logo an N with stormworks wings and a half ring at the bottom of the logo and it says LUA

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

    i keep getting tick failure...

  • @user-pc1eq3im6e
    @user-pc1eq3im6e 3 หลายเดือนก่อน

    Where is Mrnjersy?

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

    Im just getting bluescreen lol, ive typed exactly what you have, but its saying attempt to call nil value (field drawtextbox)

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

      Might be missing a value

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

    Is this still to date?

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

    I get the blue screen whenever I test the monitor. It gives me an error on line 13 saying "Attempt to call a nil value (field "SetColor")". Does anyone know how to fix this? Here is my script.
    -- Tick function that will be executed every logic tick
    function onTick()
    RPS = input.getNumber(1)
    Battery = input.getNumber(2)
    Fuel = input.getNumber(3)
    Temp = input.getNumber(4)
    end
    -- Draw function that will be executed when this script renders to a screen
    function onDraw()
    w = screen.getWidth() -- Get the screen's width and height
    h = screen.getHeight()
    screen.SetColor(0, 0, 0)
    screen.drawClear()
    screen.SetColor(200, 200, 200)
    screen.drawTextBox(1, 1, w, 6, "RPS", -1, 0)
    screen.drawTextBox(1, 8, w, 6, "Battery", -1, 0)
    screen.drawTextBox(1, 15, w, 6, "Fuel", -1, 0)
    screen.drawTextBox(1, 22, w, 6, "Temp", -1, 0)
    screen.drawTextBox(1, 1, w-6, 6, string.format("%.0f", RPS), 1, 0)
    screen.drawTextBox(1, 8, w-6, 6, string.format("%.0f", Battery), 1, 0)
    screen.drawTextBox(1, 15, w-6, 6, string.format("%.0f", Fuel), 1, 0)
    screen.drawTextBox(1, 22, w-6, 6, string.format("%.0f", Temp), 1, 0)
    end

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

      Try change it to (1,1,1)

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

      @@MrNJersey I finally got it to work. I had to rewrite the entire script & somehow, when I changed the (1, 8, w-6, 6) to (1,8,w,6) and then change it back. I no longer got the blue screen. I think this might be some sort of bug when coding in Lua, not sure if anyone else had this issue. But thanks for the help! I look foward to more tutorials :)

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

    I want the next video

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

    @MrNJersey can u copy the script and paste it here as pinned comment for me to copy and paste its ins tormworks because it does not work for me idk why. Every time i start the monitor it says that it has an error PLSSSSSSSSSSSSSS AND THX

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

    Is this still working?

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

    my text is overlapping

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

    Are you a developer?!?!

  • @MineCraft-xp4jv
    @MineCraft-xp4jv 2 ปีที่แล้ว

    Almost everything is in this video accept, how can i make on off input

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

    is this kind of the basics behind coding? just curious I've always thought about learning to code but I'm a little intimidated.

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

      as a person with a coding friend, then kinda yea.
      I do belive there are some much easier languages to learn, Lua is primarily used in games like Stormworks since it's easy to implement

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

      Roblox uses lua to make games

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

      And dont be intimidated by code, its a language like any other

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

    Can you please make a new and simpler way to do I tried twice maybe even more but like I can’t get the logic part done because it’s too hard for me please make a simpler and easier video

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

    how do you cut copy and paste?