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.

  • Why doesn't this work?glossy-elephant```gdscript var buttontween := create_tween() #Tween Invalid. Either finished or created outside scene tree. tween.finished.connect(func () -> void: #var buttontween := create_tween() #Tweens correctly for button:Button in action_buttons_v_box_container.get_children(): buttontween.tween_property(button,"modulate:a", 1, 0.3) ) ``` I'm confused as to why this doesn't work when buttontween is defined outside of the lambda but works when defined inside. I thought that lambdas could access the variables in the outer scope? It also doesn't give scope errors. When running the above code I get errors in debugger: E 0:00:02:0286 dialogue.gd:135 @ <anonymous lambda>(): Tween invalid. Either finished or created outside scene tree. One of these for each button, with 135 being line 5 above. I don't really understand the error code. 2 2 Jul. 11, 2024
  • Another solution for making buttons appear sequentiallyFlorcAt first I wanted to have the loop await for the button it is currently managing to appear before proceeding to the next. So I ended up with this solution : ```gdscript tween.finished.connect(func() -> void : for button: Button in action_buttons_v_box_container.get_children(): button.modulate.a = 0.0 button.visible = true var opacity_tween := create_tween() opacity_tween.set_ease(Tween.EASE_OUT) opacity_tween.tween_property(button, "modulate:a", 1.0, 0.5) await opacity_tween.finished ) ``` But as I don't know how threading is managed in Godot I was afraid to stop an important thread and encounter unexpected behaviours later in the module. So in the end I settled with the same solution as the one in the solution of the lesson. I'm curious though, how much was I risking to break things by using an await there ? 1 1 Aug. 25, 2024
  • I want to change disabled = false for each button one by one when modulate.a = 1.0next-craneI want to set the button to `disabled = false` only when `modulate.a = 1.0`. This is my previous code (including the comment section): ```gdscript for button : Button in action_buttons_v_box_container.get_children(): button.modulate.a = 0.0 button.disabled = true tween.finished.connect(func() -> void: var button_tween = create_tween() for button : Button in action_buttons_v_box_container.get_children(): button_tween.tween_property(button,"modulate:a",1.0,0.5) #button_tween.finished.connect(func()-> void: #button.disabled = false #) ) ``` But I found that it waits for all my buttons to have `modulate.a = 1.0` before setting all buttons to `disabled = false`. I want to set them one by one, so I changed it to be set inside `_process`: ```gdscript func _process(delta: float) -> void: for button:Button in action_buttons_v_box_container.get_children(): if button.modulate.a == 1: button.disabled = false ``` But I would like to know if `tween` has its own method to achieve this without having to set it in `_process`. Thank you! 1 0 Sep. 19, 2024
  • Bug when launching scene after editing the create buttons functionHazlarHi, When I hover the mouse over yes or no the background of the button becomes orange when I validate the choice, during the proposal the previous choice is no longer orange when I hover over it with the mouse. Example: Sentence 1: Yes or Not -> [yes] Sentence 2: Yes or not -> Yes no longer becomes orange when hovered over. And vice versa [https://school.gdquest.com/courses/learn_2d_gamedev_godot_4/start_a_dialogue/interesting_choices#quitting-the-game-when-done](https://school.gdquest.com/courses/learn_2d_gamedev_godot_4/start_a_dialogue/interesting_choices#quitting-the-game-when-done) 2 0 Aug. 27, 2024
  • Button visibility challengesmart-locustI understand the solution but, I seem to have arrived at this one first before I read the solution and it seemed to work just the same / similarly. ```gdscript for button: Button in action_buttons_v_box_container.get_children(): button.disabled = true button.modulate.a = 0 tween.tween_property(button, "modulate:a", 1.0, 0.5) tween.finished.connect(func() -> void: for button: Button in action_buttons_v_box_container.get_children(): button.disabled = false ) ``` 1 0 Aug. 06, 2024
  • var target_line_idx: int = choices_data[choice_text] I AM CONFUSE!miniature-gazellehello, why does the above line give us the value and not the key ? isn't choices_text the key of the dictionary? 2 0 Aug. 05, 2024
  • L4.P1 I Need Help!Nikita MyshkinI've tried everything already and don't understand what needs to be done. ```gdscript func _ready() -> void: for item_name in items_list: var button := InventorySlotButton.new() grid_container.add_child(button) button.text = item_name button.amount = item_name # Assign the item's name and amount to the button properties. # Don't forget to add the button to the grid container. ``` What needs to be fixed here that the numbers finally show up? 7 0 Jul. 29, 2024
  • I get it, i'll be mindfull of queue_free and tween.finish interactionunderstated-cobraI thought i'll be smart and merge the two `for button: Button in action_buttons_v_box_container.get_children():` into one (the one creating the button and the one inside the finish signal) but this way the tween finish signal callback to a dereferenced button. Just added a null check inside the tween.finished lambda function to make it work but it shows that getting an update button list at finish signal timing is important. Almost forgot, these dialogue lessons are super interesting ! edit : typo 1 0 Jul. 22, 2024
  • Code Snippet Missing Double Quotes13eckIn the `Adding choices to the dialogue` section, the first code snippet is missing a double-quote at the very beginning of line 3 1 0 Jul. 18, 2024
  • Favorite lessonAlcedoMan, I do love this lesson for all the present topics, in particular the challenge. This make me think about an additional feature: it would be nice to have a favorite system to keep track these kind of lessons. 1 0 Jul. 16, 2024
Site is in BETA!found a bug?