🐛 fixed dialogic bugs and moved trash items out of the way
This commit is contained in:
@@ -3,19 +3,20 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://ccrnmx6bd842k"
|
uid="uid://ccrnmx6bd842k"
|
||||||
path="res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.ctex"
|
path.s3tc="res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/characters/farm fäulnis blobs.png"
|
source_file="res://art/characters/farm fäulnis blobs.png"
|
||||||
dest_files=["res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.ctex"]
|
dest_files=["res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
|
|||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
@@ -37,4 +38,4 @@ process/normal_map_invert_y=false
|
|||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ ifquest res://resources/quests/demo/2_collect_ducks.tres, 1:
|
|||||||
Yeli: Have you collected all the ducks yet?
|
Yeli: Have you collected all the ducks yet?
|
||||||
[end_timeline]
|
[end_timeline]
|
||||||
Yeli doesn't seem to have anything to say...
|
Yeli doesn't seem to have anything to say...
|
||||||
|
[end_timeline]
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_at1n1"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_at1n1"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
radius = 500.0
|
radius = 300.0
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_f6hss"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_f6hss"]
|
||||||
animations = [{
|
animations = [{
|
||||||
@@ -205,6 +205,7 @@ z_index = 1
|
|||||||
y_sort_enabled = true
|
y_sort_enabled = true
|
||||||
script = ExtResource("1_hn8at")
|
script = ExtResource("1_hn8at")
|
||||||
_sprite = NodePath("TalkingControl/AnimatedSprite")
|
_sprite = NodePath("TalkingControl/AnimatedSprite")
|
||||||
|
_retriggerSameTimeline = true
|
||||||
|
|
||||||
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("42_ahrat")]
|
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("42_ahrat")]
|
||||||
position = Vector2(0, -450)
|
position = Vector2(0, -450)
|
||||||
@@ -244,9 +245,11 @@ stream = SubResource("AudioStreamRandomizer_ngji7")
|
|||||||
bus = &"SFX"
|
bus = &"SFX"
|
||||||
script = ExtResource("50_a7v1a")
|
script = ExtResource("50_a7v1a")
|
||||||
|
|
||||||
[connection signal="FinishedTalking" from="." to="InteractionArea" method="SetActiveInverse"]
|
|
||||||
[connection signal="Talking" from="." to="Dialogic starter" method="open"]
|
[connection signal="Talking" from="." to="Dialogic starter" method="open"]
|
||||||
[connection signal="Interacted" from="InteractionArea" to="." method="ToggleTalking"]
|
[connection signal="Interacted" from="InteractionArea" to="." method="StartTalking"]
|
||||||
|
[connection signal="Interacted" from="InteractionArea" to="InteractionArea" method="ToggleActive"]
|
||||||
|
[connection signal="timelineEnded" from="Dialogic starter" to="." method="StopTalking"]
|
||||||
|
[connection signal="timelineEnded" from="Dialogic starter" to="InteractionArea" method="ToggleActive"]
|
||||||
[connection signal="timelineEnded" from="DialogicToggle" to="." method="ToggleTalking"]
|
[connection signal="timelineEnded" from="DialogicToggle" to="." method="ToggleTalking"]
|
||||||
[connection signal="timelineStarted" from="DialogicToggle" to="SFX/AudioStreamPlayer" method="PlayOneShot"]
|
[connection signal="timelineStarted" from="DialogicToggle" to="SFX/AudioStreamPlayer" method="PlayOneShot"]
|
||||||
|
|
||||||
|
|||||||
@@ -1030,7 +1030,6 @@ y_sort_enabled = true
|
|||||||
[node name="Yeli" parent="YSorted" instance=ExtResource("24_wtdui")]
|
[node name="Yeli" parent="YSorted" instance=ExtResource("24_wtdui")]
|
||||||
position = Vector2(6403, 3362)
|
position = Vector2(6403, 3362)
|
||||||
_timelinesToPlay = PackedStringArray("yeli_quest_select")
|
_timelinesToPlay = PackedStringArray("yeli_quest_select")
|
||||||
_retriggerSameTimeline = true
|
|
||||||
|
|
||||||
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
|
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
|
||||||
z_index = 1
|
z_index = 1
|
||||||
@@ -2375,6 +2374,7 @@ position = Vector2(-5016, 3361)
|
|||||||
visible = false
|
visible = false
|
||||||
z_index = 1
|
z_index = 1
|
||||||
y_sort_enabled = true
|
y_sort_enabled = true
|
||||||
|
position = Vector2(-204, -5186)
|
||||||
|
|
||||||
[node name="trashObject" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
|
[node name="trashObject" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
|
||||||
z_index = 0
|
z_index = 0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -223,6 +223,7 @@ _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_vesnas
|
|||||||
[node name="Foreground" type="Node" parent="."]
|
[node name="Foreground" type="Node" parent="."]
|
||||||
|
|
||||||
[node name="Table" type="Sprite2D" parent="Foreground"]
|
[node name="Table" type="Sprite2D" parent="Foreground"]
|
||||||
|
z_index = 2
|
||||||
y_sort_enabled = true
|
y_sort_enabled = true
|
||||||
position = Vector2(-1888, 1112)
|
position = Vector2(-1888, 1112)
|
||||||
texture = ExtResource("2_ubg3a")
|
texture = ExtResource("2_ubg3a")
|
||||||
@@ -231,6 +232,7 @@ region_enabled = true
|
|||||||
region_rect = Rect2(1012, 1743, 1470, 417)
|
region_rect = Rect2(1012, 1743, 1470, 417)
|
||||||
|
|
||||||
[node name="Chair" type="Sprite2D" parent="Foreground"]
|
[node name="Chair" type="Sprite2D" parent="Foreground"]
|
||||||
|
z_index = 3
|
||||||
y_sort_enabled = true
|
y_sort_enabled = true
|
||||||
position = Vector2(-3032, 2096)
|
position = Vector2(-3032, 2096)
|
||||||
texture = ExtResource("3_gpagp")
|
texture = ExtResource("3_gpagp")
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Babushka.scripts.CSharp.Common.Services;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Babushka.scripts.CSharp.Common.NPC;
|
namespace Babushka.scripts.CSharp.Common.NPC;
|
||||||
@@ -7,38 +8,29 @@ public partial class TalkingCharacter : Node2D
|
|||||||
[Export] private AnimatedSprite2D? _sprite;
|
[Export] private AnimatedSprite2D? _sprite;
|
||||||
[Export] private string[] _timelinesToPlay;
|
[Export] private string[] _timelinesToPlay;
|
||||||
[Export] private bool _retriggerSameTimeline = false;
|
[Export] private bool _retriggerSameTimeline = false;
|
||||||
|
|
||||||
private bool _isTalking = true;
|
|
||||||
private int _timelineIndex = 0;
|
private int _timelineIndex = 0;
|
||||||
|
|
||||||
[Signal] public delegate void TalkingEventHandler(string timelineName);
|
[Signal] public delegate void TalkingEventHandler(string timelineName);
|
||||||
[Signal] public delegate void FinishedTalkingEventHandler(bool hasTimeLinesToPlay);
|
|
||||||
|
|
||||||
public override void _Ready()
|
|
||||||
{
|
|
||||||
ToggleTalking();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleTalking()
|
public void StartTalking()
|
||||||
{
|
{
|
||||||
if (_isTalking || _timelineIndex >= _timelinesToPlay.Length)
|
if (_sprite != null)
|
||||||
{
|
_sprite.Animation = "talk";
|
||||||
if (_sprite != null)
|
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
|
||||||
_sprite.Animation = "idle";
|
if (!_retriggerSameTimeline)
|
||||||
_isTalking = false;
|
_timelineIndex++;
|
||||||
}
|
InputService.Instance.InputEnabled = false;
|
||||||
else
|
if (_sprite != null)
|
||||||
{
|
_sprite.Play();
|
||||||
if (_sprite != null)
|
}
|
||||||
_sprite.Animation = "talk";
|
|
||||||
_isTalking = true;
|
public void StopTalking()
|
||||||
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
|
{
|
||||||
if (!_retriggerSameTimeline)
|
if (_sprite != null)
|
||||||
_timelineIndex++;
|
_sprite.Animation = "idle";
|
||||||
}
|
InputService.Instance.InputEnabled = true;
|
||||||
if (_sprite != null)
|
if (_sprite != null)
|
||||||
_sprite.Play();
|
_sprite.Play();
|
||||||
|
|
||||||
EmitSignal(SignalName.FinishedTalking, _timelineIndex >= _timelinesToPlay.Length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
extends Node
|
extends Node
|
||||||
class_name DialogicStarter
|
class_name DialogicStarter
|
||||||
|
|
||||||
|
signal timelineStarted
|
||||||
|
signal timelineEnded
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
Dialogic.timeline_ended.connect(_on_timeline_ended)
|
||||||
|
Dialogic.timeline_started.connect(_start_dialog)
|
||||||
|
|
||||||
func open(timeline: String):
|
func open(timeline: String):
|
||||||
Dialogic.start(timeline)
|
Dialogic.start(timeline)
|
||||||
|
|
||||||
|
func _start_dialog() -> void:
|
||||||
|
timelineStarted.emit()
|
||||||
|
|
||||||
|
func _on_timeline_ended() -> void:
|
||||||
|
timelineEnded.emit()
|
||||||
|
|||||||
Reference in New Issue
Block a user