extends SceneTree ## Export the built-in scenarios to `.tres` resources for editor authoring. ## ## Usage: ## godot --headless --path . --script res://tools/export_venues.gd ## ## Writes content/venues/.tres. These mirror ScenarioFactory exactly; the ## factory stays the source of truth for the prototype, and the exported files are ## what an editor-based workflow would edit and ship. const Factory := preload("res://src/content/scenario_factory.gd") func _initialize() -> void: var out_dir := "res://content/venues" DirAccess.make_dir_recursive_absolute(out_dir) var scenarios := [Factory.hollywood_building(), Factory.joke_shop(), Factory.tv_studio()] var failures := 0 for scenario in scenarios: var path := "%s/%s.tres" % [out_dir, scenario.id] var err: int = ResourceSaver.save(scenario, path) if err == OK: print("wrote %s" % path) else: printerr("failed to write %s (error %d)" % [path, err]) failures += 1 quit(0 if failures == 0 else 1)