If anyone is following this in Godot 4, the format for setting up export variables has changed a bit. It looks like this: extends Resource @export var name: String = "Enemy" @export var texture: Texture = null @export var health: int = 30 @export var damage: int = 20
Godot 4 doesn't use yield anymore so be sure to use "await". Here is how I used it for closing the textbox: "await textbox_closed" . And here's how I implemented the timer he creates as well: "await get_tree().create_timer(.25).timeout"
I'm watching this trying to self teach myself to make a classic turn-based RPG as an old man with about 12 hours of experience with Godot. Still seems like magic. Great knowledge here to be gained!
I know it's an older video but better late than never. Just wanted to let you know I learned more about a lot of core aspects of Godot from this video than many other "beginner's guide" videos. Great job explaining stuff in a practical and useful scenario. Thanks.
This is the most informative and concise video I have ever seen demonstrating specific gameplay with godot. I have spent (admittedly not a ton of time) probably 10 or so hours trying to learn, and hardly got anywhere with it. I know a good bit of python and was honestly considering just using pygame before seeing this. Thank you.
This is fantastic, I'm so glad you hit on resources, there is a lot to learn here! Congrats on an amazing tutorial! I'm still finding controls so tricky so your tutorials have been fantastic for helping me get over the fiddlyness :)
Hi, can you please let me know how you were able to create the line for the character attack: "set_health($Background/EnemyHealth/ProgressBar, current_enemy_health)" It gives me an error message saying: "Too few arguments for "set_health()" call. Expected at least 3 but received 2." Edit: Nevermind, I completely missed the next argument somehow lol
Im pretty new at this, so i had to slow my man down to like .5 to catch everything he was doing...hes moving fast but excellent showcase of the basic functions that he is covering.
I like the tutorial. It's basically all I need for my current project. Also I'm planning on making a tutorial series similar to this one in my own language. I hope it works out fine.
This is great! Thank you so much! On a side note i had to watch it at half speed cause you go through everything so fast it's hard to keep up but thank you for this video!
This was an excellent starting point for me! I'm working on a much meatier combat system, but this really helped with the basics of using my stats resources and getting organized!
Great quick video. However, I do wish there was more explanation for certain options you chose or things you did in the video. Otherwise, very straight forward. Thanks!
im following your exact instructions but my player's health bar will not expand i can edit the x value but when i play the scene the health bar is just a sliver.
In Godot 4, the margin properties have been moved from the HBoxContainer into the MarginContainer object in case anyone is having trouble following that part.
Hi, I got up to the point where he was defining the "func set_health(progress_bar, health, max_health):", but I got stuck on the line "progress_bar.get_node("Label").text = "HP: %d/&d" %[health, max_health]". The progress bar doesn't change at all. what should I do? Edit: Nevermind, I just had to chnage it to "HP: %s/&s" %[health, max_health]"
I know that this video is quite old, but is there a way to do screen shake with a shader instead? I don't like the practice of just making the background bigger, say I want to make an fps shake, would I use a shader for that instead?
How can i do this if some enemies have 2 actions per turn ? the enemies are spawned as instanced scenes. i gave the enemies a property called "ActionsPerTurn", and "for n in ActionsPerTurn:" but how would i make it wait until the first action is complete ? there are several attacks the enemies can do and i have a "match" that finds and executes the current action the monster is suppoesed to do. Since i can't do it with signals... i'm lost.
I know this is an older video by now but what do I do if when the enemy attacks my player it subtracts less than my enemies damage on the first attack?
You know, you're using _input(event) incorrectly. You're accessing the Input singleton in the _input callback, instead of using the _input callback's event.
If you want your UI to move with the camera when it shakes instead of having the camera move past the edges of your UI, create a CanvasItem node and make all your UI nodes children of that node. I have the player panel under a CanvasItem node, but any other UI that you don't want to see past the edges should go there too
is it possible to change what the enemy is? like lets say i kill the dragon and want a different enemy for the next level. would i have to make a completely new scene for that or can change the enemy resource in the script
I haven't gone through this whole tutorial yet, but the way I load enemies in my game is (it's a turn-based, 1st person dungeon crawler), for each step, I roll an encounter against a player's stat, if it fails it encounters an enemy. Then I roll a random bit with player's luck added in right, and it pulls from a list of enemies stored for that floor. Not to get too complicated but basically that list is made up of packed scenes. So how I would do it is make a scene and just change out the enemy in that scene - code the enemy AI and stick that as a child on that scene. Then when you load whatever enemy it picked, everything you need is right there. Any other questions, happy to answer them. Cheers!
Double check your logic for when you are reducing the current_player_health or current_enemy_health. You can reference the source code directly here: github.com/jontopielski/Turn-Based-Combat/blob/master/src/Battle.gd
Please put RPG game tutorial, slow down basic attacks and skills (not turn-based) replace (turn-based battles) with (time in basic attacks and skills) with (icons-buttons) please tutorial 🙏🙏🙏
I keep getting an error that says the indentifier "State" isn't declared in the current scope" when trying to access the State.gd script. How do I fix this?
This is so difficult to watch as a beginner. I have to pause incredibly often and with great precision, because when he writes something, he'll only display it for a couple of frames and then quickly jump somewhere else, implying that whatever he's done is so obvious that viewers shouldn't even need to see it.
If anyone is having trouble with the "yield(self, "textbox_closed")" at 11:25 in GoDot 4. I used "await self.textbox_closed" and it worked. My problem was that the game didn't wait for the textbox to close. I hope this helps anyone
small issue I have, on the line: progress_bar.get_node("Label").text = "HP:%d/%d" % [health, max_health] when I run it in game it tells me: Invalid set index 'text' (on base: 'null instance') with value of type 'String'. can someone help? figured it out, had to make the Label a unique name
If anyone is following this in Godot 4, the format for setting up export variables has changed a bit. It looks like this:
extends Resource
@export var name: String = "Enemy"
@export var texture: Texture = null
@export var health: int = 30
@export var damage: int = 20
Big thanks, was looking for this comment exactly!
understood the assignment
Thanks! It helped
Does anyone know how to fix the breaking point after I put
set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
You're a god send
Godot 4 doesn't use yield anymore so be sure to use "await". Here is how I used it for closing the textbox: "await textbox_closed" . And here's how I implemented the timer he creates as well: "await get_tree().create_timer(.25).timeout"
very helpful, thank you
sweet, thx!
You're so sweet,thanks for help
I learned more about the UI nodes in 8 minutes from this guy than I have from any other tutorial.
Same! And the worst part is, they changed them afterwards, so now I don't understand it anymore.
@@hiiambarney4489 So true,there are too many changes between 3.x & 4.x
This is such a nice intermediate tutorial. no waffle or overexplaining, just "here's what i did". I'd love to see more like this.
This was, by far, the best tutorial that I've seen for turn based combat in Godot. I'm so happy that I found this tutorial. Great job!!!
I'm watching this trying to self teach myself to make a classic turn-based RPG as an old man with about 12 hours of experience with Godot. Still seems like magic. Great knowledge here to be gained!
I know it's an older video but better late than never. Just wanted to let you know I learned more about a lot of core aspects of Godot from this video than many other "beginner's guide" videos. Great job explaining stuff in a practical and useful scenario. Thanks.
The view count does not do justice to the insanely good informative content! Learnt a lot, Thank you! Hope your channel blows up!
This is the most informative and concise video I have ever seen demonstrating specific gameplay with godot. I have spent (admittedly not a ton of time) probably 10 or so hours trying to learn, and hardly got anywhere with it. I know a good bit of python and was honestly considering just using pygame before seeing this. Thank you.
Great tutorial. I didn't know you could yield to signals in that way, very helpful!
This is fantastic, I'm so glad you hit on resources, there is a lot to learn here! Congrats on an amazing tutorial! I'm still finding controls so tricky so your tutorials have been fantastic for helping me get over the fiddlyness :)
Omg I actually managed to re-create everything you did, even 2 years later(with some minor tweaks ofc). Thank you so much!
Hi, can you please let me know how you were able to create the line for the character attack: "set_health($Background/EnemyHealth/ProgressBar, current_enemy_health)"
It gives me an error message saying:
"Too few arguments for "set_health()" call. Expected at least 3 but received 2."
Edit: Nevermind, I completely missed the next argument somehow lol
Im pretty new at this, so i had to slow my man down to like .5 to catch everything he was doing...hes moving fast but excellent showcase of the basic functions that he is covering.
Really great. I learned a lot about the use of yield and creating resources. Thanks!
Without a doubt, the best turn based tutorial. Please make more content like this, it has been so helpful!
I'm convinced you are the fastest typer on the planet
¡Gracias!
Saved for Sunday when I'm done with my exams season... TYSM!
Greatly appreciated. Glad I subscribed.
Great job, really liked how you made the video: super clear, fast and efficient
The new export format for the "enemy" resource variable looks like this: "@export var enemy: Resource = null"
This video is helped me a TON with my project.I wish you all the best!
One of the best tutorials I saw!
Thank you
Thank you a lot! Using resources to create different enemies is a very handy solution.
I like the tutorial. It's basically all I need for my current project. Also I'm planning on making a tutorial series similar to this one in my own language. I hope it works out fine.
Thank you! Very helpful concepts.
Ja pierdole zajebisty poradnik koleś, wielkie dzięki, doceniam!
Thanks man for this tutorial
This is great! Thank you so much! On a side note i had to watch it at half speed cause you go through everything so fast it's hard to keep up but thank you for this video!
This was VERY informative. Thank you!
Got the notifications activated so I won't miss your next video. No pressures tho
This was an excellent starting point for me! I'm working on a much meatier combat system, but this really helped with the basics of using my stats resources and getting organized!
Such an amazing video !!!
Thank you, a lot! This video teaches me more than another tutorial.
this is amazing thank you! if you ever want to expand this video into a series, that would be amazing!
Great quick video. However, I do wish there was more explanation for certain options you chose or things you did in the video. Otherwise, very straight forward. Thanks!
Thank you! Great tutorial!
You are a hero thank you!!!
ty, very nice tutorial u helped me a lot
im following your exact instructions but my player's health bar will not expand i can edit the x value but when i play the scene the health bar is just a sliver.
In Godot 4, the margin properties have been moved from the HBoxContainer into the MarginContainer object in case anyone is having trouble following that part.
How do you handle multiple enemies?
How will the targetting system be like?
to get timer to work in godot 4+ (I'm using 4.2):
await(get_tree().create_timer(0.25).timeout)
Thank you very much
Does anyone know how to change the enemy through code instead of dragging in the editor.
Hi, I got up to the point where he was defining the "func set_health(progress_bar, health, max_health):", but I got stuck on the line "progress_bar.get_node("Label").text = "HP: %d/&d" %[health, max_health]". The progress bar doesn't change at all. what should I do?
Edit: Nevermind, I just had to chnage it to "HP: %s/&s" %[health, max_health]"
I know that this video is quite old, but is there a way to do screen shake with a shader instead? I don't like the practice of just making the background bigger, say I want to make an fps shake, would I use a shader for that instead?
Speed run
How can i do this if some enemies have 2 actions per turn ? the enemies are spawned as instanced scenes.
i gave the enemies a property called "ActionsPerTurn", and "for n in ActionsPerTurn:" but how would i make it wait until the first action is complete ? there are several attacks the enemies can do and i have a "match" that finds and executes the current action the monster is suppoesed to do. Since i can't do it with signals... i'm lost.
I know this is an older video by now but what do I do if when the enemy attacks my player it subtracts less than my enemies damage on the first attack?
didn't underrstand anything, 10/10, thanks bro
When I try to attack again the health bar stays the same, pls some help
You know, you're using _input(event) incorrectly. You're accessing the Input singleton in the _input callback, instead of using the _input callback's event.
If you want your UI to move with the camera when it shakes instead of having the camera move past the edges of your UI, create a CanvasItem node and make all your UI nodes children of that node. I have the player panel under a CanvasItem node, but any other UI that you don't want to see past the edges should go there too
how can i replace the rectTexture with animated sprite in the code?
This tutorial is so dam good, I learn a lot from this.
thank you for making this great tutorial for us.
How would i take this and trsition a 3d world into this scene?
Ok how would you go about making like, a magic option or something? Like how would you make it so you could have a menu then pick a spell
where was the function enemy turn first written in the project
How would you do this if both players are attacking each other at the same time? Like an Auto-battler.
Nice video
is it possible to change what the enemy is? like lets say i kill the dragon and want a different enemy for the next level. would i have to make a completely new scene for that or can change the enemy resource in the script
I haven't gone through this whole tutorial yet, but the way I load enemies in my game is (it's a turn-based, 1st person dungeon crawler), for each step, I roll an encounter against a player's stat, if it fails it encounters an enemy. Then I roll a random bit with player's luck added in right, and it pulls from a list of enemies stored for that floor. Not to get too complicated but basically that list is made up of packed scenes. So how I would do it is make a scene and just change out the enemy in that scene - code the enemy AI and stick that as a child on that scene. Then when you load whatever enemy it picked, everything you need is right there.
Any other questions, happy to answer them. Cheers!
When I followed your tutorial, the damage stops at 20 Hp, and 15Hp when the enemy attack, why?
Double check your logic for when you are reducing the current_player_health or current_enemy_health. You can reference the source code directly here: github.com/jontopielski/Turn-Based-Combat/blob/master/src/Battle.gd
@@jontopielski6227 Done, I just need to change -= to =
make a part 2
my sprite keeps disappearing whenever i put it into a vbox container :/
Please put RPG game tutorial, slow down basic attacks and skills (not turn-based) replace (turn-based battles) with (time in basic attacks and skills) with (icons-buttons) please tutorial 🙏🙏🙏
I keep getting an error that says the indentifier "State" isn't declared in the current scope" when trying to access the State.gd script. How do I fix this?
did you figure it out?
edit: nvm i just did. the name on the autoload wasnt the same so just make sure it matches with your code
This is so difficult to watch as a beginner. I have to pause incredibly often and with great precision, because when he writes something, he'll only display it for a couple of frames and then quickly jump somewhere else, implying that whatever he's done is so obvious that viewers shouldn't even need to see it.
Hello! I hope this doesn't come off as rude, but you could watch this video at a slower playback speed
Nive video tutorial but a bit long no ? 😁
If anyone is having trouble with the "yield(self, "textbox_closed")" at 11:25 in GoDot 4. I used "await self.textbox_closed" and it worked.
My problem was that the game didn't wait for the textbox to close. I hope this helps anyone
small issue I have, on the line: progress_bar.get_node("Label").text = "HP:%d/%d" % [health, max_health]
when I run it in game it tells me: Invalid set index 'text' (on base: 'null instance') with value of type 'String'.
can someone help?
figured it out, had to make the Label a unique name
Does anyone know how to fix the breaking point after I put
set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
Thank you so much