🐛 fixed dialogic bugs and moved trash items out of the way

feature/bugfixes_And_Polish
kziolkowski 1 month ago
parent 7bb523f9e7
commit e51e0a24d2

@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
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={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
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]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@ -37,4 +38,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
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?
[end_timeline]
Yeli doesn't seem to have anything to say...
[end_timeline]

@ -53,7 +53,7 @@
[sub_resource type="CircleShape2D" id="CircleShape2D_at1n1"]
resource_local_to_scene = true
radius = 500.0
radius = 300.0
[sub_resource type="SpriteFrames" id="SpriteFrames_f6hss"]
animations = [{
@ -205,6 +205,7 @@ z_index = 1
y_sort_enabled = true
script = ExtResource("1_hn8at")
_sprite = NodePath("TalkingControl/AnimatedSprite")
_retriggerSameTimeline = true
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("42_ahrat")]
position = Vector2(0, -450)
@ -244,9 +245,11 @@ stream = SubResource("AudioStreamRandomizer_ngji7")
bus = &"SFX"
script = ExtResource("50_a7v1a")
[connection signal="FinishedTalking" from="." to="InteractionArea" method="SetActiveInverse"]
[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="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")]
position = Vector2(6403, 3362)
_timelinesToPlay = PackedStringArray("yeli_quest_select")
_retriggerSameTimeline = true
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
z_index = 1
@ -2375,6 +2374,7 @@ position = Vector2(-5016, 3361)
visible = false
z_index = 1
y_sort_enabled = true
position = Vector2(-204, -5186)
[node name="trashObject" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
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="Table" type="Sprite2D" parent="Foreground"]
z_index = 2
y_sort_enabled = true
position = Vector2(-1888, 1112)
texture = ExtResource("2_ubg3a")
@ -231,6 +232,7 @@ region_enabled = true
region_rect = Rect2(1012, 1743, 1470, 417)
[node name="Chair" type="Sprite2D" parent="Foreground"]
z_index = 3
y_sort_enabled = true
position = Vector2(-3032, 2096)
texture = ExtResource("3_gpagp")

@ -1,3 +1,4 @@
using Babushka.scripts.CSharp.Common.Services;
using Godot;
namespace Babushka.scripts.CSharp.Common.NPC;
@ -7,38 +8,29 @@ public partial class TalkingCharacter : Node2D
[Export] private AnimatedSprite2D? _sprite;
[Export] private string[] _timelinesToPlay;
[Export] private bool _retriggerSameTimeline = false;
private bool _isTalking = true;
private int _timelineIndex = 0;
[Signal] public delegate void TalkingEventHandler(string timelineName);
[Signal] public delegate void FinishedTalkingEventHandler(bool hasTimeLinesToPlay);
public override void _Ready()
public void StartTalking()
{
ToggleTalking();
if (_sprite != null)
_sprite.Animation = "talk";
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
if (!_retriggerSameTimeline)
_timelineIndex++;
InputService.Instance.InputEnabled = false;
if (_sprite != null)
_sprite.Play();
}
public void ToggleTalking()
public void StopTalking()
{
if (_isTalking || _timelineIndex >= _timelinesToPlay.Length)
{
if (_sprite != null)
_sprite.Animation = "idle";
_isTalking = false;
}
else
{
if (_sprite != null)
_sprite.Animation = "talk";
_isTalking = true;
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
if (!_retriggerSameTimeline)
_timelineIndex++;
}
if (_sprite != null)
_sprite.Animation = "idle";
InputService.Instance.InputEnabled = true;
if (_sprite != null)
_sprite.Play();
EmitSignal(SignalName.FinishedTalking, _timelineIndex >= _timelinesToPlay.Length);
}
}

@ -1,5 +1,18 @@
extends Node
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):
Dialogic.start(timeline)
func _start_dialog() -> void:
timelineStarted.emit()
func _on_timeline_ended() -> void:
timelineEnded.emit()

Loading…
Cancel
Save