Which results in only displaying the last “Research” right? You will need to add each task, I also recommend not doing this in _process as it can be rather expensive to set text labels and manipulate strings every frame.
func _on_newtask_timeout():
tasks.append(new_task.pick_random())
# create a new blank string
var all_tasks: String = ""
# add each task to the string
for task_name in tasks:
all_tasks += task_name + "\n" # \n makes a new line; like hitting enter, but for code
# apply the accumulated string to the label
%TaskBoard.text = all_tasks
I think the problem here is that each time you loop over an item in tasks, you’re setting the text property of your %TaskBoard to that value. That means that it’ll replace the value on each iteration of the loop rather than add the text to it.
You’re also setting rand_task to the result of new_task.pick_random() at the start, but not calling the function again, so the value will always remain the same.
Those two things would mean that the text in %TaskBoard will always remain the same.
I’d suggest updating the value of rand_task in your _on_newtask_timeout so that each time it picks a random value, and updating the logic to set the %TaskBoard text value to concatenate the strings of each task.