![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Gus G |
Hi, I’m writing a game with a series of events that need to happen, and I’m storing them in a list of lists. Each list has a string (the function name) and its arguments (in a list), and I’m iterating through and using callv. Most of these “actions” take some time to complete (tweens, etc.) and I’m using yield in each function to wait until it’s done, but when I use it in conjunction with callv like I described it just ignores the yield and does everything at once.
func exampleAction():
var sceneNode = preload("res://Scenes/Lens Flare.tscn").instance()
add_child(sceneNode)
yield(sceneNode, "tree_exited")
func _ready():
var actions = [
["exampleAction", []]
]
print(actions)
for action in actions:
print(typeof(action[1]))
callv(action[0], action[1])
If there’s another way I could structure my project, that would also be considered.