How to create a Turn-based Combat System in Godot

  Рет қаралды 89,005

Jon Topielski

Jon Topielski

Күн бұрын

Пікірлер: 102
@zebwest8152
@zebwest8152 Жыл бұрын
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
@sableeyedscholar2135
@sableeyedscholar2135 Жыл бұрын
Big thanks, was looking for this comment exactly!
@ChuRu386
@ChuRu386 Жыл бұрын
understood the assignment
@Kamu34474
@Kamu34474 Жыл бұрын
Thanks! It helped
@Beibai
@Beibai Жыл бұрын
Does anyone know how to fix the breaking point after I put set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
@documentcamera8807
@documentcamera8807 Жыл бұрын
You're a god send
@RegentStatue745
@RegentStatue745 Жыл бұрын
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"
@redbul17
@redbul17 9 ай бұрын
very helpful, thank you
@jessg0
@jessg0 4 ай бұрын
sweet, thx!
@赵昕昊
@赵昕昊 4 ай бұрын
You're so sweet,thanks for help
@slundal
@slundal 2 жыл бұрын
I learned more about the UI nodes in 8 minutes from this guy than I have from any other tutorial.
@hiiambarney4489
@hiiambarney4489 Жыл бұрын
Same! And the worst part is, they changed them afterwards, so now I don't understand it anymore.
@赵昕昊
@赵昕昊 4 ай бұрын
@@hiiambarney4489 So true,there are too many changes between 3.x & 4.x
@PostFrontier
@PostFrontier 2 жыл бұрын
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!!!
@rhos-gfx
@rhos-gfx 7 ай бұрын
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.
@RuneDShyznit
@RuneDShyznit 2 ай бұрын
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.
@Animosity00
@Animosity00 2 жыл бұрын
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!
@RegentStatue745
@RegentStatue745 Жыл бұрын
The new export format for the "enemy" resource variable looks like this: "@export var enemy: Resource = null"
@thoof7589
@thoof7589 2 жыл бұрын
Great tutorial. I didn't know you could yield to signals in that way, very helpful!
@owletstree9523
@owletstree9523 7 ай бұрын
Omg I actually managed to re-create everything you did, even 2 years later(with some minor tweaks ofc). Thank you so much!
@Abel-fu1xq
@Abel-fu1xq 7 ай бұрын
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
@azaratowcanica2639
@azaratowcanica2639 2 жыл бұрын
The view count does not do justice to the insanely good informative content! Learnt a lot, Thank you! Hope your channel blows up!
@ScarlettTheViewer
@ScarlettTheViewer 5 ай бұрын
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.
@rungeon83
@rungeon83 2 жыл бұрын
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 :)
@jackiewatkins1830
@jackiewatkins1830 Жыл бұрын
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.
@maranr
@maranr 2 жыл бұрын
Really great. I learned a lot about the use of yield and creating resources. Thanks!
@aneerudh1712
@aneerudh1712 2 жыл бұрын
I'm convinced you are the fastest typer on the planet
@rockerhelgeson
@rockerhelgeson 2 жыл бұрын
Without a doubt, the best turn based tutorial. Please make more content like this, it has been so helpful!
@teo2805
@teo2805 2 жыл бұрын
Saved for Sunday when I'm done with my exams season... TYSM!
@mythology100
@mythology100 2 жыл бұрын
Greatly appreciated. Glad I subscribed.
@filippobegna3512
@filippobegna3512 2 жыл бұрын
Great job, really liked how you made the video: super clear, fast and efficient
@javleds
@javleds 6 ай бұрын
¡Gracias!
@Blackmamba136
@Blackmamba136 Жыл бұрын
One of the best tutorials I saw! Thank you
@gustavoalmeidadaribeira1740
@gustavoalmeidadaribeira1740 Жыл бұрын
This video is helped me a TON with my project.I wish you all the best!
@andersonmaia5767
@andersonmaia5767 2 жыл бұрын
Thank you a lot! Using resources to create different enemies is a very handy solution.
@brotherkito
@brotherkito 3 ай бұрын
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.
@KEKEISYOU
@KEKEISYOU 2 жыл бұрын
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!
@lutherbrown8873
@lutherbrown8873 Жыл бұрын
to get timer to work in godot 4+ (I'm using 4.2): await(get_tree().create_timer(0.25).timeout)
@wisiel3861
@wisiel3861 10 ай бұрын
Ja pierdole zajebisty poradnik koleś, wielkie dzięki, doceniam!
@SodaFountainJoy
@SodaFountainJoy 2 жыл бұрын
Thank you! Very helpful concepts.
@theleeyawnshow
@theleeyawnshow 2 жыл бұрын
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.
@lukasmorrow8255
@lukasmorrow8255 2 жыл бұрын
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!
@MH-lr6ue
@MH-lr6ue 2 жыл бұрын
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.
@RicardoDavilaTejano
@RicardoDavilaTejano 2 жыл бұрын
This was VERY informative. Thank you! Got the notifications activated so I won't miss your next video. No pressures tho
@buzzbuzz20xx
@buzzbuzz20xx 2 ай бұрын
Such an amazing video !!!
@musicdudem6673
@musicdudem6673 2 жыл бұрын
this is amazing thank you! if you ever want to expand this video into a series, that would be amazing!
@arttopix7224
@arttopix7224 Жыл бұрын
Thank you, a lot! This video teaches me more than another tutorial.
@gomm888
@gomm888 Ай бұрын
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
@anton.s6882
@anton.s6882 2 жыл бұрын
Thanks man for this tutorial
@shadow-jc3vp
@shadow-jc3vp 11 ай бұрын
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!
@Abel-fu1xq
@Abel-fu1xq 7 ай бұрын
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]"
@AgriasOaks99
@AgriasOaks99 9 ай бұрын
How do you handle multiple enemies? How will the targetting system be like?
@keriganknowles2818
@keriganknowles2818 10 ай бұрын
Does anyone know how to change the enemy through code instead of dragging in the editor.
@EthernalOynuyor
@EthernalOynuyor Жыл бұрын
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.
@ForgottenLight15
@ForgottenLight15 2 жыл бұрын
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.
@ropepores4688
@ropepores4688 Жыл бұрын
Thank you! Great tutorial!
@MassiveBreaker
@MassiveBreaker 2 жыл бұрын
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?
@sanagunx3345
@sanagunx3345 2 жыл бұрын
This tutorial is so dam good, I learn a lot from this. thank you for making this great tutorial for us.
@DomZaddy
@DomZaddy 2 жыл бұрын
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?
@ZDitohyt
@ZDitohyt Жыл бұрын
When I try to attack again the health bar stays the same, pls some help
@broyal_gamers1237
@broyal_gamers1237 Жыл бұрын
You are a hero thank you!!!
@PotatoisDry
@PotatoisDry 2 жыл бұрын
how can i replace the rectTexture with animated sprite in the code?
@the-birbo
@the-birbo 2 ай бұрын
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
@KamiSanzo
@KamiSanzo 6 ай бұрын
didn't underrstand anything, 10/10, thanks bro
@justarandomgamer5648
@justarandomgamer5648 7 ай бұрын
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
@Moboscrub
@Moboscrub 11 ай бұрын
How would you do this if both players are attacking each other at the same time? Like an Auto-battler.
@seedofstun
@seedofstun Жыл бұрын
my sprite keeps disappearing whenever i put it into a vbox container :/
@sdalfbg
@sdalfbg Жыл бұрын
ty, very nice tutorial u helped me a lot
@MYNDsEYE
@MYNDsEYE 4 ай бұрын
How would i take this and trsition a 3d world into this scene?
@irrelevantjoshwaa6156
@irrelevantjoshwaa6156 2 жыл бұрын
where was the function enemy turn first written in the project
@nerbles7472
@nerbles7472 Жыл бұрын
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
@ghostradiodelete
@ghostradiodelete 10 ай бұрын
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!
@anton.s6882
@anton.s6882 2 жыл бұрын
When I followed your tutorial, the damage stops at 20 Hp, and 15Hp when the enemy attack, why?
@jontopielski6227
@jontopielski6227 2 жыл бұрын
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
@anton.s6882
@anton.s6882 2 жыл бұрын
@@jontopielski6227 Done, I just need to change -= to =
@HProductionsish
@HProductionsish 8 ай бұрын
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?
@yahirfuentes4713
@yahirfuentes4713 5 ай бұрын
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
@truenincillo805
@truenincillo805 3 ай бұрын
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 🙏🙏🙏
@entityunknown2
@entityunknown2 Жыл бұрын
Speed run
@Ashiira
@Ashiira Жыл бұрын
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.
@marcelroman6639
@marcelroman6639 7 ай бұрын
Hello! I hope this doesn't come off as rude, but you could watch this video at a slower playback speed
@muziklol69
@muziklol69 2 жыл бұрын
make a part 2
@suthamonhengrasmee8182
@suthamonhengrasmee8182 2 жыл бұрын
Thank you very much
@rvn4
@rvn4 2 жыл бұрын
Nice video
@gofastutos
@gofastutos 2 жыл бұрын
Nive video tutorial but a bit long no ? 😁
@justarandomgamer5648
@justarandomgamer5648 9 ай бұрын
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
@Beibai
@Beibai Жыл бұрын
Does anyone know how to fix the breaking point after I put set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
@cartian8039
@cartian8039 10 ай бұрын
Thank you so much
How Do You Improve Turn Based Combat?
17:43
Design Doc
Рет қаралды 806 М.
Programming a tactical strategy game in Godot 4
14:50
The Shaggy Dev
Рет қаралды 25 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 63 МЛН
I recreated Balatro's effects in Godot
8:04
MrElipteach
Рет қаралды 46 М.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 1 МЛН
Custom Resource are a MUST KNOW in Godot | Complete Tutorial
32:10
How to make a tactics game in only two weeks
19:00
The Shaggy Dev
Рет қаралды 84 М.
Victim - Animator vs. Animation 11
20:24
Alan Becker
Рет қаралды 6 МЛН
Godot 4 - Tiled Dungeon Environment From Scratch
26:24
DevLogLogan
Рет қаралды 444 М.
Every 2D Node Explained in 9 Minutes !
9:19
Lukky
Рет қаралды 382 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 251 М.
Godot UI & Control Node Crash Course
20:11
StayAtHomeDev
Рет қаралды 9 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 63 МЛН