Also, I just worked out that you can use get_tree().root.get_child(0).current_level+1 to get the current level for use with goto_level function (the current_level value starts counting from 0 for first level, while goto_level starts from 1)