From a7f5ea6fd51d9dbee8d824c661cfe8c0915a5f8c Mon Sep 17 00:00:00 2001 From: alex-kumpula Date: Sat, 11 Nov 2023 15:08:59 -0700 Subject: [PATCH 1/4] Added TAS UI --- godot/UI/TAS UI/CurrentFrameLabel.cs | 24 +++++++++++++++++++ godot/UI/TAS UI/TAS UI.tscn | 30 ++++++++++++++++++++++++ godot/tests/TAS_system/TAS_test_002.tscn | 5 +++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 godot/UI/TAS UI/CurrentFrameLabel.cs create mode 100644 godot/UI/TAS UI/TAS UI.tscn diff --git a/godot/UI/TAS UI/CurrentFrameLabel.cs b/godot/UI/TAS UI/CurrentFrameLabel.cs new file mode 100644 index 0000000..c65afc9 --- /dev/null +++ b/godot/UI/TAS UI/CurrentFrameLabel.cs @@ -0,0 +1,24 @@ +using Godot; +using System; + +public partial class CurrentFrameLabel : Label +{ + TAS_System TAS; + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS = GetNode("/root/TAS_System"); + TAS.FrameIncremented += OnFrameIncremented; + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + + } + + public virtual void OnFrameIncremented(int newFrame) + { + this.Text = $"Current frame: {newFrame}"; + } +} diff --git a/godot/UI/TAS UI/TAS UI.tscn b/godot/UI/TAS UI/TAS UI.tscn new file mode 100644 index 0000000..4443560 --- /dev/null +++ b/godot/UI/TAS UI/TAS UI.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=2 format=3 uid="uid://b1uf31ed6h0ir"] + +[ext_resource type="Script" path="res://UI/TAS UI/CurrentFrameLabel.cs" id="1_27u4w"] + +[node name="TAS UI" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="DEBUG" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="DEBUG"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -26.0 +offset_right = 199.0 +grow_vertical = 0 +text = "Current Frame: 0" +script = ExtResource("1_27u4w") diff --git a/godot/tests/TAS_system/TAS_test_002.tscn b/godot/tests/TAS_system/TAS_test_002.tscn index 3bea4db..7180003 100644 --- a/godot/tests/TAS_system/TAS_test_002.tscn +++ b/godot/tests/TAS_system/TAS_test_002.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=7 format=3 uid="uid://by3rnp88l4plx"] +[gd_scene load_steps=8 format=3 uid="uid://by3rnp88l4plx"] [ext_resource type="PackedScene" uid="uid://bua7f25rpewkp" path="res://small_room.glb" id="1_bo0jp"] [ext_resource type="PackedScene" uid="uid://cbp8c4kpmr0hk" path="res://control_scheme/is_targetable.tscn" id="2_d7v5s"] [ext_resource type="PackedScene" uid="uid://drmb4sitb74fx" path="res://control_scheme/controller.tscn" id="3_0hshv"] [ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="3_srlbt"] [ext_resource type="Script" path="res://tests/TAS_system/TAS_test_001.cs" id="5_0ber1"] +[ext_resource type="PackedScene" uid="uid://b1uf31ed6h0ir" path="res://UI/TAS UI/TAS UI.tscn" id="6_au5mx"] [sub_resource type="Environment" id="Environment_f0m14"] ambient_light_source = 2 @@ -34,3 +35,5 @@ initial_target = NodePath("../grape") [node name="TAS_test_001" type="Node" parent="." index="6"] script = ExtResource("5_0ber1") + +[node name="TAS UI" parent="." index="7" instance=ExtResource("6_au5mx")] From 27a98286efe9c74fba4598634f7e301bf639644f Mon Sep 17 00:00:00 2001 From: alex-kumpula Date: Sat, 11 Nov 2023 15:47:37 -0700 Subject: [PATCH 2/4] UI is working --- godot/TAS_system/TAS_System.cs | 1 + godot/UI/TAS UI/AdvanceButton.cs | 17 +++++ godot/UI/TAS UI/CurrentFrameLabel.cs | 4 +- godot/UI/TAS UI/RegressButton.cs | 17 +++++ godot/UI/TAS UI/ResetFramesButton.cs | 18 ++++++ godot/UI/TAS UI/StartIncrementButton.cs | 17 +++++ godot/UI/TAS UI/StopIncrementButton.cs | 17 +++++ godot/UI/TAS UI/TAS UI.tscn | 85 ++++++++++++++++++++++++- 8 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 godot/UI/TAS UI/AdvanceButton.cs create mode 100644 godot/UI/TAS UI/RegressButton.cs create mode 100644 godot/UI/TAS UI/ResetFramesButton.cs create mode 100644 godot/UI/TAS UI/StartIncrementButton.cs create mode 100644 godot/UI/TAS UI/StopIncrementButton.cs diff --git a/godot/TAS_system/TAS_System.cs b/godot/TAS_system/TAS_System.cs index dee5c1b..ba5a5b8 100644 --- a/godot/TAS_system/TAS_System.cs +++ b/godot/TAS_system/TAS_System.cs @@ -112,6 +112,7 @@ public partial class TAS_System : Node if (this.TimeSinceLastFrame >= this.FrameLength) { this.CurrentFrame++; + this.LastAdvancedFrame = this.CurrentFrame; EmitSignal(SignalName.FrameIncremented, this.CurrentFrame); this.TimeSinceLastFrame = 0 + (this.TimeSinceLastFrame - this.FrameLength); } diff --git a/godot/UI/TAS UI/AdvanceButton.cs b/godot/UI/TAS UI/AdvanceButton.cs new file mode 100644 index 0000000..2f688b9 --- /dev/null +++ b/godot/UI/TAS UI/AdvanceButton.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class AdvanceButton : Button +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS_System TAS = GetNode("/root/TAS_System"); + this.Pressed += () => { TAS.Advance(1); }; + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } +} diff --git a/godot/UI/TAS UI/CurrentFrameLabel.cs b/godot/UI/TAS UI/CurrentFrameLabel.cs index c65afc9..f431dd9 100644 --- a/godot/UI/TAS UI/CurrentFrameLabel.cs +++ b/godot/UI/TAS UI/CurrentFrameLabel.cs @@ -8,13 +8,13 @@ public partial class CurrentFrameLabel : Label public override void _Ready() { TAS = GetNode("/root/TAS_System"); - TAS.FrameIncremented += OnFrameIncremented; + // TAS.FrameIncremented += OnFrameIncremented; } // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { - + this.Text = $"Current frame: {TAS.CurrentFrame}"; } public virtual void OnFrameIncremented(int newFrame) diff --git a/godot/UI/TAS UI/RegressButton.cs b/godot/UI/TAS UI/RegressButton.cs new file mode 100644 index 0000000..699c63e --- /dev/null +++ b/godot/UI/TAS UI/RegressButton.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class RegressButton : Button +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS_System TAS = GetNode("/root/TAS_System"); + this.Pressed += () => { TAS.Regress(1); }; + } + + public virtual void OnFrameIncremented(int newFrame) + { + this.Text = $"Current frame: {newFrame}"; + } +} diff --git a/godot/UI/TAS UI/ResetFramesButton.cs b/godot/UI/TAS UI/ResetFramesButton.cs new file mode 100644 index 0000000..d7e5586 --- /dev/null +++ b/godot/UI/TAS UI/ResetFramesButton.cs @@ -0,0 +1,18 @@ +using Godot; +using System; + +public partial class ResetFramesButton : Button +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS_System TAS = GetNode("/root/TAS_System"); + this.Pressed += () => { TAS.ResetFrameCount(); }; + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + + } +} diff --git a/godot/UI/TAS UI/StartIncrementButton.cs b/godot/UI/TAS UI/StartIncrementButton.cs new file mode 100644 index 0000000..c07eb65 --- /dev/null +++ b/godot/UI/TAS UI/StartIncrementButton.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class StartIncrementButton : Button +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS_System TAS = GetNode("/root/TAS_System"); + this.Pressed += () => { TAS.StartIncrementingFrames(); }; + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } +} diff --git a/godot/UI/TAS UI/StopIncrementButton.cs b/godot/UI/TAS UI/StopIncrementButton.cs new file mode 100644 index 0000000..81f19d0 --- /dev/null +++ b/godot/UI/TAS UI/StopIncrementButton.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class StopIncrementButton : Button +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + TAS_System TAS = GetNode("/root/TAS_System"); + this.Pressed += () => { TAS.StopIncrementingFrames(); }; + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } +} diff --git a/godot/UI/TAS UI/TAS UI.tscn b/godot/UI/TAS UI/TAS UI.tscn index 4443560..decba99 100644 --- a/godot/UI/TAS UI/TAS UI.tscn +++ b/godot/UI/TAS UI/TAS UI.tscn @@ -1,6 +1,11 @@ -[gd_scene load_steps=2 format=3 uid="uid://b1uf31ed6h0ir"] +[gd_scene load_steps=7 format=3 uid="uid://b1uf31ed6h0ir"] [ext_resource type="Script" path="res://UI/TAS UI/CurrentFrameLabel.cs" id="1_27u4w"] +[ext_resource type="Script" path="res://UI/TAS UI/RegressButton.cs" id="2_fhmsa"] +[ext_resource type="Script" path="res://UI/TAS UI/AdvanceButton.cs" id="3_0ti6q"] +[ext_resource type="Script" path="res://UI/TAS UI/StopIncrementButton.cs" id="4_4gd4c"] +[ext_resource type="Script" path="res://UI/TAS UI/StartIncrementButton.cs" id="5_5af83"] +[ext_resource type="Script" path="res://UI/TAS UI/ResetFramesButton.cs" id="6_nwwkv"] [node name="TAS UI" type="Control"] layout_mode = 3 @@ -28,3 +33,81 @@ offset_right = 199.0 grow_vertical = 0 text = "Current Frame: 0" script = ExtResource("1_27u4w") + +[node name="FrameButtons" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -131.5 +offset_top = -52.0 +offset_right = 131.5 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="RegressButton" type="Button" parent="FrameButtons"] +layout_mode = 1 +anchors_preset = -1 +anchor_right = 0.5 +anchor_bottom = 1.0 +grow_vertical = 2 +text = "Regress" +script = ExtResource("2_fhmsa") + +[node name="AdvanceButton" type="Button" parent="FrameButtons"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_vertical = 2 +text = "Advance" +script = ExtResource("3_0ti6q") + +[node name="TASButtons" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -205.0 +offset_top = -103.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="StopIncrementButton" type="Button" parent="TASButtons"] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 31.0 +grow_horizontal = 2 +text = "Stop Increment" +script = ExtResource("4_4gd4c") + +[node name="StartIncrementButton" type="Button" parent="TASButtons"] +layout_mode = 1 +anchors_preset = 14 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +offset_top = -15.5 +offset_bottom = 15.5 +grow_horizontal = 2 +grow_vertical = 2 +text = "Start Increment" +script = ExtResource("5_5af83") + +[node name="ResetFramesButton" type="Button" parent="TASButtons"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -31.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "Reset Frames" +script = ExtResource("6_nwwkv") From 84aa101636e8245fab8bc6ced28b3e7dd34552ed Mon Sep 17 00:00:00 2001 From: alex-kumpula Date: Sat, 11 Nov 2023 16:08:10 -0700 Subject: [PATCH 3/4] Made the Advance Button disable when it should --- godot/TAS_system/TAS_System.cs | 5 +++++ godot/UI/TAS UI/AdvanceButton.cs | 12 +++++++++++- godot/UI/TAS UI/TAS UI.tscn | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/godot/TAS_system/TAS_System.cs b/godot/TAS_system/TAS_System.cs index ba5a5b8..b72b8f3 100644 --- a/godot/TAS_system/TAS_System.cs +++ b/godot/TAS_system/TAS_System.cs @@ -33,6 +33,11 @@ public partial class TAS_System : Node private set { this._currentFrame = value; } } + public int AdvancedFramesRemaining + { + get { return this.LastAdvancedFrame - this.CurrentFrame; } + } + /// /// The last frame that can be advanced to. This will /// only be greater than CurrentFrame after the player diff --git a/godot/UI/TAS UI/AdvanceButton.cs b/godot/UI/TAS UI/AdvanceButton.cs index 2f688b9..54918d0 100644 --- a/godot/UI/TAS UI/AdvanceButton.cs +++ b/godot/UI/TAS UI/AdvanceButton.cs @@ -3,15 +3,25 @@ using System; public partial class AdvanceButton : Button { + TAS_System TAS; // Called when the node enters the scene tree for the first time. public override void _Ready() { - TAS_System TAS = GetNode("/root/TAS_System"); + TAS = GetNode("/root/TAS_System"); this.Pressed += () => { TAS.Advance(1); }; + } // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { + if (TAS.AdvancedFramesRemaining == 0) + { + this.Disabled = true; + } + else + { + this.Disabled = false; + } } } diff --git a/godot/UI/TAS UI/TAS UI.tscn b/godot/UI/TAS UI/TAS UI.tscn index decba99..4725fe8 100644 --- a/godot/UI/TAS UI/TAS UI.tscn +++ b/godot/UI/TAS UI/TAS UI.tscn @@ -63,6 +63,7 @@ anchor_left = 0.5 anchor_right = 1.0 anchor_bottom = 1.0 grow_vertical = 2 +disabled = true text = "Advance" script = ExtResource("3_0ti6q") From 5f6e7a3e8ec68af5b790bf226e62cd0257f36290 Mon Sep 17 00:00:00 2001 From: alex-kumpula Date: Sat, 11 Nov 2023 17:23:00 -0700 Subject: [PATCH 4/4] Added regression and advancement to TASable --- godot/Hurrmmm.csproj | 2 +- godot/Hurrmmm.csproj.old | 6 +++ godot/TAS_system/TAS_System.cs | 27 ++++++++++---- godot/TAS_system/TASable.cs | 47 +++++++++++++++++++++--- godot/UI/TAS UI/RegressButton.cs | 17 ++++++++- godot/UI/TAS UI/TAS UI.tscn | 2 + godot/mouse_control.gd | 2 +- godot/tests/TAS_system/TAS_test_002.tscn | 22 ++++------- godot/tests/TAS_system/TAS_test_003.tscn | 43 ++++++++++++++++++++++ 9 files changed, 139 insertions(+), 29 deletions(-) create mode 100644 godot/Hurrmmm.csproj.old create mode 100644 godot/tests/TAS_system/TAS_test_003.tscn diff --git a/godot/Hurrmmm.csproj b/godot/Hurrmmm.csproj index e25452c..8ee8c44 100644 --- a/godot/Hurrmmm.csproj +++ b/godot/Hurrmmm.csproj @@ -1,4 +1,4 @@ - + net6.0 true diff --git a/godot/Hurrmmm.csproj.old b/godot/Hurrmmm.csproj.old new file mode 100644 index 0000000..e25452c --- /dev/null +++ b/godot/Hurrmmm.csproj.old @@ -0,0 +1,6 @@ + + + net6.0 + true + + \ No newline at end of file diff --git a/godot/TAS_system/TAS_System.cs b/godot/TAS_system/TAS_System.cs index b72b8f3..574fdb4 100644 --- a/godot/TAS_system/TAS_System.cs +++ b/godot/TAS_system/TAS_System.cs @@ -64,21 +64,33 @@ public partial class TAS_System : Node [Signal] public delegate void FramesRegressedEventHandler(int startFrame, int endFrame); + [Signal] + public delegate void StartedIncrementingEventHandler(); + + [Signal] + public delegate void StoppedIncrementingEventHandler(); + + [Signal] + public delegate void FramesResetEventHandler(); + public void StartIncrementingFrames() { this.IsIncrementingFrames = true; + EmitSignal(SignalName.StartedIncrementing); } public void StopIncrementingFrames() { this.IsIncrementingFrames = false; + EmitSignal(SignalName.StoppedIncrementing); } public void ResetFrameCount() { this.CurrentFrame = 0; this.LastAdvancedFrame = 0; + EmitSignal(SignalName.FramesReset); } // Returns how many frames it could successfully advance @@ -122,14 +134,15 @@ public partial class TAS_System : Node this.TimeSinceLastFrame = 0 + (this.TimeSinceLastFrame - this.FrameLength); } } - - // GD.Print(CurrentFrame); } - // public void Test() - // { - // GD.Print("test123"); - // // EmitSignal(SignalName.TestSignal, "test456"); - // } + + + public override void _Ready() + { + this.FrameLength = 0.1; + this.StartIncrementingFrames(); + + } } diff --git a/godot/TAS_system/TASable.cs b/godot/TAS_system/TASable.cs index c3a5716..e22da6d 100644 --- a/godot/TAS_system/TASable.cs +++ b/godot/TAS_system/TASable.cs @@ -1,33 +1,70 @@ using Godot; using System; +using System.Collections.Generic; using System.Globalization; public partial class TASable : Node { - Node3D _parent; + [Export] RigidBody3D _assignedRigidBody3D; + + public RigidBody3D AssignedRigidBody3D + { + get { return this._assignedRigidBody3D; } + } + + + public Dictionary framePositions = new Dictionary(); + + + public virtual void SaveState(int frame) + { + this.framePositions[frame] = this.AssignedRigidBody3D.Position; + } + + public virtual void LoadState(int frame) + { + this.AssignedRigidBody3D.Position = this.framePositions[frame]; + } + public override void _Ready() { - this._parent = this.GetParent(); TAS_System TAS = GetNode("/root/TAS_System"); TAS.FrameIncremented += this.OnFrameIncremented; TAS.FramesAdvanced += this.OnFramesAdvanced; TAS.FramesRegressed += this.OnFramesRegressed; + TAS.StartedIncrementing += this.OnStartedIncrementing; + TAS.StoppedIncrementing += this.OnStoppedIncrementing; + + this.SaveState(0); } public virtual void OnFrameIncremented(int newFrame) { - GD.Print($"Frame advanced to {newFrame}, called from node {_parent.Name}"); + this.SaveState(newFrame); + GD.Print($"Frame advanced to {newFrame}, called from node {this.AssignedRigidBody3D.Name}"); } public virtual void OnFramesAdvanced(int startFrame, int endFrame) { - GD.Print($"Frames advanced from {startFrame} to {endFrame}, called from node {_parent.Name}"); + this.LoadState(endFrame); + GD.Print($"Frames advanced from {startFrame} to {endFrame}, called from node {this.AssignedRigidBody3D.Name}"); } public virtual void OnFramesRegressed(int startFrame, int endFrame) { - GD.Print($"Frames regressed from {startFrame} to {endFrame}, called from node {_parent.Name}"); + this.LoadState(endFrame); + GD.Print($"Frames regressed from {startFrame} to {endFrame}, called from node {this.AssignedRigidBody3D.Name}"); + } + + public virtual void OnStartedIncrementing() + { + this.AssignedRigidBody3D.Freeze = false; + } + + public virtual void OnStoppedIncrementing() + { + this.AssignedRigidBody3D.Freeze = true; } } diff --git a/godot/UI/TAS UI/RegressButton.cs b/godot/UI/TAS UI/RegressButton.cs index 699c63e..e78f966 100644 --- a/godot/UI/TAS UI/RegressButton.cs +++ b/godot/UI/TAS UI/RegressButton.cs @@ -3,10 +3,12 @@ using System; public partial class RegressButton : Button { + TAS_System TAS; + // Called when the node enters the scene tree for the first time. public override void _Ready() { - TAS_System TAS = GetNode("/root/TAS_System"); + TAS = GetNode("/root/TAS_System"); this.Pressed += () => { TAS.Regress(1); }; } @@ -14,4 +16,17 @@ public partial class RegressButton : Button { this.Text = $"Current frame: {newFrame}"; } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + if (TAS.CurrentFrame == 0) + { + this.Disabled = true; + } + else + { + this.Disabled = false; + } + } } diff --git a/godot/UI/TAS UI/TAS UI.tscn b/godot/UI/TAS UI/TAS UI.tscn index 4725fe8..afbe79f 100644 --- a/godot/UI/TAS UI/TAS UI.tscn +++ b/godot/UI/TAS UI/TAS UI.tscn @@ -14,6 +14,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 [node name="DEBUG" type="Control" parent="."] layout_mode = 1 @@ -22,6 +23,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 [node name="Label" type="Label" parent="DEBUG"] layout_mode = 1 diff --git a/godot/mouse_control.gd b/godot/mouse_control.gd index c4a34f7..80b7640 100644 --- a/godot/mouse_control.gd +++ b/godot/mouse_control.gd @@ -15,7 +15,7 @@ func toggle_mouse_lock(): func mouse_is_locked(): return Input.mouse_mode == Input.MOUSE_MODE_CAPTURED -func _input(event): +func _unhandled_input(event): if event.is_action("charge") and Input.mouse_mode != Input.MOUSE_MODE_CAPTURED: lock_mouse() get_viewport().set_input_as_handled() diff --git a/godot/tests/TAS_system/TAS_test_002.tscn b/godot/tests/TAS_system/TAS_test_002.tscn index 7180003..8e1ed4d 100644 --- a/godot/tests/TAS_system/TAS_test_002.tscn +++ b/godot/tests/TAS_system/TAS_test_002.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=8 format=3 uid="uid://by3rnp88l4plx"] +[gd_scene load_steps=7 format=3 uid="uid://by3rnp88l4plx"] [ext_resource type="PackedScene" uid="uid://bua7f25rpewkp" path="res://small_room.glb" id="1_bo0jp"] -[ext_resource type="PackedScene" uid="uid://cbp8c4kpmr0hk" path="res://control_scheme/is_targetable.tscn" id="2_d7v5s"] [ext_resource type="PackedScene" uid="uid://drmb4sitb74fx" path="res://control_scheme/controller.tscn" id="3_0hshv"] [ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="3_srlbt"] [ext_resource type="Script" path="res://tests/TAS_system/TAS_test_001.cs" id="5_0ber1"] @@ -14,26 +13,21 @@ ambient_light_energy = 0.5 [node name="small_room" instance=ExtResource("1_bo0jp")] -[node name="is_TASable" parent="table" index="0" instance=ExtResource("3_srlbt")] - -[node name="is_targetable" parent="grape" index="0" node_paths=PackedStringArray("attached_to") instance=ExtResource("2_d7v5s")] -attached_to = NodePath("..") - -[node name="is_TASable" parent="grape" index="1" instance=ExtResource("3_srlbt")] - -[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="3"] +[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="1"] environment = SubResource("Environment_f0m14") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment" index="0"] transform = Transform3D(1, 0, 0, 0, 0.933762, 0.357895, 0, -0.357895, 0.933762, 0, 1.43864, 1.81738) -[node name="controller" parent="." index="4" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("3_0hshv")] +[node name="controller" parent="." index="2" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("3_0hshv")] camera = NodePath("Camera3D") -initial_target = NodePath("../grape") +initial_target = NodePath("../table") [node name="Camera3D" type="Camera3D" parent="controller" index="1"] -[node name="TAS_test_001" type="Node" parent="." index="6"] +[node name="is_TASable" parent="table" index="0" instance=ExtResource("3_srlbt")] + +[node name="TAS_test_001" type="Node" parent="." index="4"] script = ExtResource("5_0ber1") -[node name="TAS UI" parent="." index="7" instance=ExtResource("6_au5mx")] +[node name="TAS UI" parent="." index="5" instance=ExtResource("6_au5mx")] diff --git a/godot/tests/TAS_system/TAS_test_003.tscn b/godot/tests/TAS_system/TAS_test_003.tscn new file mode 100644 index 0000000..2c2eb36 --- /dev/null +++ b/godot/tests/TAS_system/TAS_test_003.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=7 format=3 uid="uid://1wrwvnt1xuwr"] + +[ext_resource type="PackedScene" uid="uid://bua7f25rpewkp" path="res://small_room.glb" id="1_m1abe"] +[ext_resource type="PackedScene" uid="uid://drmb4sitb74fx" path="res://control_scheme/controller.tscn" id="2_1yuny"] +[ext_resource type="PackedScene" uid="uid://c43pr474qofhl" path="res://physics/grape.tscn" id="3_kg8e8"] +[ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="4_4hrbu"] +[ext_resource type="PackedScene" uid="uid://b1uf31ed6h0ir" path="res://UI/TAS UI/TAS UI.tscn" id="4_jskxr"] + +[sub_resource type="Environment" id="Environment_f0m14"] +ambient_light_source = 2 +ambient_light_color = Color(1, 1, 1, 1) +ambient_light_energy = 0.5 + +[node name="small_room" instance=ExtResource("1_m1abe")] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="2"] +environment = SubResource("Environment_f0m14") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment" index="0"] +transform = Transform3D(1, 0, 0, 0, 0.933762, 0.357895, 0, -0.357895, 0.933762, 0, 1.43864, 1.81738) + +[node name="controller" parent="." index="3" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("2_1yuny")] +camera = NodePath("Camera3D") +initial_target = NodePath("../grape") + +[node name="Camera3D" type="Camera3D" parent="controller" index="1"] + +[node name="billiard" parent="." index="4" instance=ExtResource("3_kg8e8")] + +[node name="grape" parent="." index="5" instance=ExtResource("3_kg8e8")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.98064, 0.385236) + +[node name="is_TASable" parent="grape" index="3" node_paths=PackedStringArray("_assignedRigidBody3D") instance=ExtResource("4_4hrbu")] +_assignedRigidBody3D = NodePath("..") + +[node name="grape2" parent="." index="6" instance=ExtResource("3_kg8e8")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.94627, 0) +continuous_cd = true + +[node name="is_TASable" parent="grape2" index="3" node_paths=PackedStringArray("_assignedRigidBody3D") instance=ExtResource("4_4hrbu")] +_assignedRigidBody3D = NodePath("..") + +[node name="TAS UI" parent="." index="7" instance=ExtResource("4_jskxr")]