feat: basic play, but stages not implemented

This commit is contained in:
tiger tiger tiger 2025-12-16 23:21:54 +01:00
parent bbcf9abfc0
commit fc09bbfae4
10 changed files with 174 additions and 184 deletions

View File

@ -136,6 +136,126 @@ tracks/5/keys = {
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_ytb2t"]
resource_name = "de"
length = 86.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%AnimationPlayer/Text")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("7_htg3l")
}],
"times": PackedFloat32Array(2.5)
}
tracks/0/use_blend = true
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..:progress")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.66667, 6.26666, 8.76667, 13.8, 16.0667, 20.7334, 21.6667, 26.1334, 27.4667, 29.5333, 30.0333, 33.4, 34.8999, 36.5941, 37.0333, 45.3001, 45.9667, 49.0666, 50.4333, 54.4, 55.2667, 57.8334, 59.2, 65.6694, 67.0333, 70.0333, 71.0333, 73.3667, 74.9333, 78.4667, 80.1667, 84.6333),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 1.23114, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.287175, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(14.4333, 34.2333, 49.4667, 66.3333, 74.0404, 85.0667),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("..:custom_minimum_size")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(900, 800), Vector2(900, 900)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".:rotation")
tracks/4/interp = 2
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 1.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.174533, 0.349066]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0, 0.733333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("../../..:visible")
tracks/6/interp = 0
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("../../..:modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_7qabw"]
resource_name = "en"
length = 92.0
@ -371,126 +491,6 @@ tracks/2/keys = {
"values": [0.349066, 0.698132]
}
[sub_resource type="Animation" id="Animation_ytb2t"]
resource_name = "de"
length = 86.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%AnimationPlayer/Text")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("7_htg3l")
}],
"times": PackedFloat32Array(2.5)
}
tracks/0/use_blend = true
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..:progress")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.66667, 6.26666, 8.76667, 13.8, 16.0667, 20.7334, 21.6667, 26.1334, 27.4667, 29.5333, 30.0333, 33.4, 34.8999, 36.5941, 37.0333, 45.3001, 45.9667, 49.0666, 50.4333, 54.4, 55.2667, 57.8334, 59.2, 65.6694, 67.0333, 70.0333, 71.0333, 73.3667, 74.9333, 78.4667, 80.1667, 84.6333),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 1.23114, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.287175, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(14.4333, 34.2333, 49.4667, 66.3333, 74.0404, 85.0667),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("..:custom_minimum_size")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(900, 800), Vector2(900, 900)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".:rotation")
tracks/4/interp = 2
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 1.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.174533, 0.349066]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0, 0.733333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("../../..:visible")
tracks/6/interp = 0
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("../../..:modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dc6th"]
_data = {
&"RESET": SubResource("Animation_ytihj"),
@ -509,8 +509,6 @@ offset_right = -424.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_40hhx")
story_array = PackedStringArray("Oh, my old mask. I have so many good memories about theatre club. ", "I would stand on my bed for entire afternoons, weeks on end, practicing my lines. Pretending to be on the big stage ... ", "my mom would get mad at me, when she had to call me three or four times for dinner. ", "I just … didn\'t like the interruptions. We both were often mad at each other.", "Dinner was difficult.", "I just couldn\'t bring myself to eat, because I couldn\'t deal with the bread and my mom.", "She was always so worried.", " Lisa, you forgot your homework, Lisa why won\'t you play with the other girls,\"", "\"Lisa why didn\'t Steffi invite you to her birthday, Lisa this, Lisa that.", "But I was fine! She just wouldn\'t listen.", "Yes, I didn\'t do homework, but my teachers didn\'t mind it as much with me ", "- which the other kids wouldn\'t shut up about. But like …", "they also made fun of me reading school books and talking to my teachers during breaks.", "But at least I could fucking talk to teachers and they had stuff to say.", "Mr Thomas probably even understood me better than my own mom.", "He said I was gifted. He said I just didn\'t need homework for good grades.", "And he also made sure to always include extra credits. So my silly slip-ups wouldn\'t get me a B.")
paragraph_lengths = PackedInt32Array(3, 4, 6, 9, 12, 13, 14, 16)
progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."]

View File

@ -65,6 +65,7 @@ var all_text_revealed: bool = false:
var substring_sizes: Array[int]
func _ready() -> void:
hide()
State.settings_changed.connect(func(): story_array = story_array)
skip_control = %SkipControl
if skip_control is SkipControl and not Engine.is_editor_hint():

View File

@ -1,17 +1,16 @@
class_name YouthRoom
extends RoomTemplate
signal ini_room
@onready var board_trigger: InteractiveSprite = %MindBoard
@onready var door_trigger: InteractiveSprite = %Door
@onready var card_board: CardBoard = %Board
@onready var card_picker: CardPicker = %Picker
@onready var ui: Control = %UI
func start_room():
%UI.show()
$logic/PlayerController.process_mode = Node.PROCESS_MODE_INHERIT
ini_room.emit()
if not Scenes.is_sequence_repeating(Scenes.id.YOUTH_DRAEVEN):
Scenes.start_sequence(Scenes.id.YOUTH_DRAEVEN)
State.queue_for_stage(%PlayerController)
@ -19,42 +18,58 @@ func start_room():
State.pass_stage_to(%PlayerController)
%LightAnimation.lights_on()
func get_ready():
save_game = State.save_game
save_game.current_room = State.rooms.YOUTH
Scenes.completed_sequences = save_game.mementos_complete
Scenes.started_sequences = save_game.mementos_complete
pull_save_state(State.save_game)
card_board.initialise_from_save(save_game)
ini_room.emit()
card_board.board_completed.connect(func():
save_game.is_childhood_board_complete = true
save_room())
%UI.hide()
Scenes.sign_up_for_sequence(play_chest_animation, Scenes.id.YOUTH_VOICE_TRAINING, 0)
ui.hide()
$sfx/distant_rain.play()
$"sfx/rain on window".play()
self.show()
func _ready():
super._ready()
id = State.rooms.YOUTH
Scenes.scene_finished.connect(_on_scene_finished)
card_picker.cards_picked.connect(card_board.populate_board)
func pull_save_state(save: SaveGame) -> void:
save.board_state = card_board.get_save_dict()
save.current_room = State.rooms.YOUTH
save.mementos_complete = Scenes.completed_sequences
save_game = save
save_game.current_room = id
save_game.board_state = card_board.get_save_dict()
card_board.initialise_from_save(save_game)
Scenes.started_sequences = save_game.mementos_complete
Scenes.completed_sequences = save_game.mementos_complete
func _on_scene_finished(_id: int, _repeat:bool):
await get_tree().create_timer(3).timeout
save_room()
func prepare_transition():
save_room()
$AnimationPlayer.play("conserve_performance")
await $AnimationPlayer.animation_finished
$visuals/AnimationPlayer.play("conserve_performance")
await $visuals/AnimationPlayer.animation_finished
unload()
func play_chest_animation(_id):
$AnimationPlayer.play("chest_reveal")
$SecondaryAnimation.play("chest_reveal")
await $AnimationPlayer.animation_finished
Scenes.continue_sequence(self)
func unload():
$visuals.queue_free()

View File

@ -903,14 +903,14 @@ var is_repeating = false
func _ready() -> void:
Scenes.scene_finished.connect(scene_finished)
# FIXME: this needs to be made prettier.
$draven.finished.connect(on_draeven_done)
$childhood.finished.connect(on_childhood_done)
$JuiJutsu.finished.connect(on_jui_jutsu_done)
$voice_training.finished.connect(on_voice_training_done)
$draven.intro.connect(try_intro)
Scenes.sign_up_for_sequence(play_scene, Scenes.id.YOUTH_DRAEVEN, 1)
Scenes.sign_up_for_sequence(play_scene, Scenes.id.YOUTH_CHILDHOOD, 0)
Scenes.sign_up_for_sequence(play_scene, Scenes.id.YOUTH_VOICE_TRAINING, 1)
@ -939,23 +939,21 @@ func play_scene(id: int, repeat = false):
play(\"draeven\")
$draven.play_scene()
func _on_ini_room():
pass
func on_childhood_done():
Scenes.continue_sequence(self)
$childhood.hide()
func on_voice_training_done():
Scenes.continue_sequence(self)
$\"voice_training\".hide()
func on_jui_jutsu_done():
Scenes.continue_sequence(self)
$JuiJutsu.hide()
if $JuiJutsu.was_skipped:
play(\"intro\")
func on_draeven_done():
Scenes.continue_sequence(self)
await $draven.finished
@ -2038,8 +2036,6 @@ volume_db = -80.0
bus = &"music"
[node name="childhood" parent="logic/ScenePlayer" instance=ExtResource("12_viwxf")]
story_array = []
paragraph_lengths = [1]
[node name="VoiceTraining" type="AudioStreamPlayer" parent="logic/ScenePlayer"]
stream = ExtResource("10_wwwdq")
@ -2574,7 +2570,7 @@ spot_angle = 137.58
spot_angle_attenuation = 1.6358016
script = SubResource("GDScript_yn0pl")
[node name="youth_room" parent="visuals" instance=ExtResource("30_dqyng")]
[node name="visuals" parent="visuals" instance=ExtResource("30_dqyng")]
[node name="WorldEnvironment" type="WorldEnvironment" parent="." groups=["scene_actors"]]
environment = SubResource("Environment_pllnm")
@ -2658,9 +2654,6 @@ directional = true
interior = true
light_data = ExtResource("41_bgk6f")
[connection signal="ini_room" from="." to="logic/PlayerController" method="_on_ini_room"]
[connection signal="ini_room" from="." to="logic/ScenePlayer" method="_on_ini_room"]
[connection signal="ini_room" from="." to="visuals/lights/LightAnimation" method="_on_ini_room"]
[connection signal="ui_entered" from="logic/PlayerController" to="SceneUI" method="show"]
[connection signal="ui_exited" from="logic/PlayerController" to="SceneUI" method="hide"]
[connection signal="body_entered" from="logic/Bed and Ladders/ladder_trigger" to="logic/PlayerController" method="_on_bed_enter"]

View File

@ -1,27 +1,8 @@
[gd_scene load_steps=12 format=3 uid="uid://bw47g00bi710i"]
[gd_scene load_steps=11 format=3 uid="uid://bw47g00bi710i"]
[ext_resource type="PackedScene" uid="uid://c0i4ydmxtxfho" path="res://base-environments/youth_room/import/youth_room.glb" id="1_w4p0y"]
[ext_resource type="Texture2D" uid="uid://dp1bv446sk2xf" path="res://addons/kenney_particle_pack/flare_01.png" id="2_ipdak"]
[sub_resource type="GDScript" id="GDScript_w4p0y"]
script/source = "
extends Node3D
var has_stage
#@export_tool_button(\"Play Chest Animation\") var play_action = play_chest_animation
func _ready() -> void:
if not Engine.is_editor_hint():
Scenes.sign_up_for_sequence(play_chest_animation, Scenes.id.YOUTH_VOICE_TRAINING, 0)
func play_chest_animation(_id):
$AnimationPlayer.play(\"chest_reveal\")
$SecondaryAnimation.play(\"chest_reveal\")
await $AnimationPlayer.animation_finished
Scenes.continue_sequence(self)
"
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ipdak"]
albedo_color = Color(0.72420764, 0.5294575, 0.20879507, 1)
metallic = 0.5
@ -338,7 +319,6 @@ _data = {
}
[node name="youth_room" instance=ExtResource("1_w4p0y")]
script = SubResource("GDScript_w4p0y")
[node name="magazine_01_cover89_003" parent="room" index="10"]
transform = Transform3D(0.025604796, 0.9998218, 0.014154732, -0.027297392, -0.013988163, 0.99981344, 2.049016, -0.012680292, 0.01314283, 3.0323079, 0.18476419, -1.0096122)

View File

@ -204,7 +204,7 @@ func is_in_dropzone(to_check: Node) -> bool:
return dropzone.get_rect().has_point(to_check.global_position)
# Called by notes when a mouse event needs handling
func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_active_node):
func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_active_node) -> void:
# Makes sure that only the same area is dragged.
# Otherwise overlapping areas are dragged at the same time.
@ -292,7 +292,7 @@ func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_act
to_handle.reset_drag()
func _return_sticky_notes_to_panels():
func _return_sticky_notes_to_panels() -> void:
if not (current_context == ASSIGN and focus_stickies): return #FIXME this is an early return to prevent race conditions. Check if it is save to be removed.
for panel:StickyNotePanel in sticky_note_container.get_children():
panel.reclaim_sticky_note()
@ -312,7 +312,7 @@ func check_board_comnpletion():
if board_was_completed:
give_lore_feedback()
func is_board_complete():
func is_board_complete() -> bool:
if mementos_collected == 4:
for card in dropzone.get_children():
if card is Card:
@ -368,7 +368,7 @@ func is_board_lore() -> bool:
return true
# Mark area that was hovered over as currently selected
func handle_hover(to_handle: Area2D):
func handle_hover(to_handle: Area2D) -> void:
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT): return
currently_active_node = to_handle
@ -403,7 +403,7 @@ func insert_area(parent: Control, node: Area2D):
node.is_dragable = true
# Takes the inputs for control inputs
func _input(event):
func _input(event) -> void:
if not has_stage or not is_instance_valid(currently_active_node): return
@ -565,7 +565,7 @@ func _select_card_for_assigning(sticky_note: Area2D, card: Area2D):
sticky_note.tween_transform_to(card.get_child(3).global_position)
func on_scene_skipped(i: int):
mementos_collected += i
mementos_collected += i # FIXME: sometimes -1 is passed here, why?
func claim_focus():
State.pass_stage_to(self)
@ -619,12 +619,12 @@ func get_save_dict() -> Dictionary:
}
func initialise_from_save(savegame: SaveGame):
func initialise_from_save(savegame: SaveGame) -> void:
last_save_dict = savegame.board_state.duplicate()
if savegame.board_state == {}: return
rebuild_from_savedict(savegame.board_state)
func rebuild_from_savedict(board_state:Dictionary):
func rebuild_from_savedict(board_state:Dictionary) -> void:
var cards: Dictionary
if board_state["cards"] != {} :
cards = board_state["cards"]

View File

@ -138,7 +138,7 @@ func _input(event):
#if event.is_action_pressed("ui_end"):
# fill_card_slots(3)
# selection_state = CARDS
if event is not InputEventAction:
return

View File

@ -36,8 +36,8 @@ gdscript/warnings/native_method_override=0
[display]
window/size/viewport_width=1600
window/size/viewport_height=900
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
display_server/driver.linuxbsd="wayland"

View File

@ -1,4 +1,5 @@
extends Node
class_name SceneReference
var sequence_actors:Array[Array] = []
var started_sequences: int = 0

View File

@ -52,7 +52,8 @@ func _new_game() -> void:
func _start_game() -> void:
print_debug("main_menu.gd: _start_game()")
_next_room.emit(State.save_game.current_room_path)
hide()
State.room.start_room()
func _load_save_game() -> void:
@ -62,7 +63,8 @@ func _load_save_game() -> void:
if (save != null):
State.save_game = save
await Main.load_game(save)
_activate()
_start_game()
#_activate()
func _choose(choice: String) -> void: