The third argument for start function on a thread is a Variant. The idea is instead of being able to pass an indefinite number of variables into the start function, instead you will put all of the values into one data structure, like an Array, and then your thread start function will pull out the values that it needs.
For example:
# make and start thread
func _2load_scene(path, save_game_values):
var userdata = [path, save_game_values]
thread = Thread.new()
thread.start(self, "_thread_load", userdata, Thread.PRIORITY_NORMAL)
# do loading
func _thread_load(usr):
print("PATH: {0} SAVE VALUES: {1}".format({0:usr[0], 1:usr[1]})
Sir Chansolor, you are a riot, Challanger and admirable person!
Thanks, this is it! You saved me a lot of trouble of making 2 call_deferred then taking variables passing in another function combining them again just for a save purpose.
Thanks, I am a sole game developer maybe we can develop together
Okan Ozdemir | 2020-03-23 17:04
I can’t still believe you understand me and solve my problem so quickly, Allahcc, The god bless you sir