Breaking Down the Script Menu - Scripting Events || Algodoo Marble Race Scripting Tutorial

Поделиться
HTML-код
  • Опубликовано: 25 авг 2024
  • Make sure to watch in HD so that you can actually read the scripts lol.
    Hello everyone!
    This is the going to be first of many videos that will focus on scripting! I will be uploading a series of videos that will hopefully help you better understand scripting as a whole, but more importantly, help you apply them not only in your marble races, but also in your overall Algodoo experience.
    This video focuses on the events Algodoo supports - events like onClick, onCollide, onDie, onHitbyLaser, onKey, onSpawn, postStep, update, and onLaserHit.
    Want marble racing? Check out my channel!
    www.youtube.co....
    Subscribe so you don't miss a thing!
    www.youtube.co....
    Algodoo Wiki
    algodoo.fandom...
    Made using a program called Algodoo
    Recorded using OBS
    Edited using Windows Movie Maker
    Music:
    Laszlo - Fall To Light | • Laszlo - Fall To Light...
    Lost Sky - Where We Started | • Lost Sky - Where We St...
    Tobu - Candyland | • Video

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

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

    Timestamps!
    onLaserHit: 0:40*
    onClick: 0:47
    onCollide: 1:35
    onDie: 2:15
    onHitByLaser: 3:20
    onKey: 3:54
    onSpawn: 4:41
    postStep: 6:11
    update: 6:55
    * = not demonstrated in this video

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

      put one more time stamp and name it intro and set it to 0:00 so that its in your video

  • @AndrewStabell
    @AndrewStabell 4 года назад +7

    Nice tutorial! A way for the viewers to read the scripts better is if you increase the menu scale in the settings.
    Also, congrats on (almost) 4K subs!

    • @MarksMarbleRacing
      @MarksMarbleRacing 4 года назад

      Was going to suggest that. I wish there was a shortcut for it.

    • @seth2rock
      @seth2rock  4 года назад

      Hello! Thanks for the suggestion! I didn't actually know about this, so I will look into it!

  • @MarksMarbleRacing
    @MarksMarbleRacing 4 года назад +2

    Thanks for doing this. Scripting is my biggest weakness!!
    May I suggest you add some timestamps for each section in your pinned comment or in the description. I think it's now possible to do it within the video, although haven't tried it yet.

    • @seth2rock
      @seth2rock  4 года назад

      Thank you so much! I enjoy your work and hope that the series can help you as it progresses! Also for your suggestion - that is a good one; I'll work on it!

  • @MathCuber24
    @MathCuber24 4 года назад +1

    Onkey script:
    keys.isdown("x") ? {} : {}
    x is the key you want to press.
    Also this is great!

  • @BootifulBlaze
    @BootifulBlaze 4 года назад

    Awesome! I never knew the change color code! That’s awesome! I can’t wait for you next video!

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

    I'm new to the channel I subbed and liked and ringed the bell

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

    1:00
    no, they aren't per-cent-ages, they're per-unit-ages.

  • @BootifulBlaze
    @BootifulBlaze 4 года назад

    Awesome video! Your video has helped many people! :)

  • @silviumetea5727
    @silviumetea5727 4 месяца назад

    how do i run more than one script on these triggers?

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

    How do i make bullets in algodoo?

  • @ryzerred761
    @ryzerred761 2 года назад +2

    It would helped if you displayed the scripts you were writing in another box with a bigger font the way you did for the narration

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

    Can I make more than one counter? I suck at coding so idk

  • @prokidstudios9109
    @prokidstudios9109 4 года назад +2

    can't see the code clearly!! but its great

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

    AMAZING!!! love it

  • @RomeHanna
    @RomeHanna 4 года назад

    cool! I will watch the rest later, I saw to 6:46

  • @varodabby9375
    @varodabby9375 4 года назад +1

    Good video ur the best :D

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

    Como Se Podría Mover Un Motor Con Una Scrip

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

    How can I move the circle left and right with the arrow keys?

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

    2:36

  • @MrMymy-hw5ik
    @MrMymy-hw5ik 3 года назад

    and u kno u can copy the color in script menu, change it to a dif color, then paste it

  • @thanabodeeworrakul4680
    @thanabodeeworrakul4680 4 года назад

    Thanks. I need to improve a lot.

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

    could you make a video about the onLaserHit event please

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

    btw, what is the script for the test subject button?

  • @jumpy8598
    @jumpy8598 4 года назад

    I can't write more that one string in OnCollide. Algodoo not allows. What to do?

    • @gougou737
      @gougou737 4 года назад

      you do: (insert first script);
      (insert second script)

    • @seth2rock
      @seth2rock  4 года назад

      Hi Jumpy! All the replies are right - all lines of code must be separated with a semicolon. Hope it helps!

    • @jumpy8598
      @jumpy8598 4 года назад

      Thanks so much! It works!

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

    How to get it on ipad

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

    it helps a lot with my races 😍😍😍

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

    Can you write da code pls? I cannot see

  • @HalfEye79
    @HalfEye79 4 года назад

    To the onKey-event. It really could be. Thyme looks quite similar to Java. And the KeyListener from that has three events: keyTyped (which triggers only once) but also keyPressed and keyReleased which I think both are combined here. Perhaps there is a way to differentiate this. I don't know.
    And for sure, the onKey-event is for any key in the first place. You would have to tell the event, for which key he should do something.

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

      How i can do this? I want to press “a” for sonething and press “p” for other thing

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

      @@cristianserrano8390
      That is easy: The KeyListener has gotten the keys, which is pressed. So, when you press any key, the Listener goes active. You ask him, if the "a" is pressed and if yes, send it on that way. If it don't, you ask, if the "p" is pressed and if yes. send it the other way. if a different key is pressed (i.e "z") then the KeyListener does nothing after the questions.

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

      @@HalfEye79 Yes, this is JavaScript

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

      @@cristianserrano8390
      I don't know JavaScript. That was Java. (Not related!)

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

    Hey i found out its been 2 years and you have not posted on how to spawn things with code, can u please make tutorial.? this wont get replied lol

  • @MrMymy-hw5ik
    @MrMymy-hw5ik 3 года назад

    PLZ TELL ME HOW 2 SPAWN A TEST SUBJECT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

    hello there i know i should ask you and should watch the tutorial but i really need an script super fast pls help me with it so lets move on: i want a script that when you push a key on your keyboard it spawns a pre selected object pls give the script to me thats a lot

  • @BootifulBlaze
    @BootifulBlaze 4 года назад

    I just figured out how to do the test subject thing. Except how to spawn it at a certain position. Every time I try to do it, the button teleports there too. I guess I’ll find out in your next tutorials!

    • @seth2rock
      @seth2rock  4 года назад +1

      Maybe you have "pos = (enter position)" in your code. Try to add a semicolon like this:
      pos := (enter position)
      Hope this works!

    • @BootifulBlaze
      @BootifulBlaze 4 года назад

      If you mean type:
      pos := [x,y]
      Then I already did that. It teleports the pad along with spawning the marble there. But thanks for helping anyways! :)

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

      @@BootifulBlaze if the marble has the teleport code, remove the code, which leaves only the teleporter to have the code

  • @milogaming13
    @milogaming13 4 года назад

    When u gonn do another fmr race

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

    the code goes away i think it is because of the advanced users only thing how do i fix??

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

      Do you make sure to add semicolons after every line of code?

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

      @@seth2rock oof thanks for the advice

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

    Teleporter: onCollide: e.other.pos = scene.my.var1 postStep: scene.my.var1 = pos Spawner: postStep: scene.my.var1 = pos

  • @sianslyfield7217
    @sianslyfield7217 4 года назад

    Me: *watches the video*
    Also Me: *goes on algodoo and copies the steps*
    Can’t do it D:

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

    Can you put the scripts in the description?

  • @MrMymy-hw5ik
    @MrMymy-hw5ik 3 года назад

    how do u spawn a test subject

  • @MrMymy-hw5ik
    @MrMymy-hw5ik 3 года назад

    how do u define the counter

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

    5:05

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

    6:50

  • @ok.3400
    @ok.3400 4 года назад

    I need an answer now. I used the pack, when I use the Anti gravity and the "anti" anti gravity, it won't work!!

    • @seth2rock
      @seth2rock  4 года назад

      I don't know which pack you used, but maybe I can help. Can you send the scripts both pads have? Thanks!

    • @ok.3400
      @ok.3400 4 года назад

      ​ @seth2rock I forgot the pack's name, but here are the scripts:
      Normal:
      (e)=>{
      e.other.density = 2;
      e.other.radius = 0.25;
      e.other.postStep == (e)=>{vel = vel + [0, 0.32]
      } ? {
      e.other.postStep = (e)=>{}
      } : {}
      }
      Anti Grav:
      (e)=>{
      e.other.postStep = (e)=>
      {vel = vel + [0, 0.32]
      }
      }

    • @seth2rock
      @seth2rock  4 года назад

      @@ok.3400 I still can't find the issue, but here's some things you can try:
      -Make sure both those scripts are in the onCollide box
      -I don't see why the density and radius scripts are necessary, even the if-statement to detect the postStep. Try changing the onCollide of the normalizing pad to
      (e)=>{
      e.other.postStep = (e)=>{}
      }
      and see if it helps.
      Hope to hear from you!

    • @ok.3400
      @ok.3400 4 года назад

      Its the 'rainbow' marble kit..

    • @ok.3400
      @ok.3400 4 года назад

      Btw it works thanks!

  • @dd-7777
    @dd-7777 3 года назад

    ik im late to this vid but i dont under stand this part 2:43

  • @fromfhvn1127
    @fromfhvn1127 4 года назад

    Thank you so must UwU:D

  • @waldnesstopicinternational5040
    @waldnesstopicinternational5040 4 года назад

    3 scammers at this video! Beware seth2rock!

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

    2:47