GameMaker Studio 2: Enemy Wave Spawner

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

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

  • @pomgranite2634
    @pomgranite2634 4 года назад +20

    Here's a copy-paste of the draw GUI code used for debugging at 21:30
    if (triggered)
    {
    var str = "remaining: ";
    for (var i = 0; i < array_length_1d(remaining); i++)
    {
    str += string(remaining[i]) + "|";
    }
    draw_text(25,25,
    str
    +"
    waves total: " +string(total_waves)
    +"
    wave now: " +string(current_wave)
    )
    }

  • @lego-man2821
    @lego-man2821 6 лет назад +1

    Also, @Shaun Spalding, your videos are amazing! I love them and look forward for every video. You've helped me out so much with game maker and video game design. I'm actually working on my very own game and integrating what you've taught me into ways to improve and create my game.

  • @malikborgna707
    @malikborgna707 5 лет назад +2

    For everyone having trouble with the Approach script, all you need to do is create a new script and (very important) NAME IT Approach, then it will not be taken as a variable. You can find the script code in Shaun's video about useful scripts.

  • @slickygreasegames
    @slickygreasegames 3 года назад +5

    This is great, but for some strange reason it is saying " unassigned variable spawn and waves referenced" and I followed everything in the video. If I put a spawn and wave variable in the create event it doesn't show it, but this isn't the case because he doesn't have wave or spawn variables in the create event.

  • @OlofMemester
    @OlofMemester 6 лет назад +9

    Love your vids thanks for helping me out with coding stay awesome

  • @propers893
    @propers893 6 лет назад +5

    hey, whats the approach script? i've done all of the code in the video but i think i've managed to miss it :/

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

      its a custom script, NOT built into gamemaker

  • @mrmistery0us951
    @mrmistery0us951 3 года назад +2

    hey i really like your videos, i wanted to know how to make the spawner spawn random enemies from the ones i made can you help?

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

      add your enemies object to the ds list...

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

      make it so when it spawns the enemies, the time has a "choose" function before it. then put in parenthesis how many different times you want

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

    I appreciate the clicky-ness of your mouse.

  • @pilot3103ify
    @pilot3103ify 6 лет назад +2

    hey there Shaun, after I finished adding Spawner into my new room. I couldn't start the game any help?

  • @oldirtygamer
    @oldirtygamer 6 лет назад

    I have been watching your videos all the way back in game maker 8.1 😁

  • @Jomain
    @Jomain 6 лет назад +10

    what about the approach script ?

    • @d.h.k.c8113
      @d.h.k.c8113 5 лет назад

      It's a fairly common script in these tutorials. I've seen in it Shaun's Platformer series and a cpl others.

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

    what do we do if we want to make more than 2 spawn points?

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

    How would I add variables to the enemies spawned?
    For example change their max hp and such?

  • @61FPS
    @61FPS 4 года назад +1

    Help! How do you make doors solid? My hero and enemies pass through them

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

      Make sure it has your regular walls as a parent

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

      assign "Odoor" as a children of "Owall"

  • @vojtechjakubec4523
    @vojtechjakubec4523 6 лет назад +1

    hey can u make something about dropped guns? just to change gun or show it in inventory.. just something like that

  • @CollectedG
    @CollectedG 5 лет назад +2

    Hey man just discovered your channel and I like how detailed you are with explaining tutorials. Do you think it's possible to create a loop for enemy spawns for a certain amount of time? I'm trying to make a simple game where you play as a Pikachu during the apocalypse shooting waves of spawning Agumons.

    • @SaraSpalding
      @SaraSpalding  5 лет назад +2

      Definitely! I can't really give you the code for it as it's a while since I made this, but I think from what I remember if you understand the concepts here thoroughly you'll have no problem making this kind of adjustment.

    • @CollectedG
      @CollectedG 5 лет назад

      @@SaraSpalding Alright cool thnx man

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

      pikachu

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

    array_length_1d is DEPRECATED. I tried to use array_lenght but the "remaining" variable still isnt correct. Does anyone have the same issue?

  • @aaronpamintuan5509
    @aaronpamintuan5509 6 лет назад +1

    hey please show us how you did the approach script please

  • @spikegn4970
    @spikegn4970 6 лет назад +2

    What about remaining, where did you set that variable

    • @pedroricardopagani6679
      @pedroricardopagani6679 6 лет назад +3

      trying to index a variable which is not an array
      at gml_Object_obj_spawner_Step_0 (line 23) - if (remaining[current_wave]

    • @Rrrretchy
      @Rrrretchy 6 лет назад

      same is happening with me - did you figure it out?

    • @ash_ish
      @ash_ish 6 лет назад

      Something Saturday same is happening with me i can't make this work.. Any help and if anyone have source code can u tell use what we need to do in order to correct this..

    • @pedroricardopagani6679
      @pedroricardopagani6679 6 лет назад +1

      I was able to correct my mistake, see below to understand
      if (triggered)
      {
      //olha a lista de inimigos que estão prontos para spawnar e se estão na onda/tempo
      for (var i = 0; i < ds_list_size(waves); ++i)
      {
      var next = ds_list_find_value(waves,i)
      if (next[spawners.wave] == current_wave) && (next[spawners.timing] == timer)
      {
      var spawnpoint = next[spawners.spawner]; // local que vai criar os inimigos spawn[local, x ou y]
      instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Player",next[spawners.type])
      }
      }
      timer++; // tempo começa a rodar
      } ------>>>> THIS WAS MY MISTAKE, YOU NEED TO PUT THIS BRACKET DOWN BELOW...
      // proxima wave ou end spawner quando todos os inimigos forem mortos
      if remaining[current_wave]

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

    Hello. Can someone tell me how can I set the position of spawn points? No way throught ds_list_add(waves, [0, obj_enemigo_02, 0, 50]); or var spawnpoint = next[_SPAWN];
    instance_create_layer (spawn[spawnpoint, 0], spawn [spawnpoint, 1], "Instances_Enemigos", next[_TYPE]);
    }
    @Shaun Spalding says x coordinate is the 0 next to spawnpoint, and 1 for y coordinate . But as far as I know, x and y coordinates can get numbers much bigger according to your room size and if I change those values spawner dont work (error).

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

    Yet another problem with Shaun's tutorials.
    trying to index a variable which is not an array
    at gml_Object_oSpawner_Step_0

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

      This means you are trying to index a variable which is not an array. It is occurring in your oSpawner's step event. The actual error probably gave you a line number too. Which will help you work out which array is the problem. Either way, make sure that waves actually contains a ds list that actually contains arrays. Make sure "remaining" is also an array.
      As you can see in the video, if you do these things correctly, it will work.

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

      Figured it out, thanks for the help

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

      @@KadeyHQ How?

  • @marcelocarvalhoferraz1831
    @marcelocarvalhoferraz1831 5 лет назад +2

    Dude, you saved my life so many times in the past two weeks that you can't even imagine. Thank you very much

  • @FunnyGuyInc-o1v
    @FunnyGuyInc-o1v 6 месяцев назад

    Amazing tutorial! Just one issue, everytime I try to run the game, it says that the variable “remaining” was not set before reading it. Do you know why it’s doing that? I haven’t been following this series so that might be the reason.

  • @mileselectric3677
    @mileselectric3677 5 лет назад

    What if you want them to spawn at random places within the trigger area but only on a floor

  • @consciousgaming5991
    @consciousgaming5991 6 лет назад

    How do we use the door my if closed door is not working. Is there code in the door object?

  • @callmeegg112
    @callmeegg112 6 лет назад

    Can anybody show me how to do something like this but with game maker studio 1? My pc is only 32bit
    I can't find any tutorial that shows something like this (an area wave spawner editable in creation code) anywhere, if anybody know, please tell me

  • @oleksiiliaskovskyi5381
    @oleksiiliaskovskyi5381 6 лет назад

    Hi, good video!) Thanks!)) Can you show how to add the water and fisic of it. Thank you. Because I have some trouble with this.

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

    What can i do if i want more spawnpoint

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

      add them to the spawn point array

  • @theresamisu267
    @theresamisu267 6 лет назад +1

    The only issue I'm having is that after my first wave, the second wave isn't coming. In the creation code I did as follows having my first wave set to "0" and my second string of enemies in wave two set to "1." In my debugging interface, it doesn't switch to the next wave when the last enemy is killed. Does anyone know how to fix this? Thanks!

    • @theresamisu267
      @theresamisu267 6 лет назад

      just kidding I'm an idiot and forgot to do the instance destroy line under the step event.

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

      @@theresamisu267 Still doesn't work for me I'm afraid

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

    Push :: Execution Error - Variable Index [0,1] out of range [5,0] - -1.spawn(100039,1)
    at gml_Object_oSpawner_Step_0 (line 12) - instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Enemy",next[_TYPE]);
    AHHH HELP

  • @mysticgamer3868
    @mysticgamer3868 6 лет назад

    very helpful would like to know how i can add a score system that subtract points for killing enemy's

  • @RefluxCitadelRevelations
    @RefluxCitadelRevelations 6 лет назад

    i dont know why, but the way that it happened, everytime i enter into the spawner, it spawns them, but it makes me immovable.

  • @campgamer4645
    @campgamer4645 6 лет назад

    yesss i can see my name in the credits! CampGamer!

  • @hmk6980
    @hmk6980 6 месяцев назад

    I love coding with you!!

  • @OlofMemester
    @OlofMemester 6 лет назад

    Hey will u do one on death and if not what’s the script

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

    Thanks bro helped me a lot

  • @christophermaher3994
    @christophermaher3994 6 лет назад

    I downloaded the spawner source code and I have been studying it since it came out, and although coding is difficult I'm starting to understand it.
    One problem I have run into, though, is finding out where exactly "remaining" is defined. I've always had trouble with variables, and it can become a real spider web with so many things meaning other things. Could anyone point out where it is located?
    Thanks again Shaun for another great video! Always looking forward to the next.

  • @raspberry_picker395
    @raspberry_picker395 6 лет назад +1

    thats nice, a handy wave spawner
    although, if anybody is looking for a spawner that constantly spawns enemies, i've got one that works great for top down games.
    nice tutorial ;)

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

    Quem é brasileiro e veio aqui pela falta de conteúdo de Game Maker no Brasil, curte ai!

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

    my game just became a black screen after adding whole wave code lol pls help

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

      it could be a texture problem

  • @joshstone7340
    @joshstone7340 5 лет назад +1

    I hate getting confused on these (){}[] they make things so confusing when you don't understand when to use them.

    • @lagan-wb1hl
      @lagan-wb1hl 2 месяца назад

      you can swap {} for begin and end if that helps you keep track of that one.

  • @100Jim
    @100Jim 6 лет назад

    Please add this to the GameMaker Studio 2 - Complete Platformer play list.

  • @pine5829
    @pine5829 6 лет назад +1

    Very helpful! Just wanted to know how to make doors :D

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

    wait what if i have multiple enemies

  • @gravener2591
    @gravener2591 5 лет назад +1

    Hello, first of all I love your work! I think it’s great! Secondly I’m making a space shooting game well in the process of making the first level of it, I’m having troubles of making my druids spawn out of the battle ships, now the druids will spawn out of them and I set the spawner to the x and y of the battle ship but only 1 battle ship at a time spawns the druids, however I want them all to spawn druids, also the battle ship has a spawner too, so I thought it’s because I set the animation for the battle ship for the battle ship spawner but it wasn’t the problem.

  • @MrMooseRPG1337
    @MrMooseRPG1337 6 лет назад

    Hey man your vids are awesome and really helpful, could you please make a tutorial on adding multi-touch controls to your game? Please and thanks!

  • @quagmire4694
    @quagmire4694 6 лет назад

    how to make followers enemy????????

  • @irfanneox6601
    @irfanneox6601 6 лет назад +1

    hi, pls list it on youtube :(

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

    Thank you, really helpful

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

    collapsing enums.
    Error : gml_Object_Ospawner_Step_0(4) : malformed statement
    Final Compile...finished.

  • @previasens
    @previasens 6 лет назад +2

    EDIT on Previous Comment: I fixed the error but only one wave spawns. After the first wave no more enemies spawn

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

      HOW (sorry ik u did this 4 yrs ago)

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

      @@loctopod3786 I completely forgot 😭 I’m really sorry mate. I haven’t used gamemaker since highschool since I needed to learn R and Python for my degree

  • @misho_dev
    @misho_dev 6 лет назад

    Thank you!

  • @Hubert99999
    @Hubert99999 5 лет назад

    What if you want a random obstacle/enemy spawner for a running game

  • @ash_ish
    @ash_ish 6 лет назад +5

    Approach script is in his script video..

    • @61FPS
      @61FPS 4 года назад +1

      Где?

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

    if anyone has issues with the remaining variable, just type "remaining[0] = 0;" in the create step. seems to work for me.

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

      That did not fix it for me :(

  • @Eddygeek18
    @Eddygeek18 5 лет назад +2

    Think i'll have to watch this video a few times it's very confusing to follow along with as your not doing things in order, your writing all of one code before doing things needed for it. Makes it very difficult for me to follow along.

  • @deadpixstudios
    @deadpixstudios 6 лет назад

    does anyone know how to make the "Approach" to work?

    • @DrJurdenPeterbergsteinlerwitz
      @DrJurdenPeterbergsteinlerwitz 6 лет назад +1

      I believe Shaun said he made those in a video about 'Scripts' but I am not sure at all. You can try look after it in on his channel. However, if you are a patreon supporter you can download the source code and simply copy it over to your own and it will work. I ran into the same problem and just did that.

  • @wizardgaming163
    @wizardgaming163 6 лет назад

    4

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

    pls speak portugueseeeeeeeee