Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.
Great module, thank you!SebI particularly appreciated the numerous challenges to write the code *before* you give the "teacher version".819May. 22, 2024
My favorite aspect of BBCode RichTextLabels is ...tesfalcon... displaying IMAGES! I used RichTextLabel in my game to display images to show the player which game items produce with which other game items in the merge trees and in the catcher. I'm not talking about emojis in speech, but explaining the game's characters, enemies, etc. using the actual images from the game in the notebook.16Jun. 19, 2024
Cannot wait for M8FernandoIt was a great module, I learned a lot and it made me excited for the next one.
Just thinking about writing the name of a character and automatically knowing what texture use, what sound play and which accent color use, made me thrilled for more.13Jun. 16, 2024
The Modules So Far...Mr-EdI think that the shortest and best praise a teacher can get is this:
You helped me overcome the fear and anxiety that I had every time I tried to work with the UI, Thank you!11Dec. 12, 2024
screen scalesqwirexI had a question towards the end of the module about the screen, you said in one of the lessons (or in the comments) that we usually limit the screen scaling for the player to avoid too bad a picture at a small scale, so,
how to do this in project settings? Otherwise, we still have characters disappear at a small scale and the buttons cover everything20Jan. 11, 2025
(D (Physical)) tart-hippopotamusHello, thanks for wonderful course!
I have a question about why I see suggestion (D (Physical)) when move a mouse to the next button (I assigned it to D)?30Jan. 06, 2025
Parsing ChallengeMuseDoesHi, I was able to solve the problem of the slower text animation by writing this:
```gdscript
func show_text() -> void:
var current_item := dialogue_items[current_item_index]
rich_text_label.text = current_item["text"]
# ...
var text_appearing_duration: float = rich_text_label.get_parsed_text().length() / 30.0
# ...
```
When I run this, everything seems to be working fine.
I did have question that popped up as I was solving this challenge.
Is a benefit to using current_item["text"] as opposed to rich_text_label.text?
```gdscript
var text_appearing_duration: float = current_item["text"].length() / 30.0
```
```gdscript
var text_appearing_duration: float = rich_text_label.text.length() / 30.0
```
When we wrote the func show_text, we made it so that the text to be displayed in the rich_text_label was going to be the current_item["text"]
```gdscript
func show_text() -> void:
var current_item := dialogue_items[current_item_index]
rich_text_label.text = current_item["text"]
```
But after that, we kept using current_item["text"] when writing the text_appearing_duration. My best guess is that it makes it easier to understand while learning the concepts.
However, as far as I can tell, there isn't a problem to using the rich_text_label for the other parts within the show_text function. That being said, I am worried that there was a reason that we have been told to use current_item["text"] instead of rich_text_label.text.
I've heard you can put images into BBCode, so maybe that would be a benefit to using current_item["text"], but I would also think that rich_text_label.get_parsed_text() would still work even if there were images present in the label since its looking for text only. Though, admittedly I haven't tested this out just yet.
As a complete aside note:
I really appreciated this parsing challenge as it made it more apparent to me just how interconnected and substitutable all of the pieces are within the GDScript code! (^u^)
10Nov. 14, 2024
BBCode parseilliterate-spiderHi guys cant figure out where to start to put to solve it. My mind went straight here in code.
I inputed line 5
Thanks in advance!
```gdscript
func show_text() -> void:
var current_item := dialogue_items[current_item_index]
rich_text_label.text = current_item["text"]
rich_text_label.text = rich_text_label.get_parsed_text()
expression.texture = current_item["expression"]
body.texture = current_item["character"]
rich_text_label.visible_ratio = 0.0
```50Nov. 13, 2024
Love BBcode, but why did they choose it?OldManBradThis is just an observation. As an older web dev, I loved BBcode. But it fell out of favor a decade or so ago. I don't know why that happened. Any thoughts on why Godot devs chose bbcode over some of the more popular markup languages? Don't get me wrong, I love bbcode. Just curious about why a modern engine would use it - if you happen to know or have an opinion. 30Oct. 14, 2024
BBCode, localization and interpretation questionalarming-baboonBrowsing through [BBCode reference](https://docs.godotengine.org/en/stable/tutorials/ui/bbcode_in_richtextlabel.html#reference), I am amazed and also a bit frightened by the sheer amount of possibilities (images, links, tables, opentype features…).
Somehow, I can't shake the feeling that dialogues lines that would get translated further down the line by someone else that might not even be a developer should not contains so much code, especially since this code could change based on context, like for example :
- link to input buttons images if the player uses a controller, or key names instead if the player uses keyboard;
- different color on certains words if the item is or isn't in a player inventory;
- and so on…
So my question is: does godot provides us with a mechanism that would allow us to use a custom small subset of bbcode tags that get transformed in a specific context-based hellish tag soup in our game? Something that would take a string like:
`"You must find [weapon]excalibur[/weapon] to fulfil your quest!"`
and transform it in-game as
`"You must find [img]res://x[/img] [outline_size=x][outline_color=#x][b][color=#x]excalibur[/color][/b][/outline_color][/outline_size] to fulfil your quest!"`
with values dependant on game context…20Sep. 27, 2024
Help with making hints using BBCodeFioretinI’m trying to make hints in dialogue using the BBCode. Ideally, the hint will pop up when the player hovers over the text. I’ve added the following line of code into my script, but the hint doesn’t pop up when I hover over it. I think I’m missing something but I’m not sure what to do…
```gdscript
var dialogue_items : Array[Dictionary] = [
. . .
{
"expression": expressions_dictionary["sad"],
"text": "[i]\"The world is what you make of it,\"[/i] or so [hint={Pink}]she[/hint] says.",
"body": bodies_dictionary["sophia"],
"voice": voices_dictionary["voice_1"]
},
. . .
```
Also, in certain games, they add an additional text above the dialogue to clarify what certain words are. For example, in Honkai Star Rail, the first time you hear about the Interastral Peace Corporation, there’s a smaller text right above it that says “Galatic Monopoly”. I wonder how to implement such things in Godot?130Sep. 09, 2024
Typo about BBCodeTJHi! The lesson says:
> Notice how in the last line, I *nested* BBCode tags to combine the bold and italics format.
Looking at the actual code, what is probably intended is the `tornado` and `rainbow` tags.10Aug. 16, 2024
Button effect on 2nd attempt seems has no toggle button animation?CelsDid I miss something? Seems the toggle button and focus (color yellow animation) seems not show after the 2nd attempt?50May. 22, 2024
The last BBCode dialogue sentence change suggestion doesn't match the animationGurkWhen suggesting the three sentences changes, I noticed in the changes log that the third change is not the sentence corresponding to the rainbow decoration, and it show the same sentence twice (old and new).
I checked in the code reference and i saw that it actually changes the last one:
Instead of:
`"text": "Mhhh... I see. I'll keep at it, then.",`
It should be:
`"text": "Thanks for the encouragement. Time to [tornado freq=3.0][rainbow val=1.0]LEARN!!![/rainbow][/tornado]",`10May. 18, 2024
Lesson Q&A
Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.