From 30e40a3d49835a54373c494f7e01cfa05d5c08e1 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 22 May 2026 09:41:41 +0100 Subject: [PATCH 1/4] Fix labels of directional transitions-to-blank Transitions are implemented as follows. A fully-black ColorRect covers the whole screen. Its alpha channel is varied by a shader, which samples a monochrome mask texture and compares its red channel to a cutoff threshold to determine whether the alpha channel should be 0 or 1 (or a smoothed value in between). The cutoff is tweened from 1 to 0 when fading to black, and from 0 to 1 when fading from black. For the FADE (whole screen fades at once) and RADIAL effects, this works as expected. For RADIAL, the fade-out ends at a point in the middle of the screen, and the fade-in begins at that point. Fine. When a human reads LEFT_TO_RIGHT_WIPE they have a different expectation in the two directions. When fading out, we expect the blackness to start at the left and wipe across the screen to the right. When fading in, we expect the scene to appear at the left of the screen and wipe across the screen. If you think about it in terms of the mask texture, these are actually opposites of one another! The LEFT_TO_RIGHT_WIPE texture does what you would expect for the fade-in, but the opposite for the fade out. Invert the sense of directional transitions when fading out. This means that using LEFT_TO_RIGHT_WIPE for the fade-out has the expected effect of the black mask wiping across the screen from left to right. Adjust all code references accordingly. I'm not fixing all the scenes that use Teleporter because a future commit will change all those anyway. (Confusingly Teleporter refers to the fade-out as "enter" and the fade-in as "exit", but when thinking in terms of scenes you might imagine the fade-out is the "exit" and the fade-in is the "enter".) --- .../props/teleporter/teleporter.gd | 2 +- .../globals/scene_switcher/scene_switcher.gd | 4 +- .../scene_switcher/transitions/transitions.gd | 41 ++++++++++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/scenes/game_elements/props/teleporter/teleporter.gd b/scenes/game_elements/props/teleporter/teleporter.gd index 271b85fa51..2577592c7f 100644 --- a/scenes/game_elements/props/teleporter/teleporter.gd +++ b/scenes/game_elements/props/teleporter/teleporter.gd @@ -33,7 +33,7 @@ const SPAWN_POINT_GROUP_NAME: String = "spawn_point" notify_property_list_changed() ## Transition to use when the player enters this teleport. -@export var enter_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE +@export var enter_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE ## Transition to use when the player leaves this teleport. @export var exit_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE diff --git a/scenes/globals/scene_switcher/scene_switcher.gd b/scenes/globals/scene_switcher/scene_switcher.gd index b8fa931581..a3a6490a59 100644 --- a/scenes/globals/scene_switcher/scene_switcher.gd +++ b/scenes/globals/scene_switcher/scene_switcher.gd @@ -104,7 +104,7 @@ func _on_hash_changed(args: Array) -> void: func change_to_file_with_transition( scene_path: String, spawn_point: NodePath = ^"", - enter_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE, + enter_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE, exit_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE ) -> void: assert(scene_path != "") @@ -124,7 +124,7 @@ func change_to_file_with_transition( func change_to_packed_with_transition( scene: PackedScene, spawn_point: NodePath = ^"", - enter_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE, + enter_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE, exit_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE ) -> void: assert(scene != null) diff --git a/scenes/globals/scene_switcher/transitions/transitions.gd b/scenes/globals/scene_switcher/transitions/transitions.gd index 5bf48b78f0..a7d03c0d44 100644 --- a/scenes/globals/scene_switcher/transitions/transitions.gd +++ b/scenes/globals/scene_switcher/transitions/transitions.gd @@ -9,7 +9,24 @@ signal started signal finished enum Effect { - FADE, LEFT_TO_RIGHT_WIPE, RIGHT_TO_LEFT_WIPE, RADIAL, TOP_TO_BOTTOM_WIPE, BOTTOM_TO_TOP_WIPE + ## Fade the whole screen to/from black at once + FADE, + + ## Fade to/from black starting from the left of the screen and moving right + LEFT_TO_RIGHT_WIPE, + + ## Fade to/from black starting from the right of the screen and moving left + RIGHT_TO_LEFT_WIPE, + + ## Fade to black from the edges of the screen to a circle in the middle; + ## fade from black starting at the middle and working outwards. + RADIAL, + + ## Fade to/from black starting from the top of the screen and moving down + TOP_TO_BOTTOM_WIPE, + + ## Fade to/from black starting from the bottom of the screen and moving up + BOTTOM_TO_TOP_WIPE, } const FADE_TEXTURE: Texture = preload("uid://cpvc4xmg7at7r") @@ -24,6 +41,20 @@ var _current_tween: Tween @onready var transition_mask: ColorRect = $TransitionMask +static func _invert(effect: Effect) -> Effect: + match effect: + Effect.LEFT_TO_RIGHT_WIPE: + return Effect.RIGHT_TO_LEFT_WIPE + Effect.RIGHT_TO_LEFT_WIPE: + return Effect.LEFT_TO_RIGHT_WIPE + Effect.TOP_TO_BOTTOM_WIPE: + return Effect.BOTTOM_TO_TOP_WIPE + Effect.BOTTOM_TO_TOP_WIPE: + return Effect.TOP_TO_BOTTOM_WIPE + _: + return effect + + func _input(_event: InputEvent) -> void: if visible: get_viewport().set_input_as_handled() @@ -64,21 +95,21 @@ func _do_tween( func _leave_scene( - _transition_effect: Effect = Effect.FADE, + transition_effect: Effect = Effect.FADE, duration: float = 1.0, easing: Tween.EaseType = Tween.EaseType.EASE_OUT, transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_QUAD ) -> void: - await _do_tween(0.0, _transition_effect, duration, easing, transition_type) + await _do_tween(0.0, _invert(transition_effect), duration, easing, transition_type) func _introduce_scene( - _transition_effect: Effect = Effect.FADE, + transition_effect: Effect = Effect.FADE, duration: float = 1.0, easing: Tween.EaseType = Tween.EaseType.EASE_IN, transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_QUAD ) -> void: - await _do_tween(1.0, _transition_effect, duration, easing, transition_type) + await _do_tween(1.0, transition_effect, duration, easing, transition_type) func do_transition( From d27261f38adb1b40fdfd526902d92de495d0d8e6 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 22 May 2026 09:41:11 +0100 Subject: [PATCH 2/4] Make SceneSwitcher.reload_current_scene() use FADE by default If every call site of a method sets the optional parameters to the same values, then the defaults are wrong. --- scenes/game_elements/characters/player/components/player.gd | 4 ++-- scenes/globals/scene_switcher/scene_switcher.gd | 4 ++-- .../champ/3_stealth/champ_incomplete_character.gd | 3 +-- .../stealth_components/eldrune_stealth_game_logic.gd | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scenes/game_elements/characters/player/components/player.gd b/scenes/game_elements/characters/player/components/player.gd index 1822d18faa..9e18b08aac 100644 --- a/scenes/game_elements/characters/player/components/player.gd +++ b/scenes/game_elements/characters/player/components/player.gd @@ -207,7 +207,7 @@ func defeat(falling: bool = false) -> void: # Check if player has lives remaining if GameState.current_lives > 0: # Still have lives - reload current scene/checkpoint - SceneSwitcher.reload_with_transition(Transition.Effect.FADE, Transition.Effect.FADE) + SceneSwitcher.reload_with_transition() else: # Game over - restart from challenge start _handle_game_over() @@ -250,7 +250,7 @@ func _handle_game_over() -> void: # Fallback: reload current scene if no challenge start is defined # Clear spawn point to start from the beginning of the current scene GameState.set_current_spawn_point(^"") - SceneSwitcher.reload_with_transition(Transition.Effect.FADE, Transition.Effect.FADE) + SceneSwitcher.reload_with_transition() else: # Restart from the challenge start scene SceneSwitcher.change_to_file_with_transition( diff --git a/scenes/globals/scene_switcher/scene_switcher.gd b/scenes/globals/scene_switcher/scene_switcher.gd index a3a6490a59..6c48f3d30e 100644 --- a/scenes/globals/scene_switcher/scene_switcher.gd +++ b/scenes/globals/scene_switcher/scene_switcher.gd @@ -135,8 +135,8 @@ func change_to_packed_with_transition( func reload_with_transition( - enter_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE, - exit_transition: Transition.Effect = Transition.Effect.LEFT_TO_RIGHT_WIPE + enter_transition: Transition.Effect = Transition.Effect.FADE, + exit_transition: Transition.Effect = Transition.Effect.FADE, ) -> void: Transitions.do_transition(get_tree().reload_current_scene, enter_transition, exit_transition) diff --git a/scenes/quests/story_quests/champ/3_stealth/champ_incomplete_character.gd b/scenes/quests/story_quests/champ/3_stealth/champ_incomplete_character.gd index ddeb95193b..e089115642 100644 --- a/scenes/quests/story_quests/champ/3_stealth/champ_incomplete_character.gd +++ b/scenes/quests/story_quests/champ/3_stealth/champ_incomplete_character.gd @@ -132,5 +132,4 @@ func defeat() -> void: await get_tree().create_timer(2.0).timeout # reload current scene/checkpoint - SceneSwitcher.reload_with_transition(Transition.Effect.FADE, Transition.Effect.FADE) - + SceneSwitcher.reload_with_transition() diff --git a/scenes/quests/story_quests/eldrune/1_stealth/stealth_components/eldrune_stealth_game_logic.gd b/scenes/quests/story_quests/eldrune/1_stealth/stealth_components/eldrune_stealth_game_logic.gd index e0fed5f41b..e112574d35 100644 --- a/scenes/quests/story_quests/eldrune/1_stealth/stealth_components/eldrune_stealth_game_logic.gd +++ b/scenes/quests/story_quests/eldrune/1_stealth/stealth_components/eldrune_stealth_game_logic.gd @@ -26,7 +26,7 @@ func _on_player_detected(player: Node2D) -> void: _play_defeat_sequence(player, is_shark_enemy) await get_tree().create_timer(DEFEAT_RELOAD_DELAY).timeout - SceneSwitcher.reload_with_transition(Transition.Effect.FADE, Transition.Effect.FADE) + SceneSwitcher.reload_with_transition() ## Returns the first guard in ALERTED state, or null if none found From 01bbe8110c42b454d4b653e13a96b65ffb15d8ed Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 21 May 2026 18:51:21 +0100 Subject: [PATCH 3/4] Reintroduce a teleporter scene Before commit f7c68090a1d7d786ffffa1a899c3e3431f68472f, we had a mixture of bare teleporter.gd nodes, and instances of teleporter.tscn. In that commit I removed the scene: > teleporter.gd is a `@tool` and configures the correct layers on itself, > so I don't really see the value of having the scene. I now want to refactor the teleporter so the transition properties etc. can be shared with other nodes that can switch scenes. To do so, I find that I need to use a teleporter scene rather than a bare node...! Add such a scene, and update every scene in the game to use it, with the tool included here. It'll be removed in the next commit because I'm removing teleporter.gd but we'll have it for posterity. --- .../mothsache/Mothsache_test_scene.tscn | 7 +- .../components/1_time_and_weather_museum.tscn | 6 +- .../components/2_time_and_weather_museum.tscn | 6 +- .../props/teleporter/teleporter.tscn | 10 +++ .../tutorial_ruined_village.tscn | 7 +- .../tutorial_sequence_puzzle.tscn | 7 +- .../4_ink_combat/tutorial_ink_combat.tscn | 7 +- .../2_ink_combat/ink_combat_round_2.tscn | 7 +- .../grappling_hook_needles.tscn | 11 +-- .../2_grappling_hook/grappling_hook_pins.tscn | 6 +- .../grappling_hook_powerup.tscn | 6 +- .../grappling_hook_start.tscn | 6 +- .../3_void_grappling/void_grappling.tscn | 7 +- .../void_grappling_round_2.tscn | 7 +- .../ink_combat_round_4.tscn | 7 +- .../ink_combat_round_5.tscn | 7 +- .../champ/3_stealth/champ_stealth.tscn | 6 +- .../1_combat/renya_combat_round_1.tscn | 9 +-- .../1_combat/renya_combat_round_2.tscn | 7 +- scenes/world_map/frays_end.tscn | 7 +- scenes/world_map/frays_end_west.tscn | 7 +- ...e_teleporter_nodes_with_scene_instances.gd | 77 +++++++++++++++++++ ...leporter_nodes_with_scene_instances.gd.uid | 1 + 23 files changed, 130 insertions(+), 98 deletions(-) create mode 100644 scenes/game_elements/props/teleporter/teleporter.tscn create mode 100644 tools/replace_teleporter_nodes_with_scene_instances.gd create mode 100644 tools/replace_teleporter_nodes_with_scene_instances.gd.uid diff --git a/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn b/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn index 11c70d6930..c4fc729848 100644 --- a/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn +++ b/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn @@ -10,7 +10,7 @@ [ext_resource type="TileSet" uid="uid://dfp36ffpanjq2" path="res://tiles/elevation.tres" id="8_y728v"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="9_gwpnv"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="10_f63i0"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="11_3hf7k"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="11_2s6si"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="12_7utab"] [ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="13_om8go"] [ext_resource type="PackedScene" uid="uid://dy8ohrl7j24qy" path="res://scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn" id="19_bigvs"] @@ -120,14 +120,11 @@ position = Vector2(608, -93) position = Vector2(0, 72) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=175216420] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("11_2s6si")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("11_3hf7k") next_scene = "uid://biwvr6vxj6ykk" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1246369757] position = Vector2(-1.5, -9.5) diff --git a/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn b/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn index 372a2c9565..6a61755dce 100644 --- a/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn +++ b/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn @@ -15,7 +15,7 @@ [ext_resource type="Texture2D" uid="uid://b5ooaiyxdrp6a" path="res://scenes/game_elements/components/light_texture_256x256.tres" id="12_g3km8"] [ext_resource type="Script" uid="uid://bk52qjv58locq" path="res://scenes/game_logic/light2d_behaviors/artificial_light_behavior.gd" id="13_e4f0h"] [ext_resource type="PackedScene" uid="uid://d0c4l7ev6ca3c" path="res://scenes/game_elements/props/spawn_point/spawn_point.tscn" id="14_s7qaw"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="16_d01n5"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="16_d01n5"] [ext_resource type="PackedScene" uid="uid://daqd67aro1o1m" path="res://scenes/game_elements/fx/time_and_weather/time_and_weather.tscn" id="16_qvyuv"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_stvbe"] @@ -121,10 +121,8 @@ metadata/_custom_type_script = "uid://bk52qjv58locq" position = Vector2(1348, 253) look_at_side_on_spawn = -1 -[node name="Teleporter" type="Area2D" parent="." unique_id=812046722] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("16_d01n5")] position = Vector2(1401, 201) -collision_layer = 4 -script = ExtResource("16_d01n5") next_scene = "uid://co2wxwlojq08k" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1238931458] diff --git a/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn b/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn index e073b9891b..7aa03f1f65 100644 --- a/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn +++ b/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn @@ -17,7 +17,7 @@ [ext_resource type="Script" uid="uid://du8wfijr35r35" path="res://scenes/game_elements/props/interact_area/interact_area.gd" id="15_o3luo"] [ext_resource type="PackedScene" uid="uid://d0c4l7ev6ca3c" path="res://scenes/game_elements/props/spawn_point/spawn_point.tscn" id="15_pr1ca"] [ext_resource type="PackedScene" uid="uid://daqd67aro1o1m" path="res://scenes/game_elements/fx/time_and_weather/time_and_weather.tscn" id="17_3d8kk"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="17_o3luo"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="17_o3luo"] [sub_resource type="CircleShape2D" id="CircleShape2D_h3871"] radius = 87.43 @@ -139,10 +139,8 @@ shape = SubResource("CircleShape2D_h3871") position = Vector2(525, 166) look_at_side_on_spawn = -1 -[node name="Teleporter" type="Area2D" parent="." unique_id=812046722] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("17_o3luo")] position = Vector2(-89, 336) -collision_layer = 4 -script = ExtResource("17_o3luo") next_scene = "uid://dep64htv6c4na" spawn_point_path = NodePath("SpawnPoint") enter_transition = 2 diff --git a/scenes/game_elements/props/teleporter/teleporter.tscn b/scenes/game_elements/props/teleporter/teleporter.tscn new file mode 100644 index 0000000000..b2468670eb --- /dev/null +++ b/scenes/game_elements/props/teleporter/teleporter.tscn @@ -0,0 +1,10 @@ +[gd_scene format=3 uid="uid://0ull24fvmhwk"] + +[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="1_f2088"] + +[node name="Teleporter" type="Area2D" unique_id=1779636661] +editor_description = "The player entering this area triggers either a scene switch to \"Next Scene\", or teleports the player within the current scene. + +Add a collision shape, and set the destination." +collision_layer = 4 +script = ExtResource("1_f2088") diff --git a/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn b/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn index 9feaf08751..ad702dbffc 100644 --- a/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn +++ b/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn @@ -25,9 +25,9 @@ [ext_resource type="Texture2D" uid="uid://cfkb8gpxylplg" path="res://scenes/game_elements/props/buildings/house/components/House_Patches_Red_Stage3.png" id="25_i7hju"] [ext_resource type="SpriteFrames" uid="uid://b81ibkdhsfthe" path="res://scenes/game_elements/props/decoration/butterfly/components/butterfly_flower_loop_1_red.tres" id="25_jpujn"] [ext_resource type="PackedScene" uid="uid://cfvr32bp2achm" path="res://scenes/game_elements/props/decoration/rock/fabric_rock.tscn" id="25_tweot"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="26_3knxh"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="26_jpujn"] [ext_resource type="SpriteFrames" uid="uid://bgckvdkxuxrgh" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_red_large.tres" id="27_tweot"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="28_357gc"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_sxarn"] size = Vector2(64, 64) @@ -292,14 +292,11 @@ shape = SubResource("RectangleShape2D_sxarn") [node name="TownieBridgePath" type="Path2D" parent="." unique_id=1835002713] curve = SubResource("Curve2D_iy1ja") -[node name="Teleporter" type="Area2D" parent="." unique_id=92829269] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("28_357gc")] position = Vector2(2739, 160) -collision_layer = 4 -script = ExtResource("26_3knxh") next_scene = "uid://durvgybueqayn" enter_transition = 2 exit_transition = 1 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=72600342] shape = SubResource("RectangleShape2D_iy1ja") diff --git a/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn b/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn index 37b73fdb1f..1c0e3e4abf 100644 --- a/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn +++ b/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn @@ -34,7 +34,7 @@ [ext_resource type="Script" uid="uid://x1mxt6bmei2o" path="res://scenes/ui_elements/cinematic/cinematic.gd" id="29_2be51"] [ext_resource type="Resource" uid="uid://bevp181alogxl" path="res://scenes/quests/lore_quests/quest_000/3_sequence_puzzle/components/tutorial_sequence_puzzle.dialogue" id="30_ypup5"] [ext_resource type="PackedScene" uid="uid://c4vbokn408f2c" path="res://scenes/game_elements/props/decoration/sheep/sheep.tscn" id="32_orron"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="34_2be51"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="36_44bhx"] [ext_resource type="PackedScene" uid="uid://dv4f232y8w8dv" path="res://scenes/game_elements/props/decoration/water_rock/water_rock.tscn" id="37_545ss"] [sub_resource type="Curve2D" id="Curve2D_ewpk3"] @@ -238,14 +238,11 @@ metadata/_custom_type_script = "uid://x1mxt6bmei2o" position = Vector2(-347, 289) curve = SubResource("Curve2D_ewpk3") -[node name="Teleporter" type="Area2D" parent="." unique_id=409163531] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("36_44bhx")] position = Vector2(927, -63) -collision_layer = 4 -script = ExtResource("34_2be51") next_scene = "uid://bk7lmd8tmkdql" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=261368868] shape = SubResource("RectangleShape2D_ypup5") diff --git a/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn b/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn index 1a1ec766f9..fc1e030efe 100644 --- a/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn +++ b/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn @@ -14,13 +14,13 @@ [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="11_sty8l"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="12_dcclj"] [ext_resource type="TileSet" uid="uid://b778cuoftt88r" path="res://tiles/elevation_2.tres" id="13_cqudy"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="13_eis6y"] [ext_resource type="TileSet" uid="uid://do0ffypatd77h" path="res://tiles/bridges.tres" id="13_nw4ve"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="14_culag"] [ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="15_2vr3v"] [ext_resource type="SpriteFrames" uid="uid://7yx2vrxg6ytx" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_blue_large.tres" id="15_6c68c"] [ext_resource type="PackedScene" uid="uid://b82nsrh332syj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/throwing_enemy.tscn" id="16_cmppr"] [ext_resource type="SpriteFrames" uid="uid://b3r84ksew5djp" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_purple.tres" id="17_laquw"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="17_sgtky"] [ext_resource type="AudioStream" uid="uid://qf2d38rabx8o" path="res://assets/third_party/sounds/characters/enemies/throwing_enemy/Wings.ogg" id="18_0816u"] [ext_resource type="AudioStream" uid="uid://bbnj2fog3rdy8" path="res://assets/first_party/sounds/throwing_enemy/Spray.wav" id="19_bex1y"] [ext_resource type="PackedScene" uid="uid://c5jedlvvnnbi0" path="res://scenes/game_elements/props/projectile/ink_blob_projectile.tscn" id="20_t8fi2"] @@ -182,15 +182,12 @@ position = Vector2(416, 0) position = Vector2(0, 72) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=650526093] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("17_sgtky")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("13_eis6y") next_scene = "uid://cb7tqsakwhpgk" spawn_point_path = NodePath("SpawnPointAfterIntro") enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1082155385] position = Vector2(-1.5, -9.5) diff --git a/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn b/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn index 2ec0a92ccd..c15d4928d6 100644 --- a/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn +++ b/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn @@ -18,9 +18,9 @@ [ext_resource type="SpriteFrames" uid="uid://bs0idpewu2plj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_yellow.tres" id="10_0kd4s"] [ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="10_muw2v"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="10_wqron"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="11_0kd4s"] [ext_resource type="SpriteFrames" uid="uid://dnq8cw1cio2we" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_green.tres" id="11_bk6nl"] [ext_resource type="AudioStream" uid="uid://qf2d38rabx8o" path="res://assets/third_party/sounds/characters/enemies/throwing_enemy/Wings.ogg" id="12_btlpg"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="13_14glv"] [ext_resource type="AudioStream" uid="uid://bbnj2fog3rdy8" path="res://assets/first_party/sounds/throwing_enemy/Spray.wav" id="13_i2l34"] [ext_resource type="PackedScene" uid="uid://c5jedlvvnnbi0" path="res://scenes/game_elements/props/projectile/ink_blob_projectile.tscn" id="14_oigmj"] @@ -117,14 +117,11 @@ position = Vector2(416, 0) position = Vector2(0, 82) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=853032262] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("13_14glv")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("11_0kd4s") next_scene = "uid://bo6qfusag3fae" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1924290223] position = Vector2(-1.5, -9.5) diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn index f4c9ae457f..beef0b42d5 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn @@ -22,11 +22,11 @@ [ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="14_bxmjx"] [ext_resource type="PackedScene" uid="uid://covsdqqsd6rsy" path="res://scenes/game_elements/props/sign/sign.tscn" id="14_omyxq"] [ext_resource type="Script" uid="uid://dagrhfrj0f33i" path="res://scenes/game_logic/camera_behaviors/frame_camera_behavior.gd" id="15_dwcg4"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="15_mg68y"] [ext_resource type="PackedScene" uid="uid://b7h2j0j6jmigc" path="res://scenes/game_elements/props/tree/tree_void_affected.tscn" id="22_374sg"] [ext_resource type="PackedScene" uid="uid://v3usqiwy5wpr" path="res://scenes/game_elements/props/decoration/rock/rock.tscn" id="23_p8sis"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="24_7iwrw"] [ext_resource type="SpriteFrames" uid="uid://bapks76u4hipj" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_green_small.tres" id="25_374sg"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="26_bxmjx"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_41yfr"] size = Vector2(140.5, 194.5) @@ -391,10 +391,8 @@ sprite_frames = ExtResource("25_374sg") position = Vector2(1429, 923) sprite_frames = ExtResource("25_374sg") -[node name="TeleporterNext" type="Area2D" parent="." unique_id=1852093842] +[node name="TeleporterNext" parent="." unique_id=1779636661 instance=ExtResource("26_bxmjx")] position = Vector2(1635, 282) -collision_layer = 4 -script = ExtResource("15_mg68y") next_scene = "uid://bk8rjvfmm20b7" enter_transition = 4 exit_transition = 5 @@ -402,13 +400,10 @@ exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="TeleporterNext" unique_id=89957691] shape = SubResource("RectangleShape2D_41yfr") -[node name="TeleporterBack" type="Area2D" parent="." unique_id=561115967] +[node name="TeleporterBack" parent="." unique_id=1295241363 instance=ExtResource("26_bxmjx")] position = Vector2(152, 454) -collision_layer = 4 -script = ExtResource("15_mg68y") next_scene = "uid://dpv6x7h2p2i3l" spawn_point_path = NodePath("SpawnPointBack") -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="TeleporterBack" unique_id=1443311540] position = Vector2(8, -6) diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn index 6c599dfd9e..bd3ee9d033 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn @@ -15,7 +15,7 @@ [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="12_sqxkk"] [ext_resource type="SpriteFrames" uid="uid://bapks76u4hipj" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_green_small.tres" id="13_udo54"] [ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="14_nlj8l"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="16_udo54"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="15_sqxkk"] [ext_resource type="PackedScene" uid="uid://mruqy04d0vl8" path="res://scenes/quests/lore_quests/quest_002/2_grappling_hook/components/buttons_collector.tscn" id="18_udo54"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_drlay"] @@ -323,10 +323,8 @@ sprite_frames = ExtResource("13_udo54") [node name="ButtonsCollector" parent="OnTheGround" unique_id=1634175369 instance=ExtResource("18_udo54")] position = Vector2(2690, 1305) -[node name="TeleporterNext" type="Area2D" parent="." unique_id=1560505035] +[node name="TeleporterNext" parent="." unique_id=1779636661 instance=ExtResource("15_sqxkk")] position = Vector2(3039, 1281) -collision_layer = 4 -script = ExtResource("16_udo54") next_scene = "uid://c3iv8nbog410p" enter_transition = 2 exit_transition = 1 diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn index d781327aaf..1534b95426 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn @@ -26,7 +26,7 @@ [ext_resource type="SpriteFrames" uid="uid://2ek86nvw6y28" path="res://scenes/game_elements/props/tree/components/tree_spriteframes_yellow.tres" id="21_y6p0v"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="22_iu48k"] [ext_resource type="SpriteFrames" uid="uid://bapks76u4hipj" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_green_small.tres" id="23_b7aom"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="25_iu48k"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="26_a36ca"] [sub_resource type="Resource" id="Resource_rlnni"] script = ExtResource("13_vodlh") @@ -347,10 +347,8 @@ sprite_frames = ExtResource("23_b7aom") [node name="Bush20" parent="OnTheGround/Bushes" unique_id=1989757828 instance=ExtResource("22_iu48k")] position = Vector2(1424, 2288) -[node name="Teleporter" type="Area2D" parent="." unique_id=970210635] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("26_a36ca")] position = Vector2(-1881, 1735) -collision_layer = 4 -script = ExtResource("25_iu48k") next_scene = "uid://b8mfigsd8y5qs" spawn_point_path = NodePath("SpawnPointFromPowerup") exit_transition = 0 diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn index 5f39a96363..7bb0c59378 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn @@ -24,7 +24,7 @@ [ext_resource type="PackedScene" uid="uid://1vunygl4wpj6" path="res://scenes/game_elements/props/button_item/button_item.tscn" id="15_wv4km"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="18_wv4km"] [ext_resource type="SpriteFrames" uid="uid://bapks76u4hipj" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_green_small.tres" id="19_6n4qp"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="20_wv4km"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="23_wv4km"] [sub_resource type="Animation" id="Animation_w67qe"] length = 0.001 @@ -303,10 +303,8 @@ sprite_frames = ExtResource("19_6n4qp") [node name="Bush14" parent="OnTheGround/Bushes" unique_id=391246514 instance=ExtResource("18_wv4km")] position = Vector2(261, 440) -[node name="Teleporter" type="Area2D" parent="." unique_id=579212473] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("23_wv4km")] position = Vector2(2704, 1216) -collision_layer = 4 -script = ExtResource("20_wv4km") next_scene = "uid://dpv6x7h2p2i3l" enter_transition = 2 exit_transition = 1 diff --git a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn index c3cd19f112..0e42d5ac30 100644 --- a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn +++ b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn @@ -26,8 +26,8 @@ [ext_resource type="SpriteFrames" uid="uid://7yx2vrxg6ytx" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_blue_large.tres" id="20_5axji"] [ext_resource type="SpriteFrames" uid="uid://k4jucjwkxxhc" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_purple_small.tres" id="21_bmrvw"] [ext_resource type="PackedScene" uid="uid://dv4f232y8w8dv" path="res://scenes/game_elements/props/decoration/water_rock/water_rock.tscn" id="21_c6u7c"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="22_rk3po"] [ext_resource type="PackedScene" uid="uid://dvj15pnuqr2ua" path="res://scenes/game_elements/props/hookable_button_item/hookable_button_item.tscn" id="23_bcye7"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="28_4laor"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_wgn4u"] size = Vector2(256, 128) @@ -667,12 +667,9 @@ navigation_polygon = SubResource("NavigationPolygon_c2723") metadata/_edit_lock_ = true metadata/_edit_group_ = true -[node name="Teleporter" type="Area2D" parent="." unique_id=977506941] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("28_4laor")] position = Vector2(3264, -503) -collision_layer = 4 -script = ExtResource("22_rk3po") next_scene = "uid://bcxwhqdqe7m2y" -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1861861880] position = Vector2(0, 23) diff --git a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn index 7e1976aa77..1e2596e3b8 100644 --- a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn +++ b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn @@ -26,10 +26,10 @@ [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="24_wrwcr"] [ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="25_0h87u"] [ext_resource type="SpriteFrames" uid="uid://b6doys1c3yelx" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_red_small.tres" id="25_bkul7"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="26_ipgsq"] [ext_resource type="SpriteFrames" uid="uid://bgckvdkxuxrgh" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_red_large.tres" id="26_jr6vd"] [ext_resource type="SpriteFrames" uid="uid://ckf0ncgsrnhek" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_purple_large.tres" id="27_jr6vd"] [ext_resource type="SpriteFrames" uid="uid://k4jucjwkxxhc" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_purple_small.tres" id="28_hxopk"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="30_jr6vd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_grfk2"] size = Vector2(246, 549) @@ -637,12 +637,9 @@ navigation_polygon = SubResource("NavigationPolygon_c2723") metadata/_edit_group_ = true metadata/_edit_lock_ = true -[node name="Teleporter" type="Area2D" parent="." unique_id=900135027] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("30_jr6vd")] position = Vector2(5101, 2383) -collision_layer = 4 -script = ExtResource("26_ipgsq") next_scene = "uid://doalg4wjntiff" -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1397103573] position = Vector2(0, 23) diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn index b215d0f771..0e4b76a8c8 100644 --- a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn @@ -10,9 +10,9 @@ [ext_resource type="TileSet" uid="uid://dfp36ffpanjq2" path="res://tiles/elevation.tres" id="7_ubp0p"] [ext_resource type="TileSet" uid="uid://bdc7ucso7bx0s" path="res://tiles/shadows.tres" id="8_gteq2"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="8_jgk56"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="9_jqnd2"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="10_qh3g1"] [ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="11_bfcsr"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="11_gteq2"] [ext_resource type="PackedScene" uid="uid://b82nsrh332syj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/throwing_enemy.tscn" id="12_30iwa"] [ext_resource type="SpriteFrames" uid="uid://3ujiuhj7wpm2" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_red.tres" id="13_7o6on"] [ext_resource type="PackedScene" uid="uid://c5jedlvvnnbi0" path="res://scenes/game_elements/props/projectile/ink_blob_projectile.tscn" id="14_jgk56"] @@ -114,14 +114,11 @@ position = Vector2(546, -2) position = Vector2(0, 82) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=947160005] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("11_gteq2")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("9_jqnd2") next_scene = "uid://ns43ceodawmb" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1924538751] position = Vector2(-1.5, -9.5) diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn index ba02b2dc7c..08e683e3ca 100644 --- a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn @@ -14,7 +14,7 @@ [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="8_8bvum"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="9_4cqf2"] [ext_resource type="TileSet" uid="uid://bdc7ucso7bx0s" path="res://tiles/shadows.tres" id="9_xpqp1"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="10_c2wf5"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="13_ifeq7"] [ext_resource type="PackedScene" uid="uid://b82nsrh332syj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/throwing_enemy.tscn" id="13_xpqp1"] [ext_resource type="AudioStream" uid="uid://qf2d38rabx8o" path="res://assets/third_party/sounds/characters/enemies/throwing_enemy/Wings.ogg" id="15_djbws"] [ext_resource type="AudioStream" uid="uid://bbnj2fog3rdy8" path="res://assets/first_party/sounds/throwing_enemy/Spray.wav" id="16_brd5j"] @@ -136,14 +136,11 @@ position = Vector2(608, -93) position = Vector2(0, 72) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=179843338] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("13_ifeq7")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("10_c2wf5") next_scene = "uid://biwvr6vxj6ykk" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=682866884] position = Vector2(-1.5, -9.5) diff --git a/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn b/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn index a56f389a9c..01acdc94ab 100644 --- a/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn +++ b/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn @@ -58,7 +58,7 @@ [ext_resource type="Texture2D" uid="uid://djen1whwwin1w" path="res://assets/third_party/inputs/atlas_kenney_input_prompts_1.4/keyboard/keyboard_f_outline.tres" id="33_1n21b"] [ext_resource type="Resource" uid="uid://bmharix12w26t" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_blink.dialogue" id="34_g76pt"] [ext_resource type="Texture2D" uid="uid://h606ovawbm0x" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/BlinkMarker.png" id="44_onp74"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="46_8k5n0"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="46_8k5n0"] [ext_resource type="Resource" uid="uid://cxjgjjb44ssnm" path="res://scenes/quests/story_quests/champ/3_stealth/stealth_components/champ_walking_on_water.dialogue" id="55_rosy4"] [sub_resource type="TileMapPattern" id="TileMapPattern_0wfyh"] @@ -1872,10 +1872,8 @@ position = Vector2(110, 34) scale = Vector2(0.75, 0.75) texture = ExtResource("44_onp74") -[node name="Teleporter" type="Area2D" parent="." unique_id=1237177419] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("46_8k5n0")] position = Vector2(1676, 519) -collision_layer = 4 -script = ExtResource("46_8k5n0") next_scene = "uid://bbjh0yoqbchuo" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=2026668028] diff --git a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn index 91a90fec40..a8cd5e3b66 100644 --- a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn +++ b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn @@ -9,8 +9,8 @@ [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="6_ulko6"] [ext_resource type="SpriteFrames" uid="uid://ckf0ncgsrnhek" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_purple_large.tres" id="7_5mbgn"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="7_ilmvt"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="8_gdj00"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="9_d7n4r"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="9_l4apx"] [ext_resource type="PackedScene" uid="uid://b82nsrh332syj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/throwing_enemy.tscn" id="11_28os0"] [ext_resource type="SpriteFrames" uid="uid://oggfoxxcn6ft" path="res://scenes/quests/story_quests/renya_beyond_sorrow/player_components/renya_player_combat.tres" id="11_bl6pj"] [ext_resource type="PackedScene" uid="uid://dbh80jgmf2crw" path="res://scenes/quests/story_quests/renya_beyond_sorrow/1_combat/enemies_components/projectile.tscn" id="13_63j25"] @@ -19,7 +19,7 @@ [ext_resource type="SpriteFrames" uid="uid://lt1fwrvd4a5h" path="res://scenes/quests/story_quests/renya_beyond_sorrow/1_combat/relleno/filling_spriteframes.tres" id="18_l4apx"] [ext_resource type="PackedScene" uid="uid://y8ha8abfyap2" path="res://scenes/game_elements/props/filling_barrel/filling_barrel.tscn" id="20_6urbs"] [ext_resource type="Script" uid="uid://x1mxt6bmei2o" path="res://scenes/ui_elements/cinematic/cinematic.gd" id="20_63j25"] -[ext_resource type="PackedScene" uid="uid://dkx3dgc1br3b4" path="res://scenes/ui_elements/input_hints/repel_hint.tscn" id="22_28yyq"] +[ext_resource type="PackedScene" uid="uid://dkx3dgc1br3b4" path="res://scenes/ui_elements/input_hints/repel_input_hint.tscn" id="22_28yyq"] [ext_resource type="PackedScene" uid="uid://7873qa54birk" path="res://scenes/game_elements/props/tree/tree.tscn" id="22_e8dsv"] [ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="23_vhod7"] @@ -136,14 +136,11 @@ position = Vector2(350, -949) position = Vector2(0, 72) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=1023548033] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("9_l4apx")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("8_gdj00") next_scene = "uid://buvo0sgtr3qeg" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1704183019] position = Vector2(-1.5, -9.5) diff --git a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn index 6a4be9e97c..d99514bb7e 100644 --- a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn +++ b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn @@ -8,8 +8,8 @@ [ext_resource type="SpriteFrames" uid="uid://ckf0ncgsrnhek" path="res://scenes/game_elements/props/decoration/bush/components/bush_spriteframes_purple_large.tres" id="6_2o143"] [ext_resource type="PackedScene" uid="uid://lgu7aeqa7o3r" path="res://scenes/game_elements/props/door/door.tscn" id="6_tm1ho"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="7_0ow6i"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="7_odyqf"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="8_fhg3o"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="9_rqh7d"] [ext_resource type="PackedScene" uid="uid://b82nsrh332syj" path="res://scenes/game_elements/characters/enemies/throwing_enemy/throwing_enemy.tscn" id="10_krssa"] [ext_resource type="SpriteFrames" uid="uid://oggfoxxcn6ft" path="res://scenes/quests/story_quests/renya_beyond_sorrow/player_components/renya_player_combat.tres" id="11_rqh7d"] [ext_resource type="PackedScene" uid="uid://dbh80jgmf2crw" path="res://scenes/quests/story_quests/renya_beyond_sorrow/1_combat/enemies_components/projectile.tscn" id="13_iaa72"] @@ -116,14 +116,11 @@ position = Vector2(993, 31) position = Vector2(0, 82) play_victory_fanfare_on_open = true -[node name="Teleporter" type="Area2D" parent="OnTheGround/LevelExit" unique_id=1668803933] +[node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("9_rqh7d")] position = Vector2(0, -25) -collision_layer = 4 -script = ExtResource("7_odyqf") next_scene = "uid://c2rc2y662wko0" enter_transition = 4 exit_transition = 5 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=272361307] position = Vector2(-1.5, -9.5) diff --git a/scenes/world_map/frays_end.tscn b/scenes/world_map/frays_end.tscn index 7c2ddd3d8d..848879f714 100644 --- a/scenes/world_map/frays_end.tscn +++ b/scenes/world_map/frays_end.tscn @@ -48,6 +48,7 @@ [ext_resource type="PackedScene" uid="uid://vb5o7hh5an8j" path="res://scenes/game_elements/characters/npcs/elder/template_elder.tscn" id="43_ppslc"] [ext_resource type="PackedScene" uid="uid://c0104ickpm3ru" path="res://scenes/game_elements/props/decoration/flower/flower.tscn" id="45_cjmkx"] [ext_resource type="PackedScene" uid="uid://cr65lmm5b0ueo" path="res://scenes/game_elements/characters/npcs/cat/cat.tscn" id="52_ppslc"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="53_2vvub"] [ext_resource type="PackedScene" uid="uid://dgrrudegturnw" path="res://scenes/game_elements/characters/npcs/townie.tscn" id="54_duxxr"] [ext_resource type="PackedScene" uid="uid://daqd67aro1o1m" path="res://scenes/game_elements/fx/time_and_weather/time_and_weather.tscn" id="55_ojao8"] [ext_resource type="Script" uid="uid://edcifob4jc4s" path="res://scenes/game_logic/talk_behavior.gd" id="56_ojao8"] @@ -55,7 +56,6 @@ [ext_resource type="Script" uid="uid://dts1hwdy3phin" path="res://scenes/menus/storybook/components/quest.gd" id="59_qgpx3"] [ext_resource type="Resource" uid="uid://t50glay2iqhg" path="res://scenes/quests/lore_quests/quest_002/quest.tres" id="60_6b07c"] [ext_resource type="Script" uid="uid://0enyu5v4ra34" path="res://scenes/game_elements/props/spawn_point/components/spawn_point.gd" id="61_6b07c"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="62_t7c6s"] [ext_resource type="PackedScene" uid="uid://covsdqqsd6rsy" path="res://scenes/game_elements/props/sign/sign.tscn" id="64_uxfrp"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_duxxr"] @@ -1097,13 +1097,10 @@ script = ExtResource("61_6b07c") look_at_side_on_spawn = 1 metadata/_custom_type_script = "uid://0enyu5v4ra34" -[node name="Teleporter" type="Area2D" parent="OnTheGround/WestPath" unique_id=39493186] +[node name="Teleporter" parent="OnTheGround/WestPath" unique_id=1779636661 instance=ExtResource("53_2vvub")] position = Vector2(-63, 712) -collision_layer = 4 -script = ExtResource("62_t7c6s") next_scene = "uid://c3pi5sjiy5tlg" spawn_point_path = NodePath("SpawnPoint") -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/WestPath/Teleporter" unique_id=1827344313] shape = SubResource("RectangleShape2D_ulm71") diff --git a/scenes/world_map/frays_end_west.tscn b/scenes/world_map/frays_end_west.tscn index 8dd3b4088d..a00dc8cd83 100644 --- a/scenes/world_map/frays_end_west.tscn +++ b/scenes/world_map/frays_end_west.tscn @@ -1,11 +1,11 @@ [gd_scene format=4 uid="uid://c3pi5sjiy5tlg"] [ext_resource type="TileSet" uid="uid://b8qnr0owsbhhn" path="res://tiles/exterior_floors.tres" id="1_6wkkr"] +[ext_resource type="PackedScene" uid="uid://0ull24fvmhwk" path="res://scenes/game_elements/props/teleporter/teleporter.tscn" id="1_ovokv"] [ext_resource type="TileSet" uid="uid://b778cuoftt88r" path="res://tiles/elevation_2.tres" id="2_eitnf"] [ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="3_7dntp"] [ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="4_ltemt"] [ext_resource type="PackedScene" uid="uid://dgrrudegturnw" path="res://scenes/game_elements/characters/npcs/townie.tscn" id="5_wf3xu"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="6_bp1pg"] [ext_resource type="PackedScene" uid="uid://covsdqqsd6rsy" path="res://scenes/game_elements/props/sign/sign.tscn" id="6_eitnf"] [ext_resource type="TileSet" uid="uid://41pk6xbhypue" path="res://tiles/fence.tres" id="7_2x7c2"] [ext_resource type="PackedScene" uid="uid://crqjcicx0vdu" path="res://scenes/game_elements/props/decoration/bush/bush.tscn" id="7_feqgw"] @@ -38,15 +38,12 @@ size = Vector2(52, 61) metadata/_edit_vertical_guides_ = [1281.0] metadata/_edit_horizontal_guides_ = [772.0] -[node name="Teleporter" type="Area2D" parent="." unique_id=1813334975] +[node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("1_ovokv")] position = Vector2(1349, 705) -collision_layer = 4 -script = ExtResource("6_bp1pg") next_scene = "uid://cufkthb25mpxy" spawn_point_path = NodePath("OnTheGround/WestPath/SpawnPointWestPath") enter_transition = 2 exit_transition = 1 -metadata/_custom_type_script = "uid://hqdquinbimce" [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1496141142] shape = SubResource("RectangleShape2D_8hv4q") diff --git a/tools/replace_teleporter_nodes_with_scene_instances.gd b/tools/replace_teleporter_nodes_with_scene_instances.gd new file mode 100644 index 0000000000..0de5054987 --- /dev/null +++ b/tools/replace_teleporter_nodes_with_scene_instances.gd @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: The Threadbare Authors +# SPDX-License-Identifier: MPL-2.0 +@tool +class_name ReplaceTeleporterNodesWithSceneInstances +extends EditorScript + +const Util = preload("./util.gd") +const TELEPORTER_GD_UID := "uid://hqdquinbimce" +const TELEPORTER_SCENE: PackedScene = preload( + "res://scenes/game_elements/props/teleporter/teleporter.tscn" +) + + +func _examine(packed_scene: PackedScene) -> void: + var scene_state := packed_scene.get_state() + var scene_root := packed_scene.instantiate(PackedScene.GenEditState.GEN_EDIT_STATE_INSTANCE) + + for node_idx: int in scene_state.get_node_count(): + var path := scene_state.get_node_path(node_idx) + + var found := false + for prop_idx: int in scene_state.get_node_property_count(node_idx): + var prop_name := scene_state.get_node_property_name(node_idx, prop_idx) + var prop_value: Variant = scene_state.get_node_property_value(node_idx, prop_idx) + if prop_name == "metadata/_custom_type_script" and prop_value == TELEPORTER_GD_UID: + found = true + break + elif prop_name == "script" and ResourceUID.path_to_uid((prop_value as Script).resource_path) == TELEPORTER_GD_UID: + found = true + break + + if not found: + continue + + var orig: Node = scene_root.get_node(path) + var replacement: Node = TELEPORTER_SCENE.instantiate( + PackedScene.GenEditState.GEN_EDIT_STATE_INSTANCE + ) + orig.replace_by(replacement) + + replacement.name = orig.name + replacement.scene_file_path = TELEPORTER_SCENE.resource_path + replacement.owner = scene_root + + for prop_idx: int in scene_state.get_node_property_count(node_idx): + var prop_name := scene_state.get_node_property_name(node_idx, prop_idx) + var prop_value: Variant = scene_state.get_node_property_value(node_idx, prop_idx) + + if prop_name not in ["metadata/_custom_type_script", "script"]: + replacement.set(prop_name, prop_value) + + orig.free() + + var result := packed_scene.pack(scene_root) + assert(result == OK, error_string(result)) + + result = ResourceSaver.save(packed_scene) + assert(result == OK, error_string(result)) + + +func _should_check(scene_path: String) -> bool: + if scene_path == TELEPORTER_SCENE.resource_path: + return false + + for dependency in ResourceLoader.get_dependencies(scene_path): + if dependency.contains("::"): + var uid := dependency.get_slice("::", 0) + if uid == TELEPORTER_GD_UID: + return true + + return false + + +func _run() -> void: + for scene: PackedScene in Util.find_scenes("res://", _should_check): + print(scene.resource_path) + _examine(scene) diff --git a/tools/replace_teleporter_nodes_with_scene_instances.gd.uid b/tools/replace_teleporter_nodes_with_scene_instances.gd.uid new file mode 100644 index 0000000000..2aafa711c3 --- /dev/null +++ b/tools/replace_teleporter_nodes_with_scene_instances.gd.uid @@ -0,0 +1 @@ +uid://vgtxxaxclclg From a8c2918d437c09b2608cb5804d38525acd5e48b9 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 22 May 2026 11:18:08 +0100 Subject: [PATCH 4/4] Refactor Teleporter to a reusable SceneLink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, Teleporter allowed you to specify the target spawn point and configure the scene transitions, but CollectibleItem and Cinematic did not. Annoying – I want the player to enter Fray's End from the south at the end of the tutorial, but the last action is to collect a thread so I couldn't. Rename Teleporter to SceneLink. Give it a fresh UID. Change its base class to Node2D rather than Area2D, and move the Area2D-specific logic to a helper node inside the Teleporter scene. Use my favourite niche feature of the Godot type system, as described in a comment. Use CONNECT_DEFERRED to avoid needing to put a call_deferred inside the teleport logic. Then, make Cinematic and CollectibleItem extend SceneLink; delete their bespoke scene-switching logic. Add validation of spawn_point_path. It's a bit weird for this to be a Node2D but it's necessary because CollectibleItem is a Node2D. (Cinematic has always been a Node2D rather than a Node – but this error has proven useful!) Change the default transition effects to FADE. This matches what Cinematic did by default before. It also doesn't look actively wrong if misconfigured, unlike the directional effects. Nonetheless, I also attempted to fix all teleporters to use the correct directions. I updated the splash screen to use this node directly. It's not really much help but it doesn't hurt either. I did not update the Sokoban rule engine or some other places that switch scenes in code to use this node because it doesn't really help much there. Resolves https://github.com/endlessm/threadbare/issues/2159 --- .../mothsache/Mothsache_test_scene.tscn | 2 +- .../components/1_time_and_weather_museum.tscn | 2 + .../components/2_time_and_weather_museum.tscn | 2 +- .../collectible_item/collectible_item.tscn | 2 + .../components/collectible_item.gd | 16 ++-- .../props/teleporter/teleporter.gd.uid | 1 - .../props/teleporter/teleporter.tscn | 10 ++- .../props/teleporter/teleporter_logic.gd | 36 +++++++++ .../props/teleporter/teleporter_logic.gd.uid | 1 + .../scene_switcher/scene_link.gd} | 50 ++++++------ .../globals/scene_switcher/scene_link.gd.uid | 1 + .../scene_switcher/transitions/transitions.gd | 5 -- scenes/menus/splash/components/splash.gd | 9 +-- scenes/menus/splash/splash.tscn | 7 +- .../tutorial_ruined_village.tscn | 2 +- .../quest_000/2_stealth/tutorial_stealth.tscn | 3 +- .../tutorial_sequence_puzzle.tscn | 2 +- .../4_ink_combat/tutorial_ink_combat.tscn | 2 +- .../2_ink_combat/ink_combat_round_2.tscn | 2 +- .../closing_transition.tscn | 2 + .../grappling_hook_needles.tscn | 4 +- .../2_grappling_hook/grappling_hook_pins.tscn | 2 +- .../grappling_hook_powerup.tscn | 3 +- .../grappling_hook_start.tscn | 5 +- .../3_void_grappling/void_grappling.tscn | 2 + .../void_grappling_round_2.tscn | 2 + .../ink_combat_round_4.tscn | 2 +- .../ink_combat_round_5.tscn | 2 +- .../champ/3_stealth/champ_stealth.tscn | 6 +- .../1_combat/renya_combat_round_1.tscn | 2 +- .../1_combat/renya_combat_round_2.tscn | 2 +- scenes/ui_elements/cinematic/cinematic.gd | 24 ++---- scenes/world_map/frays_end.tscn | 2 + scenes/world_map/frays_end_west.tscn | 2 +- ...e_teleporter_nodes_with_scene_instances.gd | 77 ------------------- ...leporter_nodes_with_scene_instances.gd.uid | 1 - 36 files changed, 134 insertions(+), 161 deletions(-) delete mode 100644 scenes/game_elements/props/teleporter/teleporter.gd.uid create mode 100644 scenes/game_elements/props/teleporter/teleporter_logic.gd create mode 100644 scenes/game_elements/props/teleporter/teleporter_logic.gd.uid rename scenes/{game_elements/props/teleporter/teleporter.gd => globals/scene_switcher/scene_link.gd} (76%) create mode 100644 scenes/globals/scene_switcher/scene_link.gd.uid delete mode 100644 tools/replace_teleporter_nodes_with_scene_instances.gd delete mode 100644 tools/replace_teleporter_nodes_with_scene_instances.gd.uid diff --git a/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn b/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn index c4fc729848..4abb7f36ad 100644 --- a/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn +++ b/scenes/game_elements/characters/enemies/mothsache/Mothsache_test_scene.tscn @@ -123,7 +123,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("11_2s6si")] position = Vector2(0, -25) next_scene = "uid://biwvr6vxj6ykk" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1246369757] diff --git a/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn b/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn index 6a61755dce..6a5132441c 100644 --- a/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn +++ b/scenes/game_elements/fx/time_and_weather/components/1_time_and_weather_museum.tscn @@ -124,6 +124,8 @@ look_at_side_on_spawn = -1 [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("16_d01n5")] position = Vector2(1401, 201) next_scene = "uid://co2wxwlojq08k" +enter_transition = 1 +exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1238931458] position = Vector2(45, 51.5) diff --git a/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn b/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn index 7aa03f1f65..14d85975cd 100644 --- a/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn +++ b/scenes/game_elements/fx/time_and_weather/components/2_time_and_weather_museum.tscn @@ -144,7 +144,7 @@ position = Vector2(-89, 336) next_scene = "uid://dep64htv6c4na" spawn_point_path = NodePath("SpawnPoint") enter_transition = 2 -exit_transition = 1 +exit_transition = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1238931458] position = Vector2(45, 51.5) diff --git a/scenes/game_elements/props/collectible_item/collectible_item.tscn b/scenes/game_elements/props/collectible_item/collectible_item.tscn index b9aece7947..d35de6aefe 100644 --- a/scenes/game_elements/props/collectible_item/collectible_item.tscn +++ b/scenes/game_elements/props/collectible_item/collectible_item.tscn @@ -300,6 +300,8 @@ height = 28.0 [node name="CollectibleItem" type="Node2D" unique_id=327991066] script = ExtResource("1_7ff3m") +enter_transition = 0 +exit_transition = 0 [node name="InteractArea" type="Area2D" parent="." unique_id=1327503985 node_paths=PackedStringArray("marker")] collision_layer = 32 diff --git a/scenes/game_elements/props/collectible_item/components/collectible_item.gd b/scenes/game_elements/props/collectible_item/components/collectible_item.gd index 31807142be..4ce437106f 100644 --- a/scenes/game_elements/props/collectible_item/components/collectible_item.gd +++ b/scenes/game_elements/props/collectible_item/components/collectible_item.gd @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: The Threadbare Authors # SPDX-License-Identifier: MPL-2.0 @tool -class_name CollectibleItem extends Node2D +class_name CollectibleItem +extends SceneLink ## Overworld collectible that can be interacted with. When a player interacts ## with it, an [InventoryItem] is added to the [Inventory] @@ -14,9 +15,6 @@ class_name CollectibleItem extends Node2D revealed = new_value _update_based_on_revealed() -## If provided, switch to this scene after collecting and possibly displaying a dialogue. -@export_file("*.tscn") var next_scene: String - ## [InventoryItem] provided by this collectible when interacted with. @export var item: InventoryItem: set = _set_item @@ -40,6 +38,7 @@ class_name CollectibleItem extends Node2D func _validate_property(property: Dictionary) -> void: + super._validate_property(property) match property.name: "dialogue_title": if not collected_dialogue: @@ -47,9 +46,10 @@ func _validate_property(property: Dictionary) -> void: func _get_configuration_warnings() -> PackedStringArray: + var warnings := super._get_configuration_warnings() if not item: - return ["item property must be set"] - return [] + warnings.append("item property must be set") + return warnings func _set_item(new_value: InventoryItem) -> void: @@ -65,6 +65,8 @@ func _set_item(new_value: InventoryItem) -> void: func _ready() -> void: + super._ready() + _set_item(item) _update_based_on_revealed() sprite_2d.modulate = Color.WHITE if revealed else Color.TRANSPARENT @@ -102,7 +104,7 @@ func _on_interacted(player: Player, _from_right: bool) -> void: if next_scene: GameState.set_challenge_start_scene(next_scene) - SceneSwitcher.change_to_file_with_transition(next_scene) + switch() func _update_based_on_revealed() -> void: diff --git a/scenes/game_elements/props/teleporter/teleporter.gd.uid b/scenes/game_elements/props/teleporter/teleporter.gd.uid deleted file mode 100644 index 065669c47a..0000000000 --- a/scenes/game_elements/props/teleporter/teleporter.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://hqdquinbimce diff --git a/scenes/game_elements/props/teleporter/teleporter.tscn b/scenes/game_elements/props/teleporter/teleporter.tscn index b2468670eb..0d5c1347ea 100644 --- a/scenes/game_elements/props/teleporter/teleporter.tscn +++ b/scenes/game_elements/props/teleporter/teleporter.tscn @@ -1,10 +1,16 @@ [gd_scene format=3 uid="uid://0ull24fvmhwk"] -[ext_resource type="Script" uid="uid://hqdquinbimce" path="res://scenes/game_elements/props/teleporter/teleporter.gd" id="1_f2088"] +[ext_resource type="Script" uid="uid://d2vp62mjrf6gn" path="res://scenes/globals/scene_switcher/scene_link.gd" id="1_2wkov"] +[ext_resource type="Script" uid="uid://0gr6vi3gxhcp" path="res://scenes/game_elements/props/teleporter/teleporter_logic.gd" id="2_2wkov"] [node name="Teleporter" type="Area2D" unique_id=1779636661] editor_description = "The player entering this area triggers either a scene switch to \"Next Scene\", or teleports the player within the current scene. Add a collision shape, and set the destination." collision_layer = 4 -script = ExtResource("1_f2088") +script = ExtResource("1_2wkov") + +[node name="TeleporterLogic" type="Node" parent="." unique_id=713140263 node_paths=PackedStringArray("teleport_area", "scene_link")] +script = ExtResource("2_2wkov") +teleport_area = NodePath("..") +scene_link = NodePath("..") diff --git a/scenes/game_elements/props/teleporter/teleporter_logic.gd b/scenes/game_elements/props/teleporter/teleporter_logic.gd new file mode 100644 index 0000000000..4a7460004a --- /dev/null +++ b/scenes/game_elements/props/teleporter/teleporter_logic.gd @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: The Threadbare Authors +# SPDX-License-Identifier: MPL-2.0 +extends Node +# The Teleporter component needs to be an Area2D so that collision shapes can be +# added as children in each scene using it. But it also needs to be a SceneLink, +# which does not extend Area2D. +# +# In GDScript, if you have a node of type U (e.g. Area2D) which extends T (e.g. +# Node2D), you can attach a script which extends T (in this case SceneLink) to +# it. So then the only missing piece is to connect the Area2D's signals to the +# SceneLink.switch() method, and that's where this script comes in. +# +# If Godot supported traits, or re-exported properties of child nodes, we +# wouldn't need this weird workaround. + +@export var teleport_area: Area2D +@export var scene_link: SceneLink + + +func _connect() -> void: + # ONE_SHOT to avoid triggering the same teleporter while the transition is running. + # DEFERRED because otherwise if use_transition is false, switching scene + # would delete Area2D during a physics callback - bad! + var flags := CONNECT_ONE_SHOT | CONNECT_DEFERRED + teleport_area.body_entered.connect(_on_teleport_area_body_entered, flags) + + +func _on_teleport_area_body_entered(_body: Node2D) -> void: + await scene_link.switch() + if not scene_link.next_scene: + # We didn't change scene - re-enable the teleporter + _connect() + + +func _ready() -> void: + _connect() diff --git a/scenes/game_elements/props/teleporter/teleporter_logic.gd.uid b/scenes/game_elements/props/teleporter/teleporter_logic.gd.uid new file mode 100644 index 0000000000..ae54f21707 --- /dev/null +++ b/scenes/game_elements/props/teleporter/teleporter_logic.gd.uid @@ -0,0 +1 @@ +uid://0gr6vi3gxhcp diff --git a/scenes/game_elements/props/teleporter/teleporter.gd b/scenes/globals/scene_switcher/scene_link.gd similarity index 76% rename from scenes/game_elements/props/teleporter/teleporter.gd rename to scenes/globals/scene_switcher/scene_link.gd index 2577592c7f..0cefe485fb 100644 --- a/scenes/game_elements/props/teleporter/teleporter.gd +++ b/scenes/globals/scene_switcher/scene_link.gd @@ -1,8 +1,12 @@ # SPDX-FileCopyrightText: The Threadbare Authors # SPDX-License-Identifier: MPL-2.0 @tool -class_name Teleporter -extends Area2D +class_name SceneLink +extends Node2D +## Represents a potential transition to another scene. +## +## This can be used directly, but acts primarily a base class for other +## components: [Cinematic], [CollectibleItem], and the Teleporter scene. const SPAWN_POINT_GROUP_NAME: String = "spawn_point" @@ -13,7 +17,6 @@ const SPAWN_POINT_GROUP_NAME: String = "spawn_point" set(new_value): next_scene = new_value _update_available_spawn_points() - notify_property_list_changed() ## Which SpawnPoint in [member next_scene] the player character should start at; ## or blank/NONE to start at the default position in the scene. @@ -23,46 +26,38 @@ const SPAWN_POINT_GROUP_NAME: String = "spawn_point" spawn_point_path = ^"" else: spawn_point_path = new_val + update_configuration_warnings() @export_group("Transition") -## Whether to use a visual transition effect when the player enters the teleporter. +## Whether to use a visual transition effect when switching to the target scene. @export var use_transition: bool = true: set(new_val): use_transition = new_val notify_property_list_changed() -## Transition to use when the player enters this teleport. -@export var enter_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE +## Transition to use at the start of the switch to [member next_scene]. +@export var enter_transition: Transition.Effect = Transition.Effect.FADE -## Transition to use when the player leaves this teleport. -@export var exit_transition: Transition.Effect = Transition.Effect.RIGHT_TO_LEFT_WIPE +## Transition to use at the end of the switch to [member next_scene]. +@export var exit_transition: Transition.Effect = Transition.Effect.FADE var _available_spawn_points: Array[NodePath] = [] func _ready() -> void: - collision_layer = 0 - collision_mask = 0 - set_collision_layer_value(3, true) - set_collision_mask_value(1, true) - if Engine.is_editor_hint(): _update_available_spawn_points() - notify_property_list_changed() return - self.body_entered.connect(_on_body_entered, CONNECT_ONE_SHOT) - -func _on_body_entered(_body: PhysicsBody2D) -> void: +## Trigger the scene-switch or teleport described by [member next_scene] and +## [member spawn_point_path], with the configured transition. +func switch() -> void: var next_scene_path := _get_next_scene_path() if next_scene_path and next_scene_path != get_tree().current_scene.scene_file_path: - # We are using call_deferred here because removing nodes with - # collisions during a callback caused by a collision might cause - # undesired behavior. if use_transition: - SceneSwitcher.change_to_file_with_transition.call_deferred( + SceneSwitcher.change_to_file_with_transition( next_scene, spawn_point_path, enter_transition, exit_transition ) else: @@ -72,7 +67,7 @@ func _on_body_entered(_body: PhysicsBody2D) -> void: if is_instance_valid(spawn_point): if use_transition: - Transitions.do_transition( + await Transitions.do_transition( self._teleport_to_spawn_point.bind(spawn_point), enter_transition, exit_transition @@ -83,7 +78,6 @@ func _on_body_entered(_body: PhysicsBody2D) -> void: func _teleport_to_spawn_point(spawn_point: SpawnPoint) -> void: spawn_point.move_player_to_self_position(true) - self.body_entered.connect(_on_body_entered, CONNECT_ONE_SHOT) func _get_next_scene_path() -> String: @@ -119,6 +113,9 @@ func _update_available_spawn_points() -> void: _available_spawn_points = paths + notify_property_list_changed() + update_configuration_warnings() + func _validate_property(property: Dictionary) -> void: match property.name: @@ -132,3 +129,10 @@ func _validate_property(property: Dictionary) -> void: "exit_transition": if not use_transition: property.usage |= PROPERTY_USAGE_READ_ONLY + + +func _get_configuration_warnings() -> PackedStringArray: + var warnings: PackedStringArray + if spawn_point_path and spawn_point_path not in _available_spawn_points: + warnings.append("Spawn point '%s' does not exist" % [spawn_point_path]) + return warnings diff --git a/scenes/globals/scene_switcher/scene_link.gd.uid b/scenes/globals/scene_switcher/scene_link.gd.uid new file mode 100644 index 0000000000..d82c10fb1f --- /dev/null +++ b/scenes/globals/scene_switcher/scene_link.gd.uid @@ -0,0 +1 @@ +uid://d2vp62mjrf6gn diff --git a/scenes/globals/scene_switcher/transitions/transitions.gd b/scenes/globals/scene_switcher/transitions/transitions.gd index a7d03c0d44..16da0631bf 100644 --- a/scenes/globals/scene_switcher/transitions/transitions.gd +++ b/scenes/globals/scene_switcher/transitions/transitions.gd @@ -11,20 +11,15 @@ signal finished enum Effect { ## Fade the whole screen to/from black at once FADE, - ## Fade to/from black starting from the left of the screen and moving right LEFT_TO_RIGHT_WIPE, - ## Fade to/from black starting from the right of the screen and moving left RIGHT_TO_LEFT_WIPE, - ## Fade to black from the edges of the screen to a circle in the middle; ## fade from black starting at the middle and working outwards. RADIAL, - ## Fade to/from black starting from the top of the screen and moving down TOP_TO_BOTTOM_WIPE, - ## Fade to/from black starting from the bottom of the screen and moving up BOTTOM_TO_TOP_WIPE, } diff --git a/scenes/menus/splash/components/splash.gd b/scenes/menus/splash/components/splash.gd index 20a0751e3f..dc6a7cbc98 100644 --- a/scenes/menus/splash/components/splash.gd +++ b/scenes/menus/splash/components/splash.gd @@ -2,15 +2,14 @@ # SPDX-License-Identifier: MPL-2.0 extends Control -@export_file("*.tscn") var next_scene: String - @onready var logo_stitcher: LogoStitcher = %LogoStitcher @onready var scene_switch_timer: Timer = %SceneSwitchTimer +@onready var scene_link: SceneLink = %SceneLink func _ready() -> void: if ProjectSettings.get_setting(ThreadbareProjectSettings.SKIP_SPLASH): - SceneSwitcher.change_to_file.call_deferred(next_scene) + SceneSwitcher.change_to_file.call_deferred(scene_link.next_scene) return logo_stitcher.finished.connect(scene_switch_timer.start) scene_switch_timer.timeout.connect(switch_to_intro) @@ -28,6 +27,4 @@ func _unhandled_input(event: InputEvent) -> void: func switch_to_intro() -> void: scene_switch_timer.timeout.disconnect(switch_to_intro) - SceneSwitcher.change_to_file_with_transition( - next_scene, ^"", Transition.Effect.FADE, Transition.Effect.FADE - ) + scene_link.switch() diff --git a/scenes/menus/splash/splash.tscn b/scenes/menus/splash/splash.tscn index 1c59d2d7f0..61bacc2e3a 100644 --- a/scenes/menus/splash/splash.tscn +++ b/scenes/menus/splash/splash.tscn @@ -5,6 +5,7 @@ [ext_resource type="Script" uid="uid://bcc0gc6fkr2m4" path="res://scenes/menus/splash/components/logo_stitcher.gd" id="3_m61hw"] [ext_resource type="Texture2D" uid="uid://lg5dl13njsg3" path="res://assets/first_party/tiles/Grass_And_Sand_Tiles.png" id="3_unn6g"] [ext_resource type="AudioStream" uid="uid://dwkbxxoh57hht" path="res://assets/third_party/sewing-machine/746897__kzarkses__machantq_sewing-machine-running_cp_none_mke600.ogg" id="4_xtuk2"] +[ext_resource type="Script" uid="uid://d2vp62mjrf6gn" path="res://scenes/globals/scene_switcher/scene_link.gd" id="6_lp5r8"] [sub_resource type="Curve" id="Curve_7hvf5"] bake_resolution = 400 @@ -26,7 +27,6 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_a6n0j") -next_scene = "uid://stdqc6ttomff" [node name="FabricBackground" type="NinePatchRect" parent="." unique_id=757888685] modulate = Color(0.345098, 0.215686, 0.929412, 1) @@ -90,3 +90,8 @@ bus = &"SFX" unique_name_in_owner = true wait_time = 5.0 one_shot = true + +[node name="SceneLink" type="Node2D" parent="." unique_id=2122954713] +unique_name_in_owner = true +script = ExtResource("6_lp5r8") +next_scene = "uid://stdqc6ttomff" diff --git a/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn b/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn index ad702dbffc..a0c5b4c8e8 100644 --- a/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn +++ b/scenes/quests/lore_quests/quest_000/1_ruined_village/tutorial_ruined_village.tscn @@ -295,7 +295,7 @@ curve = SubResource("Curve2D_iy1ja") [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("28_357gc")] position = Vector2(2739, 160) next_scene = "uid://durvgybueqayn" -enter_transition = 2 +enter_transition = 1 exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=72600342] diff --git a/scenes/quests/lore_quests/quest_000/2_stealth/tutorial_stealth.tscn b/scenes/quests/lore_quests/quest_000/2_stealth/tutorial_stealth.tscn index 7f158b61b3..8158f2cce2 100644 --- a/scenes/quests/lore_quests/quest_000/2_stealth/tutorial_stealth.tscn +++ b/scenes/quests/lore_quests/quest_000/2_stealth/tutorial_stealth.tscn @@ -259,8 +259,9 @@ debug_color = Color(0, 0, 0, 0.42) unique_name_in_owner = true position = Vector2(2881, 254) revealed = false -next_scene = "uid://c2cdgfy31u86r" item = SubResource("Resource_rl5ft") +next_scene = "uid://c2cdgfy31u86r" +exit_transition = 5 [node name="Tree" parent="OnTheGround" unique_id=1182216860 instance=ExtResource("30_06hgc")] position = Vector2(2783, 34) diff --git a/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn b/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn index 1c0e3e4abf..096c051cee 100644 --- a/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn +++ b/scenes/quests/lore_quests/quest_000/3_sequence_puzzle/tutorial_sequence_puzzle.tscn @@ -241,7 +241,7 @@ curve = SubResource("Curve2D_ewpk3") [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("36_44bhx")] position = Vector2(927, -63) next_scene = "uid://bk7lmd8tmkdql" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=261368868] diff --git a/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn b/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn index fc1e030efe..7f19ad6084 100644 --- a/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn +++ b/scenes/quests/lore_quests/quest_000/4_ink_combat/tutorial_ink_combat.tscn @@ -186,7 +186,7 @@ play_victory_fanfare_on_open = true position = Vector2(0, -25) next_scene = "uid://cb7tqsakwhpgk" spawn_point_path = NodePath("SpawnPointAfterIntro") -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1082155385] diff --git a/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn b/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn index c15d4928d6..db74ffc42e 100644 --- a/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn +++ b/scenes/quests/lore_quests/quest_001/2_ink_combat/ink_combat_round_2.tscn @@ -120,7 +120,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("13_14glv")] position = Vector2(0, -25) next_scene = "uid://bo6qfusag3fae" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1924290223] diff --git a/scenes/quests/lore_quests/quest_001/4_closing_transition/closing_transition.tscn b/scenes/quests/lore_quests/quest_001/4_closing_transition/closing_transition.tscn index 83e590ba00..bda16ca577 100644 --- a/scenes/quests/lore_quests/quest_001/4_closing_transition/closing_transition.tscn +++ b/scenes/quests/lore_quests/quest_001/4_closing_transition/closing_transition.tscn @@ -384,6 +384,8 @@ script = ExtResource("4_3dlh8") dialogue = ExtResource("5_offe2") animation_player = NodePath("AnimationPlayer") next_scene = "uid://cufkthb25mpxy" +enter_transition = 0 +exit_transition = 0 [node name="AnimationPlayer" type="AnimationPlayer" parent="ClosingTransitionCinematic" unique_id=744023009] libraries/ = SubResource("AnimationLibrary_gyhjf") diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn index beef0b42d5..ec25d3134d 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_needles.tscn @@ -394,7 +394,7 @@ sprite_frames = ExtResource("25_374sg") [node name="TeleporterNext" parent="." unique_id=1779636661 instance=ExtResource("26_bxmjx")] position = Vector2(1635, 282) next_scene = "uid://bk8rjvfmm20b7" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="TeleporterNext" unique_id=89957691] @@ -404,6 +404,8 @@ shape = SubResource("RectangleShape2D_41yfr") position = Vector2(152, 454) next_scene = "uid://dpv6x7h2p2i3l" spawn_point_path = NodePath("SpawnPointBack") +enter_transition = 2 +exit_transition = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="TeleporterBack" unique_id=1443311540] position = Vector2(8, -6) diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn index bd3ee9d033..c2e2d2b974 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_pins.tscn @@ -326,7 +326,7 @@ position = Vector2(2690, 1305) [node name="TeleporterNext" parent="." unique_id=1779636661 instance=ExtResource("15_sqxkk")] position = Vector2(3039, 1281) next_scene = "uid://c3iv8nbog410p" -enter_transition = 2 +enter_transition = 1 exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="TeleporterNext" unique_id=875568514] diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn index 1534b95426..449ff991a6 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_powerup.tscn @@ -351,7 +351,8 @@ position = Vector2(1424, 2288) position = Vector2(-1881, 1735) next_scene = "uid://b8mfigsd8y5qs" spawn_point_path = NodePath("SpawnPointFromPowerup") -exit_transition = 0 +enter_transition = 2 +exit_transition = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=769048811] shape = SubResource("RectangleShape2D_s7yva") diff --git a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn index 7bb0c59378..d3e8ee88a6 100644 --- a/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn +++ b/scenes/quests/lore_quests/quest_002/2_grappling_hook/grappling_hook_start.tscn @@ -228,8 +228,9 @@ position = Vector2(1132, 1079) [node name="CollectibleItem" parent="OnTheGround" unique_id=317578047 instance=ExtResource("7_upilw")] position = Vector2(1434, 520) -next_scene = "uid://ce7nk8qmi64d2" item = SubResource("Resource_kr8u1") +next_scene = "uid://ce7nk8qmi64d2" +exit_transition = 1 [node name="Sign" parent="OnTheGround" unique_id=516698120 instance=ExtResource("9_vdhd3")] position = Vector2(2552, 1168) @@ -306,7 +307,7 @@ position = Vector2(261, 440) [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("23_wv4km")] position = Vector2(2704, 1216) next_scene = "uid://dpv6x7h2p2i3l" -enter_transition = 2 +enter_transition = 1 exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1421802846] diff --git a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn index 0e42d5ac30..189bbfdc0d 100644 --- a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn +++ b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling.tscn @@ -670,6 +670,8 @@ metadata/_edit_group_ = true [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("28_4laor")] position = Vector2(3264, -503) next_scene = "uid://bcxwhqdqe7m2y" +enter_transition = 1 +exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1861861880] position = Vector2(0, 23) diff --git a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn index 1e2596e3b8..963021a368 100644 --- a/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn +++ b/scenes/quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn @@ -640,6 +640,8 @@ metadata/_edit_lock_ = true [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("30_jr6vd")] position = Vector2(5101, 2383) next_scene = "uid://doalg4wjntiff" +enter_transition = 1 +exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1397103573] position = Vector2(0, 23) diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn index 0e4b76a8c8..e915578d04 100644 --- a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_4.tscn @@ -117,7 +117,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("11_gteq2")] position = Vector2(0, -25) next_scene = "uid://ns43ceodawmb" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1924538751] diff --git a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn index 08e683e3ca..8add805dcc 100644 --- a/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn +++ b/scenes/quests/lore_quests/quest_003/2_ink_drinker_levels/ink_combat_round_5.tscn @@ -139,7 +139,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("13_ifeq7")] position = Vector2(0, -25) next_scene = "uid://biwvr6vxj6ykk" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=682866884] diff --git a/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn b/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn index 01acdc94ab..33ef07a858 100644 --- a/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn +++ b/scenes/quests/story_quests/champ/3_stealth/champ_stealth.tscn @@ -1781,15 +1781,15 @@ text = "Walk on water" [node name="CollectibleItem" parent="." unique_id=1250372978 instance=ExtResource("11_680ig")] position = Vector2(892, -2934) -next_scene = "uid://bbjh0yoqbchuo" item = SubResource("Resource_x1dad") collected_dialogue = ExtResource("13_oswsn") +next_scene = "uid://bbjh0yoqbchuo" [node name="CollectibleItem2" parent="." unique_id=327991066 instance=ExtResource("11_680ig")] position = Vector2(2510, 513) -next_scene = "uid://bbjh0yoqbchuo" item = SubResource("Resource_x1dad") collected_dialogue = ExtResource("13_oswsn") +next_scene = "uid://bbjh0yoqbchuo" [node name="Cinematic" type="Node2D" parent="." unique_id=260237335] script = ExtResource("14_fqjr6") @@ -1875,6 +1875,8 @@ texture = ExtResource("44_onp74") [node name="Teleporter" parent="." unique_id=1779636661 instance=ExtResource("46_8k5n0")] position = Vector2(1676, 519) next_scene = "uid://bbjh0yoqbchuo" +enter_transition = 1 +exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=2026668028] shape = SubResource("CircleShape2D_24qmm") diff --git a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn index a8cd5e3b66..c1016188ab 100644 --- a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn +++ b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_1.tscn @@ -139,7 +139,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("9_l4apx")] position = Vector2(0, -25) next_scene = "uid://buvo0sgtr3qeg" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=1704183019] diff --git a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn index d99514bb7e..5887f99fcb 100644 --- a/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn +++ b/scenes/quests/story_quests/renya_beyond_sorrow/1_combat/renya_combat_round_2.tscn @@ -119,7 +119,7 @@ play_victory_fanfare_on_open = true [node name="Teleporter" parent="OnTheGround/LevelExit" unique_id=1779636661 instance=ExtResource("9_rqh7d")] position = Vector2(0, -25) next_scene = "uid://c2rc2y662wko0" -enter_transition = 4 +enter_transition = 5 exit_transition = 5 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/LevelExit/Teleporter" unique_id=272361307] diff --git a/scenes/ui_elements/cinematic/cinematic.gd b/scenes/ui_elements/cinematic/cinematic.gd index 977405692f..d82ea18864 100644 --- a/scenes/ui_elements/cinematic/cinematic.gd +++ b/scenes/ui_elements/cinematic/cinematic.gd @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: The Threadbare Authors # SPDX-License-Identifier: MPL-2.0 +@tool class_name Cinematic -extends Node2D +extends SceneLink ## Shows a dialogue, then transitions to another scene. ## ## Intended for use in non-interactive cutscenes, such as the intro and outro to a quest. @@ -17,19 +18,13 @@ signal cinematic_finished ## Optional animation player, to be used from [member dialogue] (if needed). @export var animation_player: AnimationPlayer -## Optional scene to switch to once [member dialogue] is complete. -@export_file("*.tscn") var next_scene: String - -## Optional path inside [member next_scene] where the player should appear. -## If blank, player appears at default position in the scene. If in doubt, -## leave this blank. -@export var spawn_point_path: String - ## Wether to automatically start the cinematic. @export var autostart: bool = true func _ready() -> void: + super._ready() + if autostart: start() @@ -41,13 +36,4 @@ func start() -> void: cinematic_finished.emit() GameState.intro_dialogue_shown = true - if next_scene: - ( - SceneSwitcher - . change_to_file_with_transition( - next_scene, - spawn_point_path, - Transition.Effect.FADE, - Transition.Effect.FADE, - ) - ) + switch() diff --git a/scenes/world_map/frays_end.tscn b/scenes/world_map/frays_end.tscn index 848879f714..5a72ccf82b 100644 --- a/scenes/world_map/frays_end.tscn +++ b/scenes/world_map/frays_end.tscn @@ -1101,6 +1101,8 @@ metadata/_custom_type_script = "uid://0enyu5v4ra34" position = Vector2(-63, 712) next_scene = "uid://c3pi5sjiy5tlg" spawn_point_path = NodePath("SpawnPoint") +enter_transition = 2 +exit_transition = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="OnTheGround/WestPath/Teleporter" unique_id=1827344313] shape = SubResource("RectangleShape2D_ulm71") diff --git a/scenes/world_map/frays_end_west.tscn b/scenes/world_map/frays_end_west.tscn index a00dc8cd83..e285d3f9fb 100644 --- a/scenes/world_map/frays_end_west.tscn +++ b/scenes/world_map/frays_end_west.tscn @@ -42,7 +42,7 @@ metadata/_edit_horizontal_guides_ = [772.0] position = Vector2(1349, 705) next_scene = "uid://cufkthb25mpxy" spawn_point_path = NodePath("OnTheGround/WestPath/SpawnPointWestPath") -enter_transition = 2 +enter_transition = 1 exit_transition = 1 [node name="CollisionShape2D" type="CollisionShape2D" parent="Teleporter" unique_id=1496141142] diff --git a/tools/replace_teleporter_nodes_with_scene_instances.gd b/tools/replace_teleporter_nodes_with_scene_instances.gd deleted file mode 100644 index 0de5054987..0000000000 --- a/tools/replace_teleporter_nodes_with_scene_instances.gd +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-FileCopyrightText: The Threadbare Authors -# SPDX-License-Identifier: MPL-2.0 -@tool -class_name ReplaceTeleporterNodesWithSceneInstances -extends EditorScript - -const Util = preload("./util.gd") -const TELEPORTER_GD_UID := "uid://hqdquinbimce" -const TELEPORTER_SCENE: PackedScene = preload( - "res://scenes/game_elements/props/teleporter/teleporter.tscn" -) - - -func _examine(packed_scene: PackedScene) -> void: - var scene_state := packed_scene.get_state() - var scene_root := packed_scene.instantiate(PackedScene.GenEditState.GEN_EDIT_STATE_INSTANCE) - - for node_idx: int in scene_state.get_node_count(): - var path := scene_state.get_node_path(node_idx) - - var found := false - for prop_idx: int in scene_state.get_node_property_count(node_idx): - var prop_name := scene_state.get_node_property_name(node_idx, prop_idx) - var prop_value: Variant = scene_state.get_node_property_value(node_idx, prop_idx) - if prop_name == "metadata/_custom_type_script" and prop_value == TELEPORTER_GD_UID: - found = true - break - elif prop_name == "script" and ResourceUID.path_to_uid((prop_value as Script).resource_path) == TELEPORTER_GD_UID: - found = true - break - - if not found: - continue - - var orig: Node = scene_root.get_node(path) - var replacement: Node = TELEPORTER_SCENE.instantiate( - PackedScene.GenEditState.GEN_EDIT_STATE_INSTANCE - ) - orig.replace_by(replacement) - - replacement.name = orig.name - replacement.scene_file_path = TELEPORTER_SCENE.resource_path - replacement.owner = scene_root - - for prop_idx: int in scene_state.get_node_property_count(node_idx): - var prop_name := scene_state.get_node_property_name(node_idx, prop_idx) - var prop_value: Variant = scene_state.get_node_property_value(node_idx, prop_idx) - - if prop_name not in ["metadata/_custom_type_script", "script"]: - replacement.set(prop_name, prop_value) - - orig.free() - - var result := packed_scene.pack(scene_root) - assert(result == OK, error_string(result)) - - result = ResourceSaver.save(packed_scene) - assert(result == OK, error_string(result)) - - -func _should_check(scene_path: String) -> bool: - if scene_path == TELEPORTER_SCENE.resource_path: - return false - - for dependency in ResourceLoader.get_dependencies(scene_path): - if dependency.contains("::"): - var uid := dependency.get_slice("::", 0) - if uid == TELEPORTER_GD_UID: - return true - - return false - - -func _run() -> void: - for scene: PackedScene in Util.find_scenes("res://", _should_check): - print(scene.resource_path) - _examine(scene) diff --git a/tools/replace_teleporter_nodes_with_scene_instances.gd.uid b/tools/replace_teleporter_nodes_with_scene_instances.gd.uid deleted file mode 100644 index 2aafa711c3..0000000000 --- a/tools/replace_teleporter_nodes_with_scene_instances.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://vgtxxaxclclg