GameMaker Studio 2: Action RPG Tutorial (Episode 24: Enemy basics)

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ • 150

  • @Spvoon111
    @Spvoon111 4 роки тому +89

    You know your in for a ride when Shaun says "lets maximise the window"

    • @bobbyelian630
      @bobbyelian630 3 роки тому

      You all prolly dont care but does someone know a way to log back into an instagram account?
      I was dumb lost my password. I appreciate any help you can give me.

    • @aydenliam7454
      @aydenliam7454 3 роки тому

      @Bobby Elian Instablaster ;)

    • @bobbyelian630
      @bobbyelian630 3 роки тому

      @Ayden Liam i really appreciate your reply. I got to the site thru google and I'm trying it out atm.
      I see it takes a while so I will get back to you later with my results.

    • @bobbyelian630
      @bobbyelian630 3 роки тому

      @Ayden Liam It did the trick and I actually got access to my account again. Im so happy:D
      Thanks so much, you really help me out :D

    • @aydenliam7454
      @aydenliam7454 3 роки тому

      @Bobby Elian You are welcome xD

  • @justhere2153
    @justhere2153 4 роки тому +23

    You have a great things going, I love your content!

  • @fgkeiji
    @fgkeiji 4 роки тому +4

    Thanks for all of your hard work on this series and for providing all the assets for us to follow along!
    One thing that bothered me was the way we initialized the scripts for each of the enemy states (20:43 for reference). After some research, I learned that enums don’t support any sort of length operation, so the way you did it makes sense. One suggestion I found was to have to the last entry in an enum be “length”, so that way it can be referenced to loop over all of the entries in a normal for loop and it will also update for free if we add a new state.

  • @issimc158
    @issimc158 4 роки тому +3

    you don't know how stoked I was when you said we'd be doing the wander func 16mins into the vid XD Cheers bro

  • @quentingirardclos741
    @quentingirardclos741 4 роки тому +5

    Hi ! Thank you for all this work ! It's amaizingly helpful !!!
    I follow your RPG tutorial serie since the beegining and thanks to you my game is looking better every week !

  • @sammybowker7823
    @sammybowker7823 5 місяців тому

    so stoked on this episode! been looking forward to this one the most!

  • @GrrrVahrrr
    @GrrrVahrrr 4 роки тому +2

    This is immensely helpful! Please don't stop) it is great to see a bit more advanced processes of how to set up a bigger game rather than just a beginner project. If you ever decide to make a video about your ideas and ways of structuring a project, i would be glad to watch it) I find that project planning is really hard and as i work on mine there are always things that come up during work that i haven't accounted for so i have to replan on the fly which is a hassle.

  • @aorn8437
    @aorn8437 3 роки тому +4

    Hello past Shaun! :D 10:26 thanks for all your help :)

  • @gracedileo6573
    @gracedileo6573 2 роки тому +2

    Ur pulling me through game design bro ❤️

  • @prod.kasper
    @prod.kasper 3 роки тому +7

    Hey Shaun, good tutorial on enemies. I just wanted to ask, where did you learn all of this stuff? Lol because I basically learn everything from you.

    • @plazies_
      @plazies_ Рік тому

      He have years of experiences

  • @klydekadell1309
    @klydekadell1309 4 роки тому +2

    Great and informative video as always! Keep being awesome!

  • @nerdmachine5551
    @nerdmachine5551 Рік тому +1

    IF YOUR SLIME IS NOT MOVING
    Make sure that the else statement here is in the correct spot: 23:22
    If it's attached to the "if (++wait >= waitDuration)" statement, it is in the wrong spot and the code will not execute as intended.
    It MUST be attached to the main if statement

    • @drakemorgon1048
      @drakemorgon1048 10 місяців тому

      Which statement

    • @MaxScootty
      @MaxScootty 5 місяців тому

      My else statement is in the correct spot attached to tha main if statement, but my slime isn't moving. Is there something else, that may cause the problem?

  • @isaacponce7393
    @isaacponce7393 4 роки тому +1

    Can't wait for the continuation of this! :)

  • @chugalug3108
    @chugalug3108 4 роки тому +3

    Love the series!

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому +4

    It would be really cool if objects could be groups, so we could have pEntity that expands to all entities including pEnemy, which expands into all enemies. And a new right click menu option for making a child object, which places it into the group of that object automatically.

  • @8bitenial313
    @8bitenial313 8 місяців тому +3

    I added a maxChaseDistance (state RETURNING). So you can run from your enemies :P

  • @makermatic2
    @makermatic2 4 роки тому +4

    Nice! I'm excited for the continuation of the enemy code!
    Oh yeah also my slime for some reason is only going Northeast as well, I don't know what to do about that.

    • @SaraSpalding
      @SaraSpalding  4 роки тому +4

      Unsure about that, as you can see it doesn't in the video so double check your work! Make sure you understand how it all should work.

    • @makermatic2
      @makermatic2 4 роки тому +2

      @@SaraSpalding I re-watched this video and checked all of the new code added from the video twice and I still don't understand what I did wrong for the Slime to keep moving Northeast.

    • @garypatterson2857
      @garypatterson2857 4 роки тому +3

      is your irandom_range(-45,45) correct? Just a guess, but Northeast is 45 degrees in GML. The line should be:
      dir = point_direction(x, y, xstart, ystart) + irandom_range(-45, 45);

    • @makermatic2
      @makermatic2 4 роки тому +2

      My line of code is exactly like what you showed and it's still going NE

    • @makermatic2
      @makermatic2 4 роки тому +2

      @@SaraSpalding I've redoing the things in this video and this is what I have for the SlimeWander script: (Is there something I'm not seeing?)
      sprite_index = sprMove;
      //At destination or given up?
      if ((x == xTo) && (y == yTo)) || (timePassed > enemyWanderDistance / enemySpeed)
      {
      hSpeed = 0;
      vSpeed = 0;
      //End our move animation
      if (image_index < 1)
      {
      image_speed = 0.0;
      image_index = 0;
      }
      //Set new target destination
      if (++wait >= waitDuration)
      {
      wait = 0;
      timePassed = 0;
      dir = point_direction(x,y,xstart,ystart) + irandom_range(-45, 45);
      xTo = x + lengthdir_x(enemyWanderDistance, dir);
      yTo = y + lengthdir_y(enemyWanderDistance, dir);
      }
      }
      else //Move towards new location
      {
      timePassed++;
      image_speed = 1.0;
      var _distanceToGo = point_distance(x,y,xTo,yTo);
      var _speedThisFrame = enemySpeed;
      if (_distanceToGo < enemySpeed) _speedThisFrame = _distanceToGo;
      dir = point_distance(x,y,xTo,yTo);
      hSpeed = lengthdir_x(_speedThisFrame, dir);
      vSpeed = lengthdir_y(_speedThisFrame, dir);
      if (hSpeed != 0) image_xscale = sign(hSpeed);

      //Collide & move
      /*var _collided = */EnemyTileCollision();
      }

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому +1

    I made a function TileCollision when I made entity collisions and applied it to fragment collisions. They all use the same collisions, including enemies.

  • @samwse7503
    @samwse7503 2 роки тому +2

    Great tutorial! But i am having some troubles. My enemy keeps vibrating once it stops wandering. Anyone know how to fix this?

  • @ulfbyte8750
    @ulfbyte8750 3 роки тому +9

    What would we change, if our enemy sprite is 4 direction like the player sprite?

    • @vocenaoentendeunada2505
      @vocenaoentendeunada2505 3 роки тому +1

      if you discover, tell me please! hahaha

    • @miguelgrifo2198
      @miguelgrifo2198 3 роки тому

      Also would love to know, I've tried several ways by looking at how the player changes directions, but I'm pretty terrible at this I guess because nothing works.

    • @a1zombieslayer148
      @a1zombieslayer148 3 роки тому

      @@miguelgrifo2198 have you figured it out all i can get is the enemy to stop on the forth frame then continues going through 0,1,2,3 stop

    • @miguelgrifo2198
      @miguelgrifo2198 3 роки тому

      @@a1zombieslayer148 Not yet, I might revisit it when I get better at this, I just moved on to other parts of the game for now. I'm sure it's easy if you know what you're doing.

    • @a1zombieslayer148
      @a1zombieslayer148 3 роки тому +2

      @@miguelgrifo2198 I appreciate the response i used to be good in gml 8.1 and knew how to do it but gml has changed since those days. I got it to almost work by separating the sprites into directions but since the object can move in a 45° angle it may be fixed with an 8 directional sprite or calling the angle and telling it to pick based off which number is greater

  • @deanthomas9873
    @deanthomas9873 3 роки тому +3

    I use an enemy with more than 4 frames. How do I have him face the correct direction? When he dies he plays all 16 death frames as well. (4 per direction) any help on both of these problems?

  • @x-zykron-x
    @x-zykron-x 3 роки тому

    I know this is for a platformer but even if you're making a game like galaga it's very helpful!

  • @kevinwynns3406
    @kevinwynns3406 8 місяців тому +1

    Anyone else having issues with the slimes occasionally teleporting and getting stuck inside of or on the other side of walls? I can't tell if this is related to the slime's original movement code, or the later chase and attack codes. Anyone know what might be causing this problem?

  • @justtzenn
    @justtzenn Рік тому +2

    If anybody wanted to make their slime move a random amount instead of the exact same distance every single time, you could try adding < enemyWanderDistance = random_range(0, 45); >
    And make it the first command in < if (++wait >= waitDuration) { > in the SlimeWander script
    You could also try messing with the variables to make it easy to change per entity, and I'm willing to bet there's way better ways of doing this than what i thought of

    • @justtzenn
      @justtzenn Рік тому +4

      Okay I figured out a pretty simple way to make it modular!
      Go to pEntity > Create and in Intrinsic variables add
      enemyWanderDistance = 35;
      Then go to variable definitions and rename enemyWanderDistance to enemyWanderMinMax, and change the definition to [0, 45]
      Then go to your SlimeWander script, and under //Set new target destination, make it look like
      if (++wait >= waitDuration)
      {
      enemyWanderDistance = random_range(enemyWanderMinMax[0], enemyWanderMinMax[1]);
      wait = 0;
      timePassed = 0;
      ... Etc
      ... Etc
      Basically you're making enemyWanderDistance a static variable in the beginning and changing it to a random number when setting a new target destination

  • @bakNumbers
    @bakNumbers 3 роки тому +2

    Just a quick question, I am not sure if this is mentioned later in the series, but shouldn't it better to set the collision mask for the slime? Since it checks for the collisions and could cause some problems.

  • @Koden
    @Koden Рік тому +3

    Ok, so I ran into this issue. If your slime isn't moving, make sure oSlime: Create is writing to enemyScript, not Script, I had that error because I looked away when the full word was showing.

  • @MichelSchallenberg
    @MichelSchallenberg Рік тому +1

    Man I love this series so much.
    Just a small thing I noticed, am I correct that 'dir = point_direction(x,y,xTo,yTo);' when moving to the new destination in 'Slime Wander' is redundant?
    dir has already been set when determining the new target destination.

    • @lloyd011721
      @lloyd011721 6 місяців тому

      when i disabled the dir = line in the slime wander moving to a new destination block, my slime stopped only trying to move up and left until it hit a wall and instead started moving around in a seemingly random pattern like it did in shauns video

  • @brunocolaco3188
    @brunocolaco3188 4 роки тому +4

    Here the slimes just go to the northeast direction, any clues why?

    • @SaraSpalding
      @SaraSpalding  4 роки тому

      Unsure off the top of my head, let me know when you work it out!

    • @vintagetechno
      @vintagetechno 4 роки тому +4

      oh my gosh I figured it out! This was driving me crazy! Check your EnemyTileCollision script and make sure at the end after you check for vertical collisions you have "y += vSpeed" NOT "hSpeed". I copy/pasted and seems I forgot to change it. That fixed it for me!

    • @brunocolaco3188
      @brunocolaco3188 4 роки тому

      @@vintagetechno It didn't worked for me, my EnemyTileCollision is just like in the video :/

    • @omniferousswan593
      @omniferousswan593 4 роки тому +2

      @@brunocolaco3188 dir=point_direction , not point distance. (in the slime wander script)

    • @brunocolaco3188
      @brunocolaco3188 4 роки тому +1

      @@omniferousswan593 Thank you so much

  • @Alphawolf-d2k
    @Alphawolf-d2k 3 роки тому +2

    my slime is just squishing and then playing the idle animation. it's not going places. does anyone know how to stop these? edit: i needed to included "EnemyTileCollision();"

  • @pet784
    @pet784 Місяць тому

    I had a problem where the slime keept running to the top right
    swaping enemyWanderDistance and dir (where you set your destination) helped
    xTo = x + lengthdir_x(dir, enemyWanderDistance);
    yTo = y + lengthdir_y(dir, enemyWanderDistance);

  • @CelynBrum
    @CelynBrum 4 роки тому +3

    Hi there! Thanks for these tutorials. Question for the comments section: my slime is animated, but isn't moving anywhere. I've checked through every line of code from this tutorial and the only difference I can spot is that "_collision" in EnemyTileCollision is yellow, not blue. That suggests it's a different type of thing, but I have no idea why, or whether that could be causing my slime to not move.

    • @redfoxpw6566
      @redfoxpw6566 4 роки тому +6

      Hey so I know I am a little late but I had the same issue as you. I fixed it by adding x+=hSpeed and y+=vSpeed to the bottom of the respective collision code
      var _Collision = false;

      //Horizontal Tiles
      if (tilemap_get_at_pixel(collisionMap, x + hSpeed, y))
      {
      x -= x mod TILE_SIZE;
      if (sign(hSpeed) == 1) x += TILE_SIZE - 1;
      hSpeed = 0;
      _Collision = true;
      }
      x += hSpeed;

      //Veritcal Tiles
      if (tilemap_get_at_pixel(collisionMap, x, y + vSpeed))
      {
      y -= y mod TILE_SIZE;
      if (sign(vSpeed) == 1) y += TILE_SIZE - 1;
      vSpeed = 0;
      _Collision = true;
      }
      y+=vSpeed

    • @TonyGru
      @TonyGru 3 роки тому

      @@redfoxpw6566 Deary me, that did help me out.. I've been looking in the code for hours to find the mistake, cheers! Didn't even think of adding something.

  • @buffectomorph9657
    @buffectomorph9657 2 роки тому +2

    So my enemy is currently just the first frame moving around. I'm pretty sure I'll figure that bit out. But I have an idle animation I want to use also for when the enemy is pausing. Can anyone offer some ways to go about having a separate walk animation and idle animation with this same effect?

    • @corzax24_plays7
      @corzax24_plays7 2 роки тому

      Did you figure the animation issue? Mine just moves around on a single frame too...

    • @buffectomorph9657
      @buffectomorph9657 2 роки тому +1

      @@corzax24_plays7 I was trying to do my NPC the same as the player with four directional movement. That's why mine wasn't working.
      It works the right way if you follow the tutorial though

    • @slimeme64
      @slimeme64 Рік тому

      try adding image_speed = 1 to the SlimeWander function (example below)
      function SlimeWander(image_speed = 1){

  • @omniferousswan593
    @omniferousswan593 4 роки тому +5

    lmao I always copy the code through headphones and dont really watch the video, so i can focus on other things at the same time. And I set the variable as "weight" at first and "wait" later.

  • @frostbitgmd
    @frostbitgmd 10 місяців тому

    in the setting a new destination part, when you apply the formulas "xTo = x + lengthdir_x(enemyWanderDistance,dir);" and "yTo = y + lengthdir_y(enemyWanderDistance,dir);", when I execute it, it gives me an error in the part that tells me as if it were not declared, so I skip to that part because I am doing this part of the enemy, so if someone helps me solve that part it would be an honor.

  • @tararandall9475
    @tararandall9475 2 роки тому +1

    If you have not defined vSpeed and hSpeed, then the Slime will not move. You have to add x += hSpeed and y += vSpeed to the top of the SlimeWander script. Was this helpful?

    • @MegaKBang
      @MegaKBang Рік тому

      The 2 links of code you mentioned are in the collisionscript he showed

  • @drewh77
    @drewh77 3 роки тому +1

    My slime is not animating can someone help?? I ran through all my code and copied his one-to-one. The slime moves around perfectly and its collision works as well so I don't know what I did to mess it up.

    • @leorigolo6194
      @leorigolo6194 2 роки тому

      Have you found any solution ? I’m stuck with that problem too.

    • @Joshulml
      @Joshulml 2 роки тому

      @@leorigolo6194 i fixed , my error was Step event of pEnemy:
      depth = -bbox_bottom;
      i forgot the " ; " at the end line, hope works

    • @andreashofmann4556
      @andreashofmann4556 6 місяців тому

      So in the wander script at the start it sets image_speed to 0.0 upon reaching its destination. That's what stops the animation, at least for me, because if i remove those lines the enemy will keep animating (and not stoping when idle). So somewhere the animation is supposed to be resumed again when the enemy is moved but i don't know how or where because it's not in the wander script.

    • @andreashofmann4556
      @andreashofmann4556 6 місяців тому

      I fixed this by adding "image speed = 1;" within the "else" curly brackets { } but that might just be a temporary fix.

    • @andreashofmann4556
      @andreashofmann4556 6 місяців тому

      Woop i'm dumb, it's suppsoed to be there, so maybe you forgot to mess that line of code up too.

  • @AnonymousPanda21
    @AnonymousPanda21 3 місяці тому

    I am so stuck...I have copied the code exactly as it is in the tutorial, and I have googled the issue and searched the comments to see if anyone else has this issue...but for what ever reason when the slime collides with the player it disappears and I cannot for the life of me figure out why and it seems as though I am the only one with this issue...please help...
    PS. LOVE LOVE LOVE the series, it has been phenomenal!!

  • @corzax24_plays7
    @corzax24_plays7 2 роки тому +1

    Anyone having issues with the enemy animation in the Wander state? The animation doesn't play, he just moves around in a single still frame... :(

    • @slimeme64
      @slimeme64 Рік тому

      I have the same issue, have you figured anything out?

    • @slimeme64
      @slimeme64 Рік тому

      Just kidding! at the function of SlimeWander put "image_speed = 1"
      for example: function SlimeWander(image_speed = 1){

  • @SpacemanSpiffRambles
    @SpacemanSpiffRambles 3 роки тому +1

    Hi Shaun! Thank you so much for these videos, they are amazing.
    I am having trouble with this one!
    My enemy moves in 4 directions; I have created my equivalent of sSlime, sSlimeRun, in the same vein as we used sPlayer and sPlayerRun.
    I can not seem to figure out how to get him to wander! I have tried several things, but nothing seems to be working. Any help on how I can have my enemy wander with animations in 4 directions would be amazing. Either way, thank you again for making these videos. Really helping me move forward in my dream of creating a video game!

    • @GandalfofROCK
      @GandalfofROCK 2 роки тому

      I'm trying for 8 directions myself. Remember CARDINAL_DIR? It has to have something to do with that. And when you talkto entities they face which ever direction activated. if we find a way to combine that logic with ENEMYSTATE.WANDER i think we will figure it out. like dir= cardinal_dir/8 and after that i'm lost lol. I'll keep trying.

  • @TheEpicSpire
    @TheEpicSpire 12 годин тому

    my slime hits the wall and then spazes out trying to get away from the wall, but it get stuck and can't exit the tile. EDIT: i turned entityCollision on in the Varible Definitions (inherited from pEntity). once i turned that off, it no longer got stuck. i had it on because i wanted it to collide with pots and signs.. but it is not needed if those entities have their collision on (as a side note, i also have entity collision script from the player pasted into the slime cause i didn't want my creatures crawling over the liftable stones and stuff in the dungeons. it works properly now)

  • @maxmilburn98
    @maxmilburn98 2 місяці тому

    SLIME NOT MOVING ISSUE
    Like some others, my sprite is just staying in place rather than moving. I know my SlimeWander and EnemyTileCollision scripts are working correctly because the sprite moves fine if I change the pEnemy step event to just run SlimeWander().
    This means the error must be something to do with this code in the step event, which I can tell is not running at all:
    if (enemyScript[state] != -1)
    {
    show_debug_message("Wander has been changed") //This never appears
    script_execute(enemyScript[state]);
    }
    I've triple checked that my code is the same as Sara's. Any ideas how to fix this?

    • @Redemption149
      @Redemption149 2 місяці тому

      it's about script_execute, but I'm struggling to find solution

    • @Redemption149
      @Redemption149 2 місяці тому

      / Execute State Machine
      if (!global.gamePaused) {

      if (state >= 0 && state < array_length(enemyScript) && enemyScript[state] != noone) {
      enemyScript[state]();
      } else {

      state = ENEMYSTATE.IDLE;
      }

      depth = -bbox_bottom;
      }
      find the solution, change the Step event for pEnemy

  • @boomroasted926
    @boomroasted926 4 роки тому +1

    Hello Shaun, I have been following your tutorial and just recently completed the melee hitbox video. I was curious if something in GameMaker Studio 2 changed because all of a sudden when I walk with my character the character sprite starts to vibrate. This vibration effect wasn't happening before.

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому

    I made sprMove a variable in the variable definitions with the type Asset, so I can choose the sprite from there instead of having to remember to put it in the create event. Although I still have to set all the scripts anyway. But if I forget the create event, the enemy just does nothing, but at least I'll see him.

  • @professionalquestion5415
    @professionalquestion5415 4 роки тому +4

    My slime is just moving in place... anybody got in idea?

  • @jacob6387
    @jacob6387 2 роки тому

    How could I change the code so that my slimes and enemys can animate in 4 directions like our player sprites?

    • @frtdd6787
      @frtdd6787 2 роки тому +1

      I can show you what worked for me, I changed the bottom part of the EnemyWanderState:
      else //Move Towards New Destination
      {
      timePassed++;


      var _distanceToGo = point_distance(x,y, xTo,yTo);
      var _speedThisFrame = enemySpeed;
      if (_distanceToGo < enemySpeed) _speedThisFrame = _distanceToGo;
      dir = point_direction(x,y,xTo,yTo);
      hSpeed = lengthdir_x(_speedThisFrame,dir);
      vSpeed = lengthdir_y(_speedThisFrame,dir);


      }
      //Collide & Move
      EnemyTileCollision();
      //Update Sprite / Image
      //Update Sprite_Index
      var _oldSprite = sprite_index
      if (x != xTo) && (y != yTo)
      {
      direction = dir
      sprite_index = spriteMove
      } else sprite_index = spriteIdle
      if (_oldSprite != sprite_index) localFrame =0
      PlayerAnimateSprite();
      }

  • @greshnakalsogreshnak8731
    @greshnakalsogreshnak8731 3 роки тому +1

    couldnt figure out why my sprite was stretching randomly, then I realized I was typing while listening instead of watching and put sin(hspeed) not sign(hspeed)

  • @Checkdafloindapo
    @Checkdafloindapo 10 місяців тому

    The collision of my slime isn't working. He just walkes the walls. Can't figure out what i did wrong. Someone maybe got an idea?

  • @whylaffwharff5079
    @whylaffwharff5079 3 роки тому

    Question from the future here!
    Basically, I want the player to be able to control different characters throughout the game. I thought to do this I would set all the code that is in oPlayer into a Parent object I've called pPlayerEntity, and have this little cat character inherit all of the code from that parent. First try and the player object just stands there with the sprite quickly moving through all of the frames making it look like its spinning in place for some reason. Has no ability to react to input, and is definitely not inheriting anything (I purposely started gutting the code of the parent to see if it would cause an error and nothing). I have no idea why the child just wont inherit the parent object code. I made sure it is set accordingly, I made sure I have no code in the child object so it has nothing to run BUT the parent code, and still nothing. I am completely stuck, any ideas?
    it seems to be an issue with inheritance that im missing

    • @yeeahyeeahmike
      @yeeahyeeahmike 2 роки тому

      Hey, I am actually trying to do a very similar thing though I haven't started implementing that yet. Did you find a solution?

  • @fierorecensione5828
    @fierorecensione5828 Рік тому

    thank you

  • @chisatonishikigi9164
    @chisatonishikigi9164 Рік тому

    can anybody explain why its TILE_SIZE - 1; why it isnt just TILE_SIZE
    if (sign(hSpeed) == 1) x += TILE_SIZE - 1;

    • @TheEpicSpire
      @TheEpicSpire 12 годин тому

      because if the orgin point of the sprite is inside of the tile you collide with, you can get stuck. so TileSize-1 makes it so you "collide" 1 pixel away from the tile.

  • @alislandale3391
    @alislandale3391 3 роки тому

    Did anyone else have a problem where the enemy tile collision wasn't working?
    After it didn't work, I tried to be sure and call the original player collision script as well (which definitely works for the player), but that didn't work either. Something's amiss. I'll try and figure it out, but any help would be appreciated ^_^;
    edit: i'm dumb. wayy wayy back in p_entity's room start I messed up the "collision map" statement. ugggggh -_-;;;

    • @kal4935
      @kal4935 Рік тому

      I had a similar issue, for me it was a typo i wrote collitionMap instead of collisionMap.

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому +1

    13:05 The depth is already set in the end step event of pEntity.

  • @lordbrusnic2882
    @lordbrusnic2882 4 роки тому

    Did anyone get this error? script_execute argument 1 incorrect type (undefined) expecting a Number (YYGI32)

    • @Eroseult
      @Eroseult 3 роки тому +2

      I had this error and i solved it by removing "()" at my object creation code.
      enemyFunction[ENEMYSTATE.WANDER] = EnemiesWander"()";
      he mention it next episode at 14:00

    • @lordbrusnic2882
      @lordbrusnic2882 3 роки тому

      @@Eroseult thank you

  • @Deathshuck
    @Deathshuck 2 роки тому

    I hope this will be useful to someone. I copied the whole tutorial letter by letter, but I had an error at the very end. When I started my game, it immediately crashed after the slime tried to move.
    SOLUTION: I completely deleted the last line from EnemyTileCollision script ( return _collision; ) after I deleted that whole line, the game now works perfectly as in the video.

  • @GandalfofROCK
    @GandalfofROCK 2 роки тому +2

    My enemies are using 8 directions. Somehow I have to implement CARDINAL_DIR to the wander script. Wish me luck. I shall return with the answer if i figure it out. If i don't....

    • @jacob6387
      @jacob6387 2 роки тому

      Im just trying to do 4 directions, any progress?

    • @GandalfofROCK
      @GandalfofROCK 2 роки тому +1

      @@jacob6387 with Shaun's teachings you can do it like I did. I made
      var _facing = point_direction(x,y,xTo,yTo);
      *And do you remember the old sprite variable from the oplayer animation episode? You can use that for the enemies as well 😊.
      So make another variable
      var _oldSprite = sprite_index;

    • @jacob6387
      @jacob6387 2 роки тому +2

      @@GandalfofROCK Thank you! I was actually able to figure it out by adjusting the PlayerAnimateSprite Function and instead of inputs I had it based on direction using point_direction(x,y,xTo,yTo) I am still adjusting the enemy functions so I don't have to put EnemyAnimateSprite under each function for them and instead have it work at large unless I have a special animation that is 1 direction like the enemy death!

    • @GandalfofROCK
      @GandalfofROCK 2 роки тому +1

      @@jacob6387 look at us! Coding!!! The cardinal for is a little janky after the update which sucks but I'm sure there's a way to fix that. Good luck on your game. See you in future comment sections

  • @icecold-sc4cj
    @icecold-sc4cj 4 роки тому

    i haven't watched the whole series so i don't have pEntity, and the wander state isn't working, do i need pEntity or did i screw up else where?

    • @jaspercunningham9607
      @jaspercunningham9607 4 роки тому

      I haven't been following either, I just added x = x+hSpeed and y = y+Vspeed and it works fine for me. (no collisions though, obviously)

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому +1

    Are temporary variables actually more efficient if you're gonna be using them (almost) every step? It's constantly deleting variables in order to save a few bytes in between every step and then creating them again. I guess it makes them impossible to hack, but these temporary variables are never gonna be hacked anyway. If people are gonna cheat, they are gonna hack the most important permanent variables like health and money.

  • @superzilla784
    @superzilla784 4 роки тому +1

    What is the next video going to be? one thing I'm looking forward to is a quest system for mission objectives. give the players a list of tasks to complete for them to progress through the game. collect items, kill a monster, move to a location, or talk to someone. then when all these are done, the next quest is triggered
    I hope this'll be soon

    • @SaraSpalding
      @SaraSpalding  4 роки тому +4

      As I said, we'll be developing the enemy further letting him chase the player, hit the player, be hit BY the player, be destroyed by the player, etc. There's a lot to do here.
      We'll have "quest" flags and states eventually as you can tell from playing the demo, it won't be listed on the screen as objectives or whatever but you could easily derive that from the system if you've been understanding the tutorial =)

  • @nastymalone7141
    @nastymalone7141 3 роки тому

    can anybody in the comments help me with the wander script for a platformer enemy. with gravity involved the enemies xstart, and ystart become kind of a nuissance and any suggestions for how i could implement the script to accomodate the wander direction while still using the variables about distance and speed... sorry if i sound like a total n00b but im just trying to work out how others problem solve...

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому +1

    Somehow every slime I add to the room results in me getting another rotating player sprite on top of my head.

    • @AL-lh2ht
      @AL-lh2ht Рік тому

      could be an issue with the lifting code. I had something similar but with the slime sprite above player. The wander designation somehow confused gamemaker into thinking to use the lifting code, but cant throw, no idea why. Fixed by cutting liftimg code to pEnemy inherentence. can't lift enemies but its a fix.
      I also copied some code from comments in their "improvement" of lifting code. No idea why it happened somhow enums getting mixed up for something.

  • @BLUEREAPER-gs5rv
    @BLUEREAPER-gs5rv 3 місяці тому

    as my slime moves it squishes

    • @TheRavikin
      @TheRavikin Місяць тому

      Check lines with image_xscale. For example SlimeWander line 40
      if (hSpeed != 0) image_xscale = sign(hSpeed);

  • @BLUEREAPER-gs5rv
    @BLUEREAPER-gs5rv 3 місяці тому

    Help please

  • @blazecraftedu8194
    @blazecraftedu8194 4 роки тому +1

    Make one tutorial for game like rimworld (sorry for englhis erros im portugueses)

  • @NaudVanDalen
    @NaudVanDalen 2 роки тому

    It's better to use waitDuration = gamespeed_fps;

  • @riley8466
    @riley8466 4 роки тому +3

    Yo! Im early wow!

  • @averagekoolaidenjoyer
    @averagekoolaidenjoyer 4 роки тому

    Nuuuuuhh im late

  • @a1zombieslayer148
    @a1zombieslayer148 3 роки тому +4

    dont be dumb like me another thing that can be causing your slime to animate but not move is if in p_enemy step your 1st or second line is "if (global.gamePaused) it should be if (!global.gamePaused) very easy to miss that !

    • @NightEdog21
      @NightEdog21 2 роки тому

      OH MY GOD THANK YOU. I HAVE BEEN READING COMMENTS FOR HOURS AND REWATCHING THE VIDEO. thanks you so much

    • @WiW14
      @WiW14 2 роки тому

      Lmao! had this exact problem cheers mate

    • @a1zombieslayer148
      @a1zombieslayer148 2 роки тому

      @@WiW14 cheers hope your game goes well!

    • @WiW14
      @WiW14 2 роки тому

      @@a1zombieslayer148 thanks! I actually turned in the completed thing with a couple additions of my own for a school comp sci project :)

    • @a1zombieslayer148
      @a1zombieslayer148 2 роки тому

      @@WiW14 hope you got an a!

  • @TheRavikin
    @TheRavikin Місяць тому

    Anyone in 2024 and later wondering how to fix this error
    ---
    Variable .EnemyTileCollision(100128, -2147483648) not set before reading it.
    at gml_Script_SlimeWander (line 44) - var _collided = EnemyTileCollision();
    ---
    Change
    var _collided = EnemyCollision();
    to
    EnemyCollision();
    Ignore collided variable and leave just the function in SlimeWander line 44 so it will look like this
    // Collide & Move
    EnemyColision();