plein de trucs dont des dialogues!
et ouai! appuye sur e pour parler au npc
This commit is contained in:
11
caracters/bob/bob.dialogue
Normal file
11
caracters/bob/bob.dialogue
Normal file
@@ -0,0 +1,11 @@
|
||||
~ start
|
||||
Nathan: [[Hi|Hello|Howdy]], this is some dialogue.
|
||||
Nathan: Here are some choices.
|
||||
- First one
|
||||
Nathan: You picked the first one.
|
||||
- Second one
|
||||
Nathan: You picked the second one.
|
||||
- Start again => start
|
||||
- End the conversation => END
|
||||
Nathan: For more information see the online documentation.
|
||||
=> END
|
||||
15
caracters/bob/bob.dialogue.import
Normal file
15
caracters/bob/bob.dialogue.import
Normal file
@@ -0,0 +1,15 @@
|
||||
[remap]
|
||||
|
||||
importer="dialogue_manager_compiler_14"
|
||||
type="Resource"
|
||||
uid="uid://vg4mssby1i6p"
|
||||
path="res://.godot/imported/bob.dialogue-14d9e78eeb4886b9f5556385117b67e2.tres"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://caracters/bob/bob.dialogue"
|
||||
dest_files=["res://.godot/imported/bob.dialogue-14d9e78eeb4886b9f5556385117b67e2.tres"]
|
||||
|
||||
[params]
|
||||
|
||||
defaults=true
|
||||
94
caracters/bob/bob.tscn
Normal file
94
caracters/bob/bob.tscn
Normal file
@@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://bleadp4yrdgj"]
|
||||
|
||||
[ext_resource type="Script" path="res://caracters/human.gd" id="1_x3vfc"]
|
||||
[ext_resource type="AnimationNodeStateMachine" uid="uid://ddr1ltkievtku" path="res://animations/human/human_state_machine.tres" id="2_86nrf"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvsendl25xjju" path="res://animations/human/human_animation_player.tscn" id="3_lb4ws"]
|
||||
[ext_resource type="PackedScene" uid="uid://cg4dhp7qe68pt" path="res://animations/human/human.tscn" id="4_25owg"]
|
||||
[ext_resource type="Texture2D" uid="uid://c3lal83o1trpd" path="res://assest/persos/bob.png" id="5_e15yd"]
|
||||
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="5_g2w7l"]
|
||||
[ext_resource type="Script" path="res://caracters/npc.gd" id="7_xosjn"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"]
|
||||
radius = 5.0
|
||||
height = 48.0
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_iwsa7"]
|
||||
graph_offset = Vector2(0, -4)
|
||||
nodes/HumanState/node = ExtResource("2_86nrf")
|
||||
nodes/HumanState/position = Vector2(133.333, 120)
|
||||
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_85jde")
|
||||
nodes/TimeScale/position = Vector2(453.333, 53.3333)
|
||||
nodes/output/position = Vector2(640, 146.667)
|
||||
node_connections = [&"TimeScale", 0, &"HumanState", &"output", 0, &"TimeScale"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1kv0e"]
|
||||
size = Vector2(40, 10)
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6n4r3"]
|
||||
radius = 52.0
|
||||
height = 108.0
|
||||
|
||||
[node name="Bob" type="CharacterBody2D"]
|
||||
z_index = 100
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_x3vfc")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 43)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_a4vmx")
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
tree_root = SubResource("AnimationNodeBlendTree_iwsa7")
|
||||
advance_expression_base_node = NodePath("..")
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/HumanState/grabing/blend_position = Vector2(0, 0)
|
||||
parameters/HumanState/idling/blend_position = Vector2(0, 0)
|
||||
parameters/HumanState/walking/blend_position = Vector2(0, 0)
|
||||
parameters/TimeScale/scale = 1.0
|
||||
|
||||
[node name="AnimationPlayer" parent="." instance=ExtResource("3_lb4ws")]
|
||||
|
||||
[node name="Sprite2D" parent="." instance=ExtResource("4_25owg")]
|
||||
texture = ExtResource("5_e15yd")
|
||||
frame = 1
|
||||
|
||||
[node name="ZIndexControler" parent="." instance=ExtResource("5_g2w7l")]
|
||||
position = Vector2(-1, 37)
|
||||
|
||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
||||
position = Vector2(1, -13)
|
||||
shape = SubResource("RectangleShape2D_1kv0e")
|
||||
target_position = Vector2(0, -48)
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(0, 43)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_a4vmx")
|
||||
|
||||
[node name="npcControler" type="Node2D" parent="." node_paths=PackedStringArray("controled")]
|
||||
script = ExtResource("7_xosjn")
|
||||
controled = NodePath("..")
|
||||
|
||||
[node name="Label" type="Label" parent="npcControler"]
|
||||
visible = false
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
|
||||
[node name="interactable" type="Area2D" parent="."]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="interactable"]
|
||||
position = Vector2(0, 12)
|
||||
shape = SubResource("CapsuleShape2D_6n4r3")
|
||||
|
||||
[connection signal="start_intracting" from="." to="npcControler" method="_on_character_body_2d_start_intracting"]
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||
93
caracters/bob/bob76A8.tmp
Normal file
93
caracters/bob/bob76A8.tmp
Normal file
@@ -0,0 +1,93 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://bleadp4yrdgj"]
|
||||
|
||||
[ext_resource type="Script" path="res://caracters/human.gd" id="1_x3vfc"]
|
||||
[ext_resource type="AnimationNodeStateMachine" uid="uid://ddr1ltkievtku" path="res://animations/human/human_state_machine.tres" id="2_86nrf"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvsendl25xjju" path="res://animations/human/human_animation_player.tscn" id="3_lb4ws"]
|
||||
[ext_resource type="PackedScene" uid="uid://cg4dhp7qe68pt" path="res://animations/human/human.tscn" id="4_25owg"]
|
||||
[ext_resource type="Texture2D" uid="uid://c3lal83o1trpd" path="res://assest/persos/bob.png" id="5_e15yd"]
|
||||
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="5_g2w7l"]
|
||||
[ext_resource type="Script" path="res://caracters/npc.gd" id="7_xosjn"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"]
|
||||
radius = 5.0
|
||||
height = 48.0
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_iwsa7"]
|
||||
graph_offset = Vector2(0, -4)
|
||||
nodes/HumanState/node = ExtResource("2_86nrf")
|
||||
nodes/HumanState/position = Vector2(133.333, 120)
|
||||
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_85jde")
|
||||
nodes/TimeScale/position = Vector2(453.333, 53.3333)
|
||||
nodes/output/position = Vector2(640, 146.667)
|
||||
node_connections = [&"TimeScale", 0, &"HumanState", &"output", 0, &"TimeScale"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1kv0e"]
|
||||
size = Vector2(40, 10)
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6n4r3"]
|
||||
radius = 52.0
|
||||
height = 108.0
|
||||
|
||||
[node name="Bob" type="CharacterBody2D"]
|
||||
z_index = 100
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_x3vfc")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 43)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_a4vmx")
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
tree_root = SubResource("AnimationNodeBlendTree_iwsa7")
|
||||
advance_expression_base_node = NodePath("..")
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/HumanState/grabing/blend_position = Vector2(0, 0)
|
||||
parameters/HumanState/idling/blend_position = Vector2(0, 0)
|
||||
parameters/HumanState/walking/blend_position = Vector2(0, 0)
|
||||
parameters/TimeScale/scale = 1.0
|
||||
|
||||
[node name="AnimationPlayer" parent="." instance=ExtResource("3_lb4ws")]
|
||||
|
||||
[node name="Sprite2D" parent="." instance=ExtResource("4_25owg")]
|
||||
texture = ExtResource("5_e15yd")
|
||||
frame = 1
|
||||
|
||||
[node name="ZIndexControler" parent="." instance=ExtResource("5_g2w7l")]
|
||||
position = Vector2(-1, 37)
|
||||
|
||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
||||
position = Vector2(1, -13)
|
||||
shape = SubResource("RectangleShape2D_1kv0e")
|
||||
target_position = Vector2(0, -48)
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(0, 43)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_a4vmx")
|
||||
|
||||
[node name="npcControler" type="Node2D" parent="." node_paths=PackedStringArray("controled")]
|
||||
script = ExtResource("7_xosjn")
|
||||
controled = NodePath("..")
|
||||
|
||||
[node name="Label" type="Label" parent="npcControler"]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
|
||||
[node name="interactable" type="Area2D" parent="."]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="interactable"]
|
||||
position = Vector2(0, 12)
|
||||
shape = SubResource("CapsuleShape2D_6n4r3")
|
||||
|
||||
[connection signal="start_intracting" from="." to="npcControler" method="_on_character_body_2d_start_intracting"]
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||
5
caracters/bob/interactable.gd
Normal file
5
caracters/bob/interactable.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
func start_interaction(askingForInteraction: Human):
|
||||
(get_parent() as Human).start_interaction(askingForInteraction)
|
||||
Reference in New Issue
Block a user