Make a Pokemon Game in Godot - Tall Grass (#5)

Поділитися
Вставка
  • Опубліковано 9 лют 2025

КОМЕНТАРІ • 53

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

    shamelessly commenting purely for engagement because you're content is good and deserves attention

  • @numijulie
    @numijulie 3 роки тому +5

    I have been mostly skimming through these videos in between classes and assignments but your tutorials are so high quality, thanks for the info!

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

      Glad you like them!

  • @mewblue3997
    @mewblue3997 3 роки тому +5

    I was struggling with this exact thing for the last couple of days. Thanks for the tutorial

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

    Thank you! This is fire! Hoping your community grows HUUGE!! This content deserves it! Will be sharing with everyone!

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

    The signal connection line in the TallGrass ready function was very helpful.

  • @nate_venture
    @nate_venture 5 місяців тому +1

    Instead of convoluted code to add on an overlay, I'd recommend just making your art to accommodate overlapping the player via the Y-sorting you'll already be using. Meaning divide the art into 2 separate sprites (essentially the current sprite as a back + a modified front sprite showing what you want in front of the player sprite) and then composite them as 2 sprites within the node. Adjust position and offset as necessary so that the back is a higher Y value than the front portion, and the effect is achieved. Both sprites will need their idle an step animation version in the graphic, and both have to be added to the animation track. But it requires no additional code, only for you to think when making your art asset.

  • @ItsKeils
    @ItsKeils 4 місяці тому

    In Godot 4, you can easily add scenes directly to the tilemap, which helps keep the inspector from getting cluttered with nodes.
    1. Go to your TallGrass tilemap layer.
    2. In the tileset options at the bottom of the editor, where the + icon is for adding an atlas, there is another option called Scenes Collection. Add the TallGrass scene to the tilemap.
    3. Paint the scene on the map

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

    Excellent tutorial trying to combine this now with wild pokemon encounters and battle scenes is tough but your video helped massively

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

      Glad to be of help. I do plan on making tutorials on wild pokemon encounters & battle scenes eventually!

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

    Signalling In Godot 4,
    make sure the Town script has these variable:
    @onready var player = $Player
    @onready var grasses = $Grasses (this is the Node2D that has all the tall grass objects under it)
    in the same script
    func _ready():
    for grass in grasses.get_children():
    player.connect("player_stopped_signal", Callable(grass, "player_in_grass"))
    player.connect("player_moving_signal", Callable(grass, "player_exiting_grass"))
    in the tall grass script,
    grass_overlay.position = position (not rect_position)
    This will trigger it.
    Although had some issues where certain directions inside the grass didnt trigger the overlay but for the most part worked

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

    Highlight of my day

  • @kyle-cg9mv
    @kyle-cg9mv 4 місяці тому +2

    In Godot 4.3 when testing the grass overlay with signals at 10:06 in the video I got the error "nonexistent function 'find_node' in base Node2D". and since I didn't want to read the docs on what they changed with signals and as another comment said even doing it with the new syntax etc still results in weird results from walking into the grass from certain directions.
    I've come up with a semi "jank" solution that does work, First I made a texture Rect manually in the player scene and for its texture added the trampled grass png and tried to line it up to where the character would be hidden in the grass. and then played the game and adjusted to make sure it looked alright when i walked over the grass then I hid the Rect using the "eyeball" icon that shows beside the node.
    Next I slimmed down the body entered function and I only have anim_player.play("Grass_trampled") and a check before hand to make sure its the player that entered the body and not another body. your animation name is called something else whatever he named it I renamed mine.
    I also added a func _proccess(delta: float) -> void: function and inside there I added
    if $"../../Player".is_moving == true:
    $"../../Player/Grassoverlay".hide()
    self.show()
    your player reference will be different so just drag and drop the player node into the editor and itll grab the proper "path" the Grassoverlay is what i called my texture rect in the player scene.
    I also added a new function called func show_grass_overlay():
    which has the following inside it:
    if $"../../Player".is_moving == false:
    $"../../Player/Grassoverlay".show()
    self.hide()
    this new func gets called when the grass trample animation ends same thing he showed in a previous tutorial on how to call a func from the anim player.
    Please keep i'm mind everything else he did I commented out and anything past 10:06 in the video he does for the leaf particle effect should still work. Hope this helps someone!
    EDIT: NOPE leaf stuff is different in Godot 4, here's the fix: in the grass step effect script under the ready function you only need frame = 0 and in the on animation finished just keep the queue_free() line.
    Since i got rid of all his other code you can do everything he does with the variable that holds the preloaded scene but then the add child code can be put in the body entered function also keep in mind in Godot 4 its not longer GrassStepEffect.instance() and the proper syntax is now GrassStepEffect.instantiate()
    Hope this helps and if anything in his later videos is borked in 4.0+ ill make a comment happy coding everyone!
    EDIT 2: the grass effect seems to spawn quite high when you walk up through it could just be my eyes buggin but i added a marker2D node to the tall grass scene and placed it lower middle on the sprite and then instead of grass_step_effect.position = position I did grass_step_effect.position = $Marker2D.global_position I had to do global since it spawns off screen you maybe can get away with just $Marker2D.position. doing this also gives you more control as to where to spawn your effects etc.

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

    I found an improvement to the grass overlay! I noticed in the real game the grass covers you a bit more, while in this version it only pops up for the SLIGHT split second that you're centered on the tile. Walking straight through multiple grass tiles shows only the slightest frame of grass overlay which might as well not even be there.
    To fix this, simple move the grass_overlay lines in player_in_grass() to _on_Area2D_body_entered() instead :)

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

      But how van i fix this now that i converted the grass in a tilemap?

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

    A cool thing to do is to have a tilemap with a script that replaces certain tiles with the grass scene, that way is is way easier to make levels

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

    I spent way- too much time trying to get this damn grass overlay to work lol. I got it though. Thanks for the tut

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

    I found a way to put tall grass with all of it´s effects in a tilemap:
    1. delete every node under the tallgrass root node
    2. add a tilemap and add a tileset of both different grass tiles as single tiles.
    at first the normal and seccond the squeezed one.
    3. in the script delete the _on_Area2D_body_entered and sisconnect it´s signal.
    4. add a pos variable above the functions and set the player position to it as the first line in the player_in_grass function.
    5. remove the player_inside variable.
    6. instead check inside the player_in_grass function with get_cellv and world_to_map fron the tilemap, if the player is on a tile of the first grass-tile by using the pos-variable the id od this grass-typr should be 0.
    7. with set_cellv set this cell to the squeezed variant
    8. in the player_exiting_grass set the cell back to the normal grass before freeing the overlay-rectangle
    9. where the particles and overlay are generated use the pos variable instead of the node integrated position to make them appear at the player.
    so you have the grass stored in a tilemap. and cleaned up the scenetree of the city.
    I think, you can put every small landscape decoration, that needs no y-sort and no collision-shape in this tileset.
    the script checks only if the player is in the tall grass so other tiletypes will not be affected by some effects.
    And inside this effect area of the code is also a good location to code pokemon spawning, maybe with a rand_range, that goes from 1-8 anf if it says 8, open a fight-screen with a pokemon, that is choosen by some more randomizers.

    • @salmeleons
      @salmeleons 7 місяців тому

      if anyone wants to do this in godot 4, theres a quicker solution
      godot 4 added "scene collections" in the tilesets. if you press the + theres an option to add a scene collection, and you can just drag whatever scene you want from the file explorer and put it in there

  • @jlee900
    @jlee900 7 місяців тому +1

    in godot4, when i try to implement the grass overlay scripts, i keep getting an error for func(_ready) since find_node is not a function of node2d apparently. has anyone solved this?

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

    Please don't stop this tutorial xD

  • @SkippyTheMagnificent
    @SkippyTheMagnificent 8 місяців тому

    Thanks, will definitely send you a free copy of my game one day

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

    Keep up the tutorials they are great, maybe a quest system in the future?

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

      Possibly, but maybe not for this series. I don't think Pokemon has a quest system, does it?

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

    Hi I did the exat same thing and followed all your steps but the grass_overlay just won't work right it's always like 7 tiles away from the player.
    I just don't know why.
    Can anyone help please :(

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

    I can't get the "chopping" effect on my player character. I've followed exactly what you've done and still it's not working
    Edit: I managed to fix it. i had forgotten to set the player_inside bool to true in Area2D_body_entered -_-

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

    There is a problem that if you put a grass tile directly above a tree, the overlay and the stepping effect are rendered on top of the tree. didn´t find a fix for this yet.

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

      if you go into the tree scene (tree.tscn) and click on the tree node, you can change the z_index parameter of the tree from 0 to 1. This will fix the issue.

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

    Screen transition on random grass is the next video right? That's what I was looking for months..^_^

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

      There's a couple of thing I want to go over before wild pokemon encounters if that's what you are talking about

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

    I don't know how, but for some reason the grass overlay appears at head level instead of at the feet even though I've followed all tutorials to a T so far. Any clue what's the issue?

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

      Oh that might be due to the fact that i updated the image for grass overlay. Try again with the updated image in the github repo.

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

      @@Arkeve That would be it, much appreciated! I did check that when it didn't work the first time, but it looks like it still had the old files.

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

    I checked the layer orders, but when my character enters the grasses, the upper grass tile will overlay some of the character's head. What could I go wrong? Thanks!

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

      Another problem is that after I step on a particular grass tile, the tile will load GrassStepEffect by every movement, even not on the grass.

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

      Don't know if you've moved on but I had the same problem and fixed it. I am just explain in case anyone ever reads this again. In fact I simply changed the collision shape so that it's only the upper third of the square. So instead of position 8/8 it's now 8/4 and instead of size 7/7 it's 7/3. This could affect other stuff like managing pokemon encounters upon entering a square. However I don't think this is actually relevant because you cannot move halfway on a square.

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

    For some reason I cant get the grass overlay to display at correct location. It always appears a few steps above the player. I even attempted to change to a sprite instead of a TextureRect and I experience same results. Anyone know how to fix?

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

      I ended up just adding another sprite, setting z layer to 2 and setting visibility to false during startup, then changing visibility flag during your functions instead

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

      im having this probkem now

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

    Hey, could you make a tutorial on a mining system? I am working on a terraria type game and changing tiles and animations was confusing me.

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

      I'll possibly go over a mining system in the future! Thanks for letting me know

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

    Yeah but what if I wanna see my feet?

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

    Hey bro! Would you post more often that once a week?
    Would you go over the Pokémon battle in Godot, Pokémon stats and that stuff??
    Thanks!

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

      I'll try to post more often, just don't have much time. But I definitely plan on going over Pokemon battle system along with Pokemon stats/moves.

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

      @@Arkeve glad to hear that! You have all the full support of your audience!

    • @Arkeve_did_not
      @Arkeve_did_not 4 місяці тому +1

      @@Arkeve you did not