No video

Writing a Command Parser (Godot Retro Text Adventure Tutorial #6)

  Рет қаралды 11,983

jmbiv

jmbiv

Күн бұрын

Пікірлер: 48
@philnewberryls
@philnewberryls Жыл бұрын
The fact you have explained your thought process behind your decisions... it's just amazing, man. Thank you so much for making these invaluable resources.
@glingusman
@glingusman 9 ай бұрын
In godot 4.0, turn autowrap to word and set the minimum container size of the input history and response boxes to x=~1000, its the only way itll work
@Colyde25
@Colyde25 8 ай бұрын
For Godot 4.0+ users, be sure to change the auto wrap to word or word (smart) in the Reaponse.tscn scene. As for expanding the Container sizing I found Custom Min size 1000 x 100px was perfect & you do not need to check the expand for it to work.
@AutMouseLabs
@AutMouseLabs 3 жыл бұрын
I am pretty proficient in gdscript and initially came to this series mostly for the specific genre aspect. The primary content is excellent but I have also been learning so much about why things work the way they do that I didn't know before. I appreciate your explanations immensely.
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
I'm so glad to hear that, thanks for the kind words, it means a lot!
@pompyproductions5644
@pompyproductions5644 2 жыл бұрын
"...but this time, it's happening!" gold energy!
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
😂
@darkvioletcloud
@darkvioletcloud Жыл бұрын
I think I've been commenting on every one of these tutorials but I need to reiterate how helpful this series is, and how it actually makes me feel like I can create a game rather than just having my head in the clouds! You're so good at explaining things in a succinct and informative way to someone whose only prior coding knowledge is basic HTML things for webpages. I should do the Learn GDScript From Scratch one of these days, but following from a video tutorial feels much more hands-on and informative than just an interactive webpage.
@DarkMac
@DarkMac 2 ай бұрын
So a bit late response on that. At 16:33 instead of return "You go %s" % second_word we can use the functionality of concatenating strings (which was touched upon in previous videos) and do: return "You go " + second_word Which in my own personal opinion is much more readable. Also possible to add more variables: return "You go " + second_word + some_other_string or even go complete bananas on it: return "You go " + second_word + " so now can go " + banana_action + "!" + " And so on..."😄 Edit: some minor typos.
@nosdregamon
@nosdregamon 3 жыл бұрын
Thank you very much. Makes me really curious about command parsers and gives quite some ideas, what may come next, like aliasing ("treat walk as 'go' ") and how to interact with in game items (like checking if an item exist at current location and what supposed to work on it and so on). I'll do a little research as additional homework :)
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
I'm glad that this gave you some ideas to keep moving forward! We'll tackle moving between rooms next but definitely will also get to items. I'd love to see any other additions you make on your own!
@croll_uk
@croll_uk 3 жыл бұрын
Nice. I'm really enjoying this series. I might have to rewatch a few sections but it's slowly sinking in :D
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
Glad you're enjoying it and feel like it's sinking in!
@mickauls_
@mickauls_ 10 ай бұрын
In Godot 4, You have to make Autowrap Mode set to Word (Smart). Remember, you have to do this for the response.tscn becuase that's what the welcome message is using to print. It's not using the InputResponse.tscn like all the other responses. You have to make the changes to both prefabs.
@lucasbaumgartner689
@lucasbaumgartner689 10 ай бұрын
It is not working for me, it keeps separating word by word. How did you do it?
@glingusman
@glingusman 9 ай бұрын
@@lucasbaumgartner689 set the minimum content size of the response and input history boxes to about x= ~1000
@aboodispam
@aboodispam 3 жыл бұрын
Amazing High quality tutorials thanks for helping out the me and the rest of the godot community
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
No problem, so glad you're finding them helpful!
@bank8489
@bank8489 Жыл бұрын
honestly thank you so much for this series, it was finally the one that helped me understand godot and gdscript and gave me enough drive to actually go and make a game. thank you.
@TheBeginningOfMusic
@TheBeginningOfMusic 3 жыл бұрын
Amazing content, thanks so much for doing this!
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
No problem, thanks for watching!
@lunyxappocalypse7071
@lunyxappocalypse7071 2 жыл бұрын
15:05 [When it comes to the default with the function 'go'. Recent versions use return.]: func go(second_word: String) -> String: if second_word == "": return "go where?" else: return "you go %s"%second_word #NOTE: Use array to use multible strings.
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Is your comment just suggesting that we can use the %s syntax to interpolate a string value? If so, thanks for bringing that up, I'm sure others will find it helpful! (We also use that syntax quite a bit as the series goes on)
@Bobbyhiddn
@Bobbyhiddn Жыл бұрын
This is fantastic! I haven't seen such a clear tutorial yet! Looking forward to finishing it off and looking at your other work!
@julesyoung6571
@julesyoung6571 3 жыл бұрын
Hell yeah, love this
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
Glad to hear, thanks for watching!
@yuli3873
@yuli3873 2 жыл бұрын
I can't be grateful enough for these series, I'm learning and enjoying it so so much!
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
I’m so glad to hear! If you ever need any help or have questions, hop into our discord server!
@pascalcasier959
@pascalcasier959 2 жыл бұрын
excellent stuff, Thank you very much
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
No problem, glad it was helpful!
@LordCogsley
@LordCogsley 2 ай бұрын
It isn’t showing the starting text at all for me
@thomaseubank1503
@thomaseubank1503 2 жыл бұрын
This tutorial is awsome
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
So glad you're finding it helpful!
@valdivinoneto5132
@valdivinoneto5132 3 жыл бұрын
Muito bom, parabéns
@nat2509
@nat2509 3 жыл бұрын
Hi, is it possible to edit the text, so that it shows character by character? I found this addon: GodotTIE, But I'm not sure I understand how it works and if it works.
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
This is a super delayed reply, but for anyone curious about this in the future - I'm not sure about the GodotTIE addon, but it's pretty easy to get this effect on your own. First, save the string of the full text you want to show. Then, create a label node (or however you want to display the text. Then, use a timer (maybe set to like 0.5 seconds, adjust as needed), and every time the timer finishes, append the next character from the string into your label's text property. You can use an int property to store your current index in the string, and then just do "label.text = label.text + full_string.substr(current_char_index, 1)" Hope that helps!
@Tylerl128
@Tylerl128 11 ай бұрын
with the starting response it goes off the screen and makes the whole width stretch to the size of the text when i turn word wrap on
@mickauls_
@mickauls_ 10 ай бұрын
I had the same issue. The trick is that you need to make the same adjustments to "Response.tscn" as you are making to "InputResponse.tscn" The are not the same prefab, and the welcome message uses the different prefab (Unity term--sorry), and with Godot 4 I found Word (Smart) wraps the best.
@aventurasag5063
@aventurasag5063 2 жыл бұрын
I have a few questions. We have two commands to check two words: verb (order) and noun. But what happens if someone types "take the lamp"? What happens to the article or preposition? For each action we have to write a function, do we have to do the same for when we want to throw information about something with the command Look/Examine?
@lexi3077
@lexi3077 2 жыл бұрын
I do really like your tutorial :) I just wonder, I learned that you should not have more than one return in a function/method. Is that an old teaching, a german teaching, or was is just my teacher(, did I read it in a book?! I dont remember)? I see it a lot, that people make more than one return statement, so I was wondering about that. (Thats why I tend to make changes to code in tutorials because everyone should write code how that person likes it and can read it properly :) )
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Great question! In general you do want to avoid having as many branching statements in code as you can - ifs, elses, returns, etc. But I think the main purpose of that rule is just to avoid unnecessary complexity in your code, because people too often use huge "if/else" chains where just calling into other functions or using a switch statement, etc, would be better. The problem is that a lot of times people write their code in a way that's so complicated and has so many branches that it becomes really hard to read and keep track of. I think more important than having that hard rule, though, is to find the right tool for the job. I think in this case, for a command parser whose explicit job is to redirect a command into the proper function, having multiple return statements in a larger switch statement isn't confusing at all, since it's really clear what's happening and also very clear that only one ultimate parsing function is going to get called. In that way, I think it's totally fine to have multiple returns here, and I think trying to extract them away would just make it more confusing. Feel free to disagree and modify the code however you want though! That's just my quick answer, good question 🙂
@RobbPage
@RobbPage 3 жыл бұрын
is there a reason that almost ALL godot tutorials don't teach people how to create empty scripts instead of creating a script and then ALWAYS deleting all the template code? it's super easy to just select "empty" when you create the script...
@jmbiv_dev
@jmbiv_dev 3 жыл бұрын
It’s even easier than that - you can create your own new script template that doesn’t have any boilerplate so that you can still press the same button. But I think for a lot of people it just isn’t a big deal - maybe there’s a bit of catharsis that comes from the familiarity of deleting the template every time 😂 that’s why I haven’t changed that, just kind of stopped realizing that was a habit of mine.
@CharlieRickman
@CharlieRickman Жыл бұрын
When I add the start message it's not added until I input text for some reason? The function add_output_text is being called because I get the printout "add output called" that I added to the function. It's just not being added from start: history_rows.add_child(output). How do I make sure history_rows is available from the start? I did set it to a onready var. onready var history_rows = $Background/Margin/VRows/OutputDisplay/Margin/Scroll/HistoryRows func _ready(): # Scroll to bottom if needed. scrollbar.connect("changed", self, "handle_scrollbar_changed") max_scroll_length = scrollbar.max_value # Add intro message. var intro = "Welcome to the world." var output_text = OutputText.instance() output_text.set_text(intro) # Add the intro to the game. add_output_text(output_text) func add_output_text(output: Control): print("add output called") history_rows.add_child(output) clear_history() func clear_history(): # Delete old history from memory. if(history_rows.get_child_count() > max_line_history): history_rows.get_child(0).queue_free()
@jmbiv_dev
@jmbiv_dev Жыл бұрын
Hm, I'm not sure why this is happening just from the code you posted - this looks good to me from a quick glance. Can you join the Discord server and post a screenshot of your full Main script, as well as your OutputText script? We'd be happy to help more there!
Adding Rooms (Godot Retro Text Adventure Tutorial #7)
29:11
小丑和白天使的比试。#天使 #小丑 #超人不会飞
00:51
超人不会飞
Рет қаралды 33 МЛН
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 43 МЛН
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 24 МЛН
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 24 МЛН
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 340 М.
Godot Shader Tutorial [Basics] in 7 minutes
7:47
Master Albert
Рет қаралды 94 М.
10+2 AWESOME ADDONS for GODOT 4
8:36
MrElipteach
Рет қаралды 140 М.
How to Make a 3D Hexagon Grid in Godot (Tutorial)
21:58
jmbiv
Рет қаралды 20 М.
How You Can Easily Make Your Code Simpler in Godot 4
6:59
Bitlytic
Рет қаралды 417 М.
小丑和白天使的比试。#天使 #小丑 #超人不会飞
00:51
超人不会飞
Рет қаралды 33 МЛН