Looks like you're not logged in

Login or Register to continue

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.

  • Resources Not Extending Correctly?LTNoodleburgerWhen I attempt to to do this part of the code, ```gdscript - var dialogue_items: Array[Dictionary] = [] + @export var dialogue_items: Array[DialogueItem] = [] ``` I do get the menu of items that should be expected. Text, expression, body, etc. I get the drop down with no properties to edit. I've tried recreating the steps but same issue. (I'm on Mac OS, if that matters) EDIT: Restarting solved it. Strange, but at least it works now. 6 3 Jul. 18, 2024
  • Confusing L6.P1 comment in the code bluepillIn the powered_inventory.gd code there is a comment "# Set the power's `image` property to the TextureRect's `texture` property." This caused me to second guess myself for a little while because I misinterpreted it. It may be too late in the day for my brain today, but I thought it says to assign the power's image property value to the value of the TextureRect's texture property. When the opposite is what really needs to be done. 3 1 Aug. 01, 2024
  • Will Version Control Get Introducedsteel_jokersDo you plan to cover any sort of version control in this course (e.g. Git, Subversion, etc.)? I'm looking into how to use git with Godot and, while the syntax of git is simple, the project management side of it seems like very opinionated ground. I'm genuinely curious as to how seasoned developers would apply version controls in their development process. Are there best practices you follow? Do you have a flow that works well for you at GDQuest? 2 1 Jul. 21, 2024
  • Suggestion: Challenge Hintwell-to-do-owlI just had a suggestion for the challenge: *Challenge:Can you make it so `is_quit` buttons look unique? You could: ...* For me attempting the first part of the challenge (appending "(quit)") was quite simple, but the second part, creating a type variation for the button required more research into the Godot documentation, and back to previous lessons. I think it would be helpful to provide a link or direct readers to refer back to *M7. SG1 - Making the most out of the theme editor* here, as I do not believe creating a type variation in a theme was covered in this module, or in any of the lessons L1-14 in M7. Thanks for the great lesson! 1 1 Jul. 21, 2024
  • L6.P1 Invalid get index powerups_listBort_BortingtonError: Invalid get index powerups_list (on base: 'Resource (PoweredItem)') No idea what im doing wrong. I have 3 items with 1 texture each from the dropdowns in the inspector. func display_powerups(powerups_list: Array[Power]) -> void: for textures in powerups_v_box_container.get_children(): textures.queue_free() for power in powerups_list: var texture = TextureRect.new() texture.texture = power.image texture.add_child(powerups_v_box_container) 4 0 Sep. 16, 2024
  • My dialoguesebbianuuuhi I wrote a short silly dialogue. If you want you can take a look here [https://youtu.be/k2kSpY8aYbU](https://youtu.be/k2kSpY8aYbU) 2 0 Sep. 02, 2024
  • $ used instead of % for line 12 of Full CodeStonemonkeyThe reference to the ActionButtonsVBoxContainer Node is using ` instead of `%` in the Full Code at the end of the Lesson ```gdscript @onready var action_buttons_v_box_container: VBoxContainer = $ActionButtonsVBoxContainer ``` 1 0 Aug. 31, 2024
  • Buttons not appearing at runtime.Abdul Hannan AhmedHere's my `dialogue.gd` ```gdscript extends Control ## UI element that shows the texts @onready var rich_text_label: RichTextLabel = %RichTextLabel ## Audio player that plays voice sounds while text is being written @onready var audio_stream_player: AudioStreamPlayer = %AudioStreamPlayer ## The character @onready var body: TextureRect = %Body ## The Expression @onready var expression_texture_rect: TextureRect = %Expression ## The container for buttons @onready var action_buttons_v_box_container: VBoxContainer = %ActionButtonsVBoxContainer ## An array of dialogue entries @export var dialogue_items: Array[DialogueItem] = [] func _ready() -> void: show_text(0) ## Draws the selected text ## [param current_item_index] Displays the currently selected index from the dialogue array func show_text(current_item_index: int) -> void: # We retrieve the current item from the array var current_item := dialogue_items[current_item_index] # We set the initial visible ratio to the text to 0, so we can change it in the tween rich_text_label.visible_ratio = 0.0 # from the item, we extract the properties. # We set the text to the rich text control # And we set the appropriate expression texture rich_text_label.text = current_item.text expression_texture_rect.texture = current_item.expression body.texture = current_item.character create_buttons(current_item.choices) # We create a tween that will draw the text var tween := create_tween() # A variable that holds the amount of time for the text to show, in seconds # We could write this directly in the tween call, but this is clearer. # We will also use this for deciding on the sound length var text_appearing_duration := (current_item["text"] as String).length() / 30.0 # We show the text slowly tween.tween_property(rich_text_label, "visible_ratio", 1.0, text_appearing_duration) # We randomize the audio playback's start time to make it sound different # every time. # We obtain the last possible offset in the sound that we can start from var sound_max_length := audio_stream_player.stream.get_length() - text_appearing_duration # We pick a random position on that length var sound_start_position := randf() * sound_max_length # We start playing the sound audio_stream_player.play(sound_start_position) # We make sure the sound stops when the text finishes displaying tween.finished.connect(audio_stream_player.stop) # We animate the character sliding in. slide_in() # We disable all buttons until the tween completes for button: Button in action_buttons_v_box_container.get_children(): button.disabled = true tween.finished.connect( func() -> void: for button: Button in action_buttons_v_box_container.get_children(): button.disabled = false ) ## Adds buttons to the buttons container ## [param buttons_data] An array of [DialogChoice] func create_buttons(buttons_data: Array[DialogueChoice]) -> void: for button in action_buttons_v_box_container.get_children(): button.queue_free() for choice in buttons_data: var button := Button.new() action_buttons_v_box_container.add_child(button) button.text = choice.text if choice.is_quit == true: button.pressed.connect(get_tree().quit) else: var target_line_id := choice.target_line_idx button.pressed.connect(show_text.bind(target_line_id)) ## Animates the character when they start talking func slide_in() -> void: var slide_tween := create_tween() slide_tween.set_ease(Tween.EASE_OUT) body.position.x = get_viewport_rect().size.x / 7 slide_tween.tween_property(body, "position:x", 0, 0.3) body.modulate.a = 0 slide_tween.parallel().tween_property(body, "modulate:a", 1, 0.2) ``` Here's my `dialogue_choice.gd` ```gdscript class_name DialogueChoice extends Resource @export var text := "" @export_range(0, 20) var target_line_idx := 0 @export var is_quit := false ``` and here's my `dialogue_items.gd` ```gdscript class_name DialogueItem extends SlideShowEntry @export var choices: Array[DialogueChoice] = [] ``` For some reason, the buttons don't appear at runtime. I tried restarting the editor, but doesn't work. Can you guide me if I'm doing something wrong? Thanks in advance! 4 0 Aug. 09, 2024
  • Challenge / Type VariationasricbIf I manually add the theme to a button in the scene and write within type variation the "ButtonQuit" that I created, the color changes, so it is created correctly. I have managed to solve it by adding the theme to the button by code like this, but it doesn't seem very optimal to me: ```gdscript if choice.is_quit == true: button.theme = preload("res://assets/main_theme.tres") button.theme_type_variation = "ButtonQuit" button.text = "Quit" button.pressed.connect(get_tree().quit) ``` 1 0 Aug. 01, 2024
  • Buttons not apearing on runtimeRaziel Raznoshere is the code from dialogue.gd: ```gdscript extends Control @onready var action_buttons_v_box_container: VBoxContainer = %ActionButtonsVBoxContainer ## UI element that shows the texts @onready var rich_text_label: RichTextLabel = %RichTextLabel ## Audio player that plays voice sounds while text is being written @onready var audio_stream_player: AudioStreamPlayer = %AudioStreamPlayer ## The character @onready var body: TextureRect = %Body ## The Expression @onready var expression_texture_rect: TextureRect = %Expression ## An array of dictionaries. Each dictionary has three properties: ## - expression: a [code]Texture[/code] containing an expression ## - text: a [code]String[/code] containing the text the character says ## - character: a [code]Texture[/code] representing the character @export var dialogue_items: Array[DialogueItem] = [] func _ready() -> void: show_text(0) func create_buttons(buttons_data: Array[DialogueChoice]) -> void: for button in action_buttons_v_box_container.get_children(): button.queue_free() # We loop over all the dictionary keys for choice in buttons_data: var button := Button.new() action_buttons_v_box_container.add_child(button) button.text = choice.text if choice.is_quit == true: button.pressed.connect(get_tree().quit) else: var target_line_id := choice.target_line_idx button.pressed.connect(show_text.bind(target_line_id)) ## Draws the current text to the rich text element func show_text(current_item_index: int) -> void: # We retrieve the current item from the array var current_item := dialogue_items[current_item_index] # from the item, we extract the properties. # We set the text to the rich text control # And we set the appropriate expression texture rich_text_label.text = current_item.text expression_texture_rect.texture = current_item.expression body.texture = current_item.character create_buttons(current_item.choices) # We set the initial visible ratio to the text to 0, so we can change it in the tween rich_text_label.visible_ratio = 0.0 # We create a tween that will draw the text var tween := create_tween() # A variable that holds the amount of time for the text to show, in seconds # We could write this directly in the tween call, but this is clearer. # We will also use this for deciding on the sound length var text_appearing_duration: float = current_item["text"].length() / 30.0 # We show the text slowly tween.tween_property(rich_text_label, "visible_ratio", 1.0, text_appearing_duration) # We randomize the audio playback's start time to make it sound different # every time. # We obtain the last possible offset in the sound that we can start from var sound_max_length := audio_stream_player.stream.get_length() - text_appearing_duration # We pick a random position on that length var sound_start_position := randf() * sound_max_length # We start playing the sound audio_stream_player.play(sound_start_position) # We make sure the sound stops when the text finishes displaying tween.finished.connect(audio_stream_player.stop) # We animate the character sliding in. slide_in() for button : Button in action_buttons_v_box_container.get_children(): button.disabled = true tween.finished.connect(func() -> void: for button : Button in action_buttons_v_box_container.get_children(): button.disabled = false ) ## Animates the character when they start talking func slide_in() -> void: var slide_tween := create_tween() slide_tween.set_ease(Tween.EASE_OUT) body.position.x = get_viewport_rect().size.x / 7 slide_tween.tween_property(body, "position:x", 0, 0.3) body.modulate.a = 0 slide_tween.parallel().tween_property(body, "modulate:a", 1, 0.2) ``` 3 0 Jul. 22, 2024
  • @export var dialogue_items: Array[DialogueItem] = []Raziel Raznosits broken nothing shows up, anyone has any ides what could fix it ? , already tried to restart godot didnt worked and also tried to retype it also didnt worked 5 0 Jul. 22, 2024
  • Creating Resourcessteel_jokersI love how this lesson stepped through removing the dictionary data model and refactoring to use the resources. The nested diagram earlier in the lesson explaining how the dialog items array would make use of the resources was spot on. The color coding really showed a clean schema of the intended data-structure. Well done! I have one thing I keep tripping over in regard to creating a resource. We created the new resources by right clicking on the lessons folder and selecting: **Create New -> Script...** Each time I would try to implement on my own first, I found myself gravitating toward the: **Create New -> Resource...** I would realize that I had deviated from what we had learned as soon as the Create New Resource dialog box would appear and cancel out of the dialog box. Does the **Create New -> Resource...** essentially do the same as what we had done with generating a new script that extends Resource, or is it there for a different purpose we haven't learned yet? 3 0 Jul. 20, 2024
  • Practice L6.P1 instructionsHludowigTowinaI think I saw a small error in the instructions of practice L6.P1 "Then, add a property named powerups_list with the type Array[Power] to the PoweredInventory resource defined by the script powered_inventory.gd." PoweredInventory and powered_inventory.gd should be PoweredItem and Powered_item.gd respectively 1 0 Jul. 15, 2024
Site is in BETA!found a bug?