extends Control
const TEXTBOX = preload("res://Textbox.tscn")
const LEVEL_ONE = preload("res://Levels/level_one.tscn")
func _ready():
BgmPlayer.stop()
PlayerStats.health = PlayerStats.max_health
randomize()
if randi_range(1, 4) == 1:
$TextureRect.texture = load("res://hatsune_mario_small.png") as Texture
var textbox = TEXTBOX.instantiate()
textbox.dialog = [
#dialog
]
textbox.connect('dialog_over', switch_to_world)
self.add_child(textbox)
await textbox.next_line
await textbox.line_over
$AnimationPlayer.play("WakeUp")
func switch_to_world():
BgmPlayer.play()
get_tree().change_scene_to_packed(LEVEL_ONE)
gives
E 0:00:02:0972 _parse_ext_resource: res://Levels/level_one.tscn:159 - Parse Error: [ext_resource] referenced non-existent resource at: res://Levels/level_two.tscn
<C++ Source> scene/resources/resource_format_text.cpp:163 @ _parse_ext_resource()
when i replace level 1 with level 2 it gives the exact same error but for level 2. it also makes it a null scene globally (the error is from a level switching area2d in level2). h