fix: intro music now started

This commit is contained in:
tiger tiger tiger 2026-01-15 21:40:00 +01:00
parent dd0254afb3
commit 1b8d556929
7 changed files with 22 additions and 27 deletions

View File

@ -25,16 +25,8 @@ func start_room():
func _play_intro_scene() -> void: func _play_intro_scene() -> void:
# FIXME: Must instead use the actual interactable
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
# The intro scene is auto-played, not triggered by CollectableUi # The intro scene is auto-played, not triggered by CollectableUi
var intro: Interactable = $logic/CeilingInteractable var intro: Interactable = $logic/CeilingInteractable
# Play the story (StoryPlayable handles its own visibility via animations)
await intro.play_story() await intro.play_story()
Scenes.end_sequence(Scenes.id.YOUTH_DRAVEN) Scenes.end_sequence(Scenes.id.YOUTH_DRAVEN)
@ -91,14 +83,9 @@ func prepare_transition():
# Called by youth_room_scene_player when voice training scene starts # Called by youth_room_scene_player when voice training scene starts
func play_chest_reveal() -> void: func play_chest_reveal() -> void:
$AnimationPlayer.play("chest_reveal")
$visuals/SecondaryAnimation.play("chest_reveal") $visuals/SecondaryAnimation.play("chest_reveal")
await $visuals/SecondaryAnimation.animation_finished
func unload(): func unload():
$visuals.queue_free() $visuals.queue_free()
func play_chest_animation(_id):
$AnimationPlayer.play("intro")
await $AnimationPlayer.animation_finished

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=117 format=4 uid="uid://b3b0gyvklqn50"] [gd_scene load_steps=117 format=4 uid="uid://b3b0gyvklqn50"]
[ext_resource type="Script" path="res://base-environments/youth_room/youth_room.gd" id="1_aitp0"] [ext_resource type="Script" uid="uid://bsop46tqngddc" path="res://base-environments/youth_room/youth_room.gd" id="1_aitp0"]
[ext_resource type="AudioStream" uid="uid://1h6k2d8q1kw3" path="res://base-environments/youth_room/import/sounds/rain_on_window.mp3" id="2_3haaq"] [ext_resource type="AudioStream" uid="uid://1h6k2d8q1kw3" path="res://base-environments/youth_room/import/sounds/rain_on_window.mp3" id="2_3haaq"]
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="3_foj4y"] [ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="3_foj4y"]
[ext_resource type="AudioStream" uid="uid://bbpo1hu35yer8" path="res://base-environments/youth_room/import/sounds/thunder.mp3" id="3_wcypa"] [ext_resource type="AudioStream" uid="uid://bbpo1hu35yer8" path="res://base-environments/youth_room/import/sounds/thunder.mp3" id="3_wcypa"]
@ -19,7 +19,7 @@
[ext_resource type="PackedScene" uid="uid://g2a27jwdapai" path="res://logic-scenes/card_burner/card_burner.tscn" id="11_5bsh1"] [ext_resource type="PackedScene" uid="uid://g2a27jwdapai" path="res://logic-scenes/card_burner/card_burner.tscn" id="11_5bsh1"]
[ext_resource type="PackedScene" uid="uid://c3l8tm8ku50vt" path="res://base-environments/youth_room/scenes/childhood.tscn" id="12_viwxf"] [ext_resource type="PackedScene" uid="uid://c3l8tm8ku50vt" path="res://base-environments/youth_room/scenes/childhood.tscn" id="12_viwxf"]
[ext_resource type="PackedScene" uid="uid://23bshas7sk6h" path="res://base-environments/youth_room/scenes/jui_jutsu.tscn" id="12_x3dlb"] [ext_resource type="PackedScene" uid="uid://23bshas7sk6h" path="res://base-environments/youth_room/scenes/jui_jutsu.tscn" id="12_x3dlb"]
[ext_resource type="Script" path="res://base-environments/youth_room/youth_room_scene_player.gd" id="13_5bsh1"] [ext_resource type="Script" uid="uid://c3xbkwm4x3es7" path="res://base-environments/youth_room/youth_room_scene_player.gd" id="13_5bsh1"]
[ext_resource type="Texture2D" uid="uid://d005qvnbnishb" path="res://import/interface-elements/cursor_grab.png" id="13_lqj71"] [ext_resource type="Texture2D" uid="uid://d005qvnbnishb" path="res://import/interface-elements/cursor_grab.png" id="13_lqj71"]
[ext_resource type="PackedScene" uid="uid://cj1ccdk0686ke" path="res://base-environments/youth_room/scenes/voice_training.tscn" id="13_v3447"] [ext_resource type="PackedScene" uid="uid://cj1ccdk0686ke" path="res://base-environments/youth_room/scenes/voice_training.tscn" id="13_v3447"]
[ext_resource type="Material" uid="uid://cvm8e6vek3bne" path="res://base-environments/youth_room/import/materials/starlight_shader.material" id="17_ea6x8"] [ext_resource type="Material" uid="uid://cvm8e6vek3bne" path="res://base-environments/youth_room/import/materials/starlight_shader.material" id="17_ea6x8"]
@ -1883,9 +1883,12 @@ transform = Transform3D(0.78626597, 0, 0.6178859, 0, 1, 0, -0.6178859, 0, 0.7862
interaction = ExtResource("19_d3c7p") interaction = ExtResource("19_d3c7p")
[node name="ComicInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="ComicInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(0.9797145, 0, 0.20039362, 0, 1, 0, -0.20039362, 0, 0.9797145, 2.9196055, 0.2537475, -0.5924908) transform = Transform3D(0.9797145, 0, 0.20039362, 0, 1, 0, -0.20039362, 0, 0.9797145, 2.8945682, 0.2537475, -0.88938636)
interaction = ExtResource("13_v3447") interaction = ExtResource("13_v3447")
[node name="View" parent="logic/ComicInteractable" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.36574292, 0.099999994, 0.032779038)
[node name="ClothesInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="ClothesInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(0.7935111, 0, -0.60855323, 0, 1, 0, 0.60855323, 0, 0.7935111, 1.6713148, 1.089737, -0.92289597) transform = Transform3D(0.7935111, 0, -0.60855323, 0, 1, 0, 0.60855323, 0, 0.7935111, 1.6713148, 1.089737, -0.92289597)
interaction = ExtResource("12_x3dlb") interaction = ExtResource("12_x3dlb")
@ -2159,4 +2162,5 @@ data = ExtResource("40_ea6x8")
[connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending_button" method="hide"] [connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending_button" method="hide"]
[connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending" method="show"] [connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending" method="show"]
[editable path="logic/ComicInteractable"]
[editable path="logic/ClothesInteractable"] [editable path="logic/ClothesInteractable"]

View File

@ -13,7 +13,6 @@ func start_soundtrack():
$VoiceTraining.play(70) $VoiceTraining.play(70)
func _on_scene_starting(scene_id: Scenes.id, _repeat: bool) -> void: func _on_scene_starting(scene_id: Scenes.id, _repeat: bool) -> void:
print_debug("YouthRoomScenePlayer._on_scene_starting(%s)" % Scenes.id.keys()[scene_id])
# Handle scene-specific setup (music, chest animation, etc.) # Handle scene-specific setup (music, chest animation, etc.)
match scene_id: match scene_id:
@ -40,13 +39,10 @@ func _on_scene_finished(scene_id: Scenes.id, _repeat: bool) -> void:
func _play_chest_animation() -> void: func _play_chest_animation() -> void:
# Navigate up to youth_room to trigger chest reveal animation # Navigate up to youth_room to trigger chest reveal animation
var room = get_parent().get_parent() var room := State.room
if room and room.has_method("play_chest_reveal"): if room and room.has_method("play_chest_reveal"):
room.play_chest_reveal() room.play_chest_reveal()
func try_intro():
# Called from StoryPlayable for draven intro
play("intro")
func play(anim_name: StringName = "", a: float = -1, b: float = 1, c: bool = false) -> void: func play(anim_name: StringName = "", a: float = -1, b: float = 1, c: bool = false) -> void:
print_debug("YouthRoomScenePlayer.play(%s)" % anim_name) print_debug("YouthRoomScenePlayer.play(%s)" % anim_name)

View File

@ -3,6 +3,8 @@ class_name RoomTemplate extends Node3D
var initialised: bool = false var initialised: bool = false
var id: State.rooms = State.rooms.NULL var id: State.rooms = State.rooms.NULL
@onready var scene_player : AnimationPlayer = %ScenePlayer
var is_active: bool: var is_active: bool:
set(value): set(value):
is_active = value is_active = value

View File

@ -249,5 +249,7 @@ func pick_cards(id: Scenes.id, repeat: bool):
selection_state = CARDS selection_state = CARDS
if id == Scenes.id.YOUTH_DRAVEN and not repeat: if id == Scenes.id.YOUTH_DRAVEN and not repeat:
$Meaning.play() $Meaning.play()
State.room.scene_player.play("intro")
await cards_picked await cards_picked
hide() hide()

View File

@ -10,6 +10,8 @@ var interaction_ui : Control = null
@onready var caption : Label3D = %Caption @onready var caption : Label3D = %Caption
@onready var prompt : Label3D = %Prompt @onready var prompt : Label3D = %Prompt
@export var billboard : bool = true
var active : bool = true var active : bool = true
var shown : bool = false var shown : bool = false
var hover : bool = false var hover : bool = false
@ -63,9 +65,10 @@ func _process(_delta: float) -> void:
_process_hover() _process_hover()
func _process_billboard() -> void: func _process_billboard() -> void:
if shown: if billboard and shown:
var player_view := State.player_view var player_view := State.player_view
look_at(player_view.global_position, Vector3.UP, true) view.look_at(player_view.global_position, Vector3.UP, true)
frame.look_at(player_view.global_position, Vector3.UP, true)
func _process_hover() -> void: func _process_hover() -> void:
if active and hover and not shown: if active and hover and not shown:
@ -127,7 +130,7 @@ func collect_memento() -> void:
if interaction_ui is StoryPlayable: if interaction_ui is StoryPlayable:
play_story() play_story()
if interaction_ui is CardBoard: if interaction_ui is CardBoard:
play_board() play_board()

View File

@ -193,7 +193,8 @@ var scroll_target: float = 0:
var intro_triggered:= false var intro_triggered:= false
func trigger_intro(): func trigger_intro():
if not intro_triggered: # Don't trigger the intro animation if the scene was skipped
if not intro_triggered and not was_skipped:
intro.emit() intro.emit()
intro_triggered = true intro_triggered = true