Compare commits
2 Commits
0c237430ea
...
36dd5631ea
| Author | SHA1 | Date | |
|---|---|---|---|
| 36dd5631ea | |||
| 9e5946ddab |
@@ -1,25 +0,0 @@
|
|||||||
extends State
|
|
||||||
|
|
||||||
@export var wait_time: float = 3.0
|
|
||||||
|
|
||||||
var runtime_timer: Timer
|
|
||||||
|
|
||||||
func enter() -> void:
|
|
||||||
run_animation()
|
|
||||||
runtime_timer = Timer.new()
|
|
||||||
runtime_timer.name = "IdleTimer"
|
|
||||||
add_child(runtime_timer)
|
|
||||||
runtime_timer.one_shot = true
|
|
||||||
runtime_timer.timeout.connect(_on_timer_timeout)
|
|
||||||
runtime_timer.start(wait_time)
|
|
||||||
|
|
||||||
func exit() -> void:
|
|
||||||
if runtime_timer:
|
|
||||||
if runtime_timer.is_connected("timeout", _on_timer_timeout):
|
|
||||||
runtime_timer.timeout.disconnect(_on_timer_timeout)
|
|
||||||
|
|
||||||
runtime_timer.queue_free()
|
|
||||||
runtime_timer = null
|
|
||||||
|
|
||||||
func _on_timer_timeout() -> void:
|
|
||||||
transitioned.emit(self, next_state_id)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://nga8qx56iwgu
|
|
||||||
@@ -4,4 +4,50 @@
|
|||||||
|
|
||||||
[node name="AiCitizenSitter" unique_id=1228675528 instance=ExtResource("1_cduuu")]
|
[node name="AiCitizenSitter" unique_id=1228675528 instance=ExtResource("1_cduuu")]
|
||||||
|
|
||||||
|
[node name="SK_Mannequin" parent="HumanMannequin" parent_id_path=PackedInt32Array(333236377) index="0" unique_id=377304892]
|
||||||
|
transform = Transform3D(0.99906886, 0.025971904, -0.03444738, 0.038254507, -0.16420224, 0.98568463, 0.019943757, -0.98608464, -0.1650429, 0.034450583, -0.44864154, 0.18535595)
|
||||||
|
|
||||||
|
[node name="Skeleton3D" parent="HumanMannequin/SK_Mannequin" index="0" unique_id=427572412]
|
||||||
|
bones/2/rotation = Quaternion(-0.007029906, 0.032859802, -0.23654123, 0.97104025)
|
||||||
|
bones/3/rotation = Quaternion(-0.000884556, 0.0033522977, 0.10280211, 0.99469584)
|
||||||
|
bones/4/rotation = Quaternion(-0.00040807336, 0.0034836144, 0.0045103733, 0.9999837)
|
||||||
|
bones/5/rotation = Quaternion(0.13797933, 0.74176145, 0.017092831, 0.6560942)
|
||||||
|
bones/6/rotation = Quaternion(0.049281683, 0.43982458, -0.36467218, 0.81923133)
|
||||||
|
bones/7/rotation = Quaternion(-0.049351897, 0.03842162, -0.476375, 0.87701494)
|
||||||
|
bones/8/rotation = Quaternion(-0.41694272, -0.05554785, -0.18030654, 0.889136)
|
||||||
|
bones/9/rotation = Quaternion(0.094457716, 0.050416686, 0.50820345, 0.85455555)
|
||||||
|
bones/10/rotation = Quaternion(0.011606372, 0.08610083, 0.2719557, 0.95838)
|
||||||
|
bones/12/rotation = Quaternion(-0.00016985182, 0.0032503307, 0.42722064, 0.90414155)
|
||||||
|
bones/13/rotation = Quaternion(-0.018024907, 0.015150134, 0.27278355, 0.9617873)
|
||||||
|
bones/15/rotation = Quaternion(-0.13467012, -0.10029431, 0.2853874, 0.94358844)
|
||||||
|
bones/16/rotation = Quaternion(0.010311794, -0.034373257, 0.13259757, 0.9905202)
|
||||||
|
bones/18/rotation = Quaternion(-0.09865642, -0.08747626, 0.37470394, 0.917721)
|
||||||
|
bones/19/rotation = Quaternion(0.0042531197, -0.033760007, 0.1860149, 0.98195755)
|
||||||
|
bones/21/rotation = Quaternion(0.70078146, 0.36200625, -0.001720201, 0.61469823)
|
||||||
|
bones/22/rotation = Quaternion(-0.001820262, 0.12128391, 0.22490783, 0.9668006)
|
||||||
|
bones/26/rotation = Quaternion(0.76902086, -0.13267346, -0.62528044, -0.005393706)
|
||||||
|
bones/27/rotation = Quaternion(0.034201004, 0.38763282, -0.48749813, 0.7816117)
|
||||||
|
bones/28/rotation = Quaternion(-0.053170834, 0.025972798, -0.32202634, 0.9448796)
|
||||||
|
bones/29/rotation = Quaternion(-0.43919632, 0.049489442, -0.098192796, 0.89163643)
|
||||||
|
bones/30/rotation = Quaternion(0.103668794, 0.04579189, 0.46590617, 0.8775462)
|
||||||
|
bones/31/rotation = Quaternion(0.011519267, 0.09922818, 0.29214594, 0.95114243)
|
||||||
|
bones/33/rotation = Quaternion(9.437185e-05, 0.009016322, 0.44048977, 0.89771235)
|
||||||
|
bones/34/rotation = Quaternion(-0.018226523, 0.017689873, 0.23132406, 0.97254515)
|
||||||
|
bones/36/rotation = Quaternion(-0.13272016, -0.101737194, 0.26830983, 0.9487069)
|
||||||
|
bones/37/rotation = Quaternion(0.010193698, -0.046628788, 0.19672133, 0.97929704)
|
||||||
|
bones/39/rotation = Quaternion(-0.110196866, -0.05036995, 0.35450295, 0.9271716)
|
||||||
|
bones/40/rotation = Quaternion(0.0042593707, -0.028552007, 0.17841409, 0.983532)
|
||||||
|
bones/42/rotation = Quaternion(0.7297342, 0.26573184, -0.09265223, 0.6231294)
|
||||||
|
bones/43/rotation = Quaternion(0.06426929, 0.22943345, 0.1991351, 0.95056564)
|
||||||
|
bones/47/rotation = Quaternion(0.00421817, -0.00037953872, -0.21590644, 0.9764049)
|
||||||
|
bones/49/rotation = Quaternion(0.14012733, -0.038448263, 0.6819175, 0.7168505)
|
||||||
|
bones/50/rotation = Quaternion(-0.05631607, 0.020481886, -0.74316776, 0.6664162)
|
||||||
|
bones/52/rotation = Quaternion(-0.0004946971, -0.048858073, -0.0074254284, 0.998778)
|
||||||
|
bones/55/rotation = Quaternion(0.0132777635, 0.10731075, 0.71409845, -0.6916441)
|
||||||
|
bones/56/rotation = Quaternion(0.03920827, -0.09832406, -0.75485575, 0.64729285)
|
||||||
|
bones/58/rotation = Quaternion(0.01656407, -0.06386153, 0.030505493, 0.9973549)
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" parent="HumanMannequin" parent_id_path=PackedInt32Array(333236377) index="1" unique_id=233699491]
|
||||||
|
autoplay = &"custom/sit"
|
||||||
|
|
||||||
[editable path="HumanMannequin"]
|
[editable path="HumanMannequin"]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
[gd_scene format=3 uid="uid://bnnuke5e7e1yr"]
|
[gd_scene format=3 uid="uid://bnnuke5e7e1yr"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bdqeshcwwnyc4" path="res://core/ai/agents/human/ai_citizen.tscn" id="1_dms8s"]
|
[ext_resource type="PackedScene" uid="uid://bdqeshcwwnyc4" path="res://core/ai/agents/human/ai_citizen.tscn" id="1_dms8s"]
|
||||||
[ext_resource type="Script" uid="uid://nga8qx56iwgu" path="res://core/ai/agents/base/idle_state.gd" id="2_tiuwx"]
|
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_awhwq"]
|
||||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/agents/base/patrol_state.gd" id="3_8d0tj"]
|
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_8d0tj"]
|
||||||
|
|
||||||
[node name="AiCitizenWalker" unique_id=1228675528 instance=ExtResource("1_dms8s")]
|
[node name="AiCitizenWalker" unique_id=1228675528 instance=ExtResource("1_dms8s")]
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
initial_state = NodePath("IdleState")
|
initial_state = NodePath("IdleState")
|
||||||
|
|
||||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=42226979]
|
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=42226979]
|
||||||
script = ExtResource("2_tiuwx")
|
script = ExtResource("2_awhwq")
|
||||||
state_id = &"idle"
|
state_id = &"idle"
|
||||||
next_state_id = &"patrol"
|
next_state_id = &"patrol"
|
||||||
animation_name = "custom/idle"
|
animation_name = "custom/idle"
|
||||||
@@ -20,5 +20,6 @@ script = ExtResource("3_8d0tj")
|
|||||||
state_id = &"patrol"
|
state_id = &"patrol"
|
||||||
next_state_id = &"idle"
|
next_state_id = &"idle"
|
||||||
animation_name = "custom/walking"
|
animation_name = "custom/walking"
|
||||||
|
wait_time = 0.0
|
||||||
|
|
||||||
[editable path="HumanMannequin"]
|
[editable path="HumanMannequin"]
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
[gd_scene format=3 uid="uid://ceqxsqfiotm5j"]
|
[gd_scene format=3 uid="uid://ceqxsqfiotm5j"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://mvh2v6v72stt" path="res://core/ai/agents/human/ai_human.tscn" id="1_l2y7m"]
|
[ext_resource type="PackedScene" uid="uid://mvh2v6v72stt" path="res://core/ai/agents/human/ai_human.tscn" id="1_l2y7m"]
|
||||||
|
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_2oda6"]
|
||||||
|
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="4_2oda6"]
|
||||||
|
|
||||||
[node name="AiFarmer" unique_id=1228675528 instance=ExtResource("1_l2y7m")]
|
[node name="AiFarmer" unique_id=1228675528 instance=ExtResource("1_l2y7m")]
|
||||||
|
|
||||||
|
[node name="StateMachine" parent="." index="3" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||||
|
initial_state = NodePath("GatherState")
|
||||||
|
|
||||||
|
[node name="PatrolState" type="Node" parent="StateMachine" index="0" unique_id=930272128]
|
||||||
|
script = ExtResource("3_2oda6")
|
||||||
|
state_id = &"patrol"
|
||||||
|
next_state_id = &"gather"
|
||||||
|
animation_name = "custom/walking"
|
||||||
|
wait_time = 0.0
|
||||||
|
|
||||||
|
[node name="GatherState" type="Node" parent="StateMachine" index="1" unique_id=48091671]
|
||||||
|
script = ExtResource("4_2oda6")
|
||||||
|
state_id = &"gather"
|
||||||
|
next_state_id = &"patrol"
|
||||||
|
animation_name = "custom/gather"
|
||||||
|
exit_on_animation_finished = true
|
||||||
|
wait_time = 1.0
|
||||||
|
|
||||||
[editable path="HumanMannequin"]
|
[editable path="HumanMannequin"]
|
||||||
|
|||||||
BIN
core/ai/agents/human/gather.fbx
Normal file
BIN
core/ai/agents/human/gather.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/gather.fbx.import
Normal file
2103
core/ai/agents/human/gather.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/ai/agents/human/gather.res
Normal file
BIN
core/ai/agents/human/gather.res
Normal file
Binary file not shown.
@@ -1,87 +1,91 @@
|
|||||||
[gd_scene format=3 uid="uid://legcajdd0jsy"]
|
[gd_scene format=3 uid="uid://legcajdd0jsy"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ys8pesrqeyv2" path="res://core/ai/agents/human/human_mannequin_mixamo.fbx" id="1_561x5"]
|
[ext_resource type="PackedScene" uid="uid://ys8pesrqeyv2" path="res://core/ai/agents/human/human_mannequin_mixamo.fbx" id="1_561x5"]
|
||||||
|
[ext_resource type="Animation" uid="uid://c3rjx3uo8mbt3" path="res://core/ai/agents/human/gather.res" id="2_3r4wv"]
|
||||||
[ext_resource type="Animation" uid="uid://b2wo1mpqihko6" path="res://core/ai/agents/human/idle.res" id="2_b4vfe"]
|
[ext_resource type="Animation" uid="uid://b2wo1mpqihko6" path="res://core/ai/agents/human/idle.res" id="2_b4vfe"]
|
||||||
[ext_resource type="Animation" uid="uid://cd02fn4tl8pxt" path="res://core/ai/agents/human/walking.res" id="3_jl3mr"]
|
[ext_resource type="Animation" uid="uid://ckkmrph86jlsd" path="res://core/ai/agents/human/walking.res" id="3_jl3mr"]
|
||||||
|
[ext_resource type="Animation" uid="uid://biaxql3fr1787" path="res://core/ai/agents/human/sit.res" id="4_xaokg"]
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3r4wv"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3r4wv"]
|
||||||
_data = {
|
_data = {
|
||||||
|
&"gather": ExtResource("2_3r4wv"),
|
||||||
&"idle": ExtResource("2_b4vfe"),
|
&"idle": ExtResource("2_b4vfe"),
|
||||||
|
&"sit": ExtResource("4_xaokg"),
|
||||||
&"walking": ExtResource("3_jl3mr")
|
&"walking": ExtResource("3_jl3mr")
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="HumanMannequin" unique_id=1583776159 instance=ExtResource("1_561x5")]
|
[node name="HumanMannequin" unique_id=1583776159 instance=ExtResource("1_561x5")]
|
||||||
|
|
||||||
[node name="SK_Mannequin" parent="." index="0" unique_id=377304892]
|
[node name="SK_Mannequin" parent="." index="0" unique_id=377304892]
|
||||||
transform = Transform3D(0.9976258, -0.04861942, 0.048771314, -0.04795494, 0.017819177, 0.99869055, -0.049424794, -0.9986584, 0.015445333, -0.05003774, -0.025284957, -0.009851909)
|
transform = Transform3D(0.9990688, 0.025971903, -0.034447376, 0.038254507, -0.16420223, 0.9856846, 0.019943757, -0.9860846, -0.16504289, 0.034450583, -0.44864154, 0.18535595)
|
||||||
|
|
||||||
[node name="Skeleton3D" parent="SK_Mannequin" index="0" unique_id=427572412]
|
[node name="Skeleton3D" parent="SK_Mannequin" index="0" unique_id=427572412]
|
||||||
bones/2/rotation = Quaternion(0.0031313226, -0.013143469, -0.06403692, 0.9978561)
|
bones/2/rotation = Quaternion(-0.007029906, 0.032859802, -0.23654123, 0.97104025)
|
||||||
bones/3/rotation = Quaternion(0.0060529755, -0.0043215775, 0.11905511, 0.9928599)
|
bones/3/rotation = Quaternion(-0.000884556, 0.0033522977, 0.10280211, 0.99469584)
|
||||||
bones/4/position = Vector3(0.13407329, 0.004204774, -5.584202e-15)
|
bones/4/position = Vector3(0.13407329, 0.004204774, -5.584202e-15)
|
||||||
bones/4/rotation = Quaternion(0.005354738, -0.005161587, 0.020867111, 0.9997546)
|
bones/4/rotation = Quaternion(-0.00040807336, 0.0034836144, 0.0045103733, 0.9999837)
|
||||||
bones/5/rotation = Quaternion(0.15400349, 0.7897888, 0.010658391, 0.59363556)
|
bones/5/rotation = Quaternion(0.13797933, 0.74176145, 0.017092831, 0.6560942)
|
||||||
bones/6/position = Vector3(0.15784872, 1.4317955e-11, 6.3591354e-11)
|
bones/6/position = Vector3(0.15784872, 1.4317955e-11, 6.3591354e-11)
|
||||||
bones/6/rotation = Quaternion(0.04945157, 0.4279849, -0.15578857, 0.8888832)
|
bones/6/rotation = Quaternion(0.049281683, 0.43982458, -0.36467218, 0.81923133)
|
||||||
bones/7/position = Vector3(0.3033993, 8.407472e-11, 3.197531e-11)
|
bones/7/position = Vector3(0.3033993, 8.407472e-11, 3.197531e-11)
|
||||||
bones/7/rotation = Quaternion(0.1100848, 0.10641666, -0.25697437, 0.95421225)
|
bones/7/rotation = Quaternion(-0.049351897, 0.03842162, -0.476375, 0.87701494)
|
||||||
bones/8/position = Vector3(0.26975143, 1.572964e-11, -9.6207486e-11)
|
bones/8/position = Vector3(0.26975143, 1.572964e-11, -9.6207486e-11)
|
||||||
bones/8/rotation = Quaternion(-0.46975335, -0.009780162, -0.20075577, 0.8596124)
|
bones/8/rotation = Quaternion(-0.41694272, -0.05554785, -0.18030654, 0.889136)
|
||||||
bones/9/rotation = Quaternion(0.11536587, 0.112830326, 0.39687443, 0.9035766)
|
bones/9/rotation = Quaternion(0.094457716, 0.050416686, 0.50820345, 0.85455555)
|
||||||
bones/10/position = Vector3(0.04287498, -2.9850333e-10, 5.048406e-11)
|
bones/10/position = Vector3(0.04287498, -2.9850333e-10, 5.048406e-11)
|
||||||
bones/10/rotation = Quaternion(-0.0044350666, 0.31514773, 0.57789063, 0.752798)
|
bones/10/rotation = Quaternion(0.011606372, 0.08610083, 0.2719557, 0.95838)
|
||||||
bones/11/position = Vector3(0.0339379, 1.1695445e-10, -2.349232e-11)
|
bones/11/position = Vector3(0.0339379, 1.1695445e-10, -2.349232e-11)
|
||||||
bones/12/rotation = Quaternion(-0.026846388, 0.13234028, 0.54907507, 0.82479215)
|
bones/12/rotation = Quaternion(-0.00016985182, 0.0032503307, 0.42722064, 0.90414155)
|
||||||
bones/13/position = Vector3(0.046403743, -3.648193e-11, 1.830866e-11)
|
bones/13/position = Vector3(0.046403743, -3.648193e-11, 1.830866e-11)
|
||||||
bones/13/rotation = Quaternion(-0.017277073, 0.20109688, 0.7544296, 0.62457794)
|
bones/13/rotation = Quaternion(-0.018024907, 0.015150134, 0.27278355, 0.9617873)
|
||||||
bones/14/position = Vector3(0.036488436, -1.9989443e-10, 1.6076356e-11)
|
bones/14/position = Vector3(0.036488436, -1.9989443e-10, 1.6076356e-11)
|
||||||
bones/15/rotation = Quaternion(-0.26582807, -0.019897597, 0.63471824, 0.7253084)
|
bones/15/rotation = Quaternion(-0.13467012, -0.10029431, 0.2853874, 0.94358844)
|
||||||
bones/16/position = Vector3(0.03570981, 1.8669866e-10, 3.9181436e-12)
|
bones/16/position = Vector3(0.03570981, 1.8669866e-10, 3.9181436e-12)
|
||||||
bones/16/rotation = Quaternion(0.036874738, -0.06492835, 0.74109465, 0.66723555)
|
bones/16/rotation = Quaternion(0.010311794, -0.034373257, 0.13259757, 0.9905202)
|
||||||
bones/17/position = Vector3(0.029856307, -3.005879e-10, -4.0375425e-11)
|
bones/17/position = Vector3(0.029856307, -3.005879e-10, -4.0375425e-11)
|
||||||
bones/18/rotation = Quaternion(-0.1965758, 0.008460626, 0.5697997, 0.7978814)
|
bones/18/rotation = Quaternion(-0.09865642, -0.08747626, 0.37470394, 0.917721)
|
||||||
bones/19/position = Vector3(0.04430177, 4.6665116e-11, -9.4033115e-12)
|
bones/19/position = Vector3(0.04430177, 4.6665116e-11, -9.4033115e-12)
|
||||||
bones/19/rotation = Quaternion(0.008596869, -0.008138666, 0.79523915, 0.6061805)
|
bones/19/rotation = Quaternion(0.0042531197, -0.033760007, 0.1860149, 0.98195755)
|
||||||
bones/20/position = Vector3(0.034766525, -1.6786372e-10, 2.768652e-11)
|
bones/20/position = Vector3(0.034766525, -1.6786372e-10, 2.768652e-11)
|
||||||
bones/21/rotation = Quaternion(0.601964, 0.35209224, 0.09299817, 0.7106489)
|
bones/21/rotation = Quaternion(0.70078146, 0.36200625, -0.001720201, 0.61469823)
|
||||||
bones/22/position = Vector3(0.038696717, 5.0118687e-11, 9.9849684e-11)
|
bones/22/position = Vector3(0.038696717, 5.0118687e-11, 9.9849684e-11)
|
||||||
bones/22/rotation = Quaternion(0.0021266919, -0.004949208, 0.064930424, 0.9978753)
|
bones/22/rotation = Quaternion(-0.001820262, 0.12128391, 0.22490783, 0.9668006)
|
||||||
bones/23/position = Vector3(0.040621713, 1.0721979e-11, -5.127232e-12)
|
bones/23/position = Vector3(0.040621713, 1.0721979e-11, -5.127232e-12)
|
||||||
bones/24/position = Vector3(0.14, 1.110223e-16, 2.220446e-16)
|
bones/24/position = Vector3(0.14, 1.110223e-16, 2.220446e-16)
|
||||||
bones/24/rotation = Quaternion(-2.7755576e-17, -6.938894e-17, -6.938894e-18, 1)
|
bones/24/rotation = Quaternion(-2.7755576e-17, -6.938894e-17, -6.938894e-18, 1)
|
||||||
bones/25/position = Vector3(0.005, -2.7755576e-17, 0)
|
bones/25/position = Vector3(0.005, -2.7755576e-17, 0)
|
||||||
bones/25/rotation = Quaternion(-9.540979e-18, -2.7755576e-17, 9.540979e-18, 1)
|
bones/25/rotation = Quaternion(-9.540979e-18, -2.7755576e-17, 9.540979e-18, 1)
|
||||||
bones/26/rotation = Quaternion(0.7842187, -0.19943702, -0.5848191, 0.056679882)
|
bones/26/rotation = Quaternion(0.76902086, -0.13267346, -0.62528044, -0.005393706)
|
||||||
bones/27/rotation = Quaternion(0.052973837, 0.44702604, -0.029942662, 0.8924489)
|
bones/27/rotation = Quaternion(0.034201004, 0.38763282, -0.48749813, 0.7816117)
|
||||||
bones/28/rotation = Quaternion(0.06465698, 0.12901439, -0.19377781, 0.97037363)
|
bones/28/rotation = Quaternion(-0.053170834, 0.025972798, -0.32202634, 0.9448796)
|
||||||
bones/29/position = Vector3(-0.26975244, 2.563412e-07, -1.1905385e-08)
|
bones/29/position = Vector3(-0.26975244, 2.563412e-07, -1.1905385e-08)
|
||||||
bones/29/rotation = Quaternion(-0.4454563, -0.012538448, -0.12649484, 0.8862339)
|
bones/29/rotation = Quaternion(-0.43919632, 0.049489442, -0.098192796, 0.89163643)
|
||||||
bones/30/rotation = Quaternion(0.09673716, 0.06657806, 0.37996292, 0.91751707)
|
bones/30/rotation = Quaternion(0.103668794, 0.04579189, 0.46590617, 0.8775462)
|
||||||
bones/31/rotation = Quaternion(-0.017224751, 0.24962947, 0.49292365, 0.8333155)
|
bones/31/rotation = Quaternion(0.011519267, 0.09922818, 0.29214594, 0.95114243)
|
||||||
bones/33/rotation = Quaternion(-0.026649816, 0.050389662, 0.4562443, 0.888027)
|
bones/33/rotation = Quaternion(9.437185e-05, 0.009016322, 0.44048977, 0.89771235)
|
||||||
bones/34/rotation = Quaternion(-0.0493639, 0.13757928, 0.58074373, 0.80085707)
|
bones/34/rotation = Quaternion(-0.018226523, 0.017689873, 0.23132406, 0.97254515)
|
||||||
bones/36/rotation = Quaternion(-0.14342895, 0.025572311, 0.42342505, 0.89413947)
|
bones/36/rotation = Quaternion(-0.13272016, -0.101737194, 0.26830983, 0.9487069)
|
||||||
bones/37/rotation = Quaternion(0.050029494, -0.01992205, 0.69104576, 0.7208023)
|
bones/37/rotation = Quaternion(0.010193698, -0.046628788, 0.19672133, 0.97929704)
|
||||||
bones/39/rotation = Quaternion(-0.115030825, 0.01676327, 0.45154506, 0.88464344)
|
bones/39/rotation = Quaternion(-0.110196866, -0.05036995, 0.35450295, 0.9271716)
|
||||||
bones/40/rotation = Quaternion(0.020354148, 0.009153387, 0.6477204, 0.76155126)
|
bones/40/rotation = Quaternion(0.0042593707, -0.028552007, 0.17841409, 0.983532)
|
||||||
bones/42/rotation = Quaternion(0.6151735, 0.28622907, 0.016048126, 0.7344229)
|
bones/42/rotation = Quaternion(0.7297342, 0.26573184, -0.09265223, 0.6231294)
|
||||||
bones/43/rotation = Quaternion(0.19211918, 0.11141997, 0.124592975, 0.9670328)
|
bones/43/rotation = Quaternion(0.06426929, 0.22943345, 0.1991351, 0.95056564)
|
||||||
bones/45/rotation = Quaternion(-0.1176271, 1.3974802e-16, -6.288661e-17, 0.99305785)
|
bones/45/rotation = Quaternion(-0.1176271, 1.3974802e-16, -6.288661e-17, 0.99305785)
|
||||||
bones/46/rotation = Quaternion(-0.17323487, -2.099698e-25, 1.9374898e-17, 0.9848805)
|
bones/46/rotation = Quaternion(-0.17323487, -2.099698e-25, 1.9374898e-17, 0.9848805)
|
||||||
bones/47/rotation = Quaternion(-0.0043949056, 0.010375962, -0.20370215, 0.97896814)
|
bones/47/rotation = Quaternion(0.00421817, -0.00037953872, -0.21590644, 0.9764049)
|
||||||
bones/48/position = Vector3(0.092836134, 0.0036415688, 2.7747754e-17)
|
bones/48/position = Vector3(0.092836134, 0.0036415688, 2.7747754e-17)
|
||||||
bones/48/rotation = Quaternion(1.2661336e-17, 9.989056e-18, 0.13354194, 0.99104315)
|
bones/48/rotation = Quaternion(1.2661336e-17, 9.989056e-18, 0.13354194, 0.99104315)
|
||||||
bones/49/rotation = Quaternion(0.13130783, -0.05036935, 0.24724077, 0.95869356)
|
bones/49/rotation = Quaternion(0.14012733, -0.038448263, 0.6819175, 0.7168505)
|
||||||
bones/50/position = Vector3(-0.42572036, 1.7074263e-12, -4.667877e-12)
|
bones/50/position = Vector3(-0.42572036, 1.7074263e-12, -4.667877e-12)
|
||||||
bones/50/rotation = Quaternion(-0.048483394, -0.038352683, -0.5716499, 0.81816554)
|
bones/50/rotation = Quaternion(-0.05631607, 0.020481886, -0.74316776, 0.6664162)
|
||||||
bones/51/position = Vector3(-0.20476776, -1.3877788e-17, 0)
|
bones/51/position = Vector3(-0.20476776, -1.3877788e-17, 0)
|
||||||
bones/52/position = Vector3(-0.4019669, -3.933849e-11, 1.899425e-12)
|
bones/52/position = Vector3(-0.4019669, -3.933849e-11, 1.899425e-12)
|
||||||
bones/52/rotation = Quaternion(-0.00021856392, -0.0061088647, 0.036131103, 0.9993284)
|
bones/52/rotation = Quaternion(-0.0004946971, -0.048858073, -0.0074254284, 0.998778)
|
||||||
bones/54/position = Vector3(-0.22094238, 4.7704896e-18, 0)
|
bones/54/position = Vector3(-0.22094238, 4.7704896e-18, 0)
|
||||||
bones/55/rotation = Quaternion(-0.041710682, 0.15009321, 0.97912854, -0.13053581)
|
bones/55/rotation = Quaternion(0.0132777635, 0.10731075, 0.71409845, -0.6916441)
|
||||||
bones/56/rotation = Quaternion(-0.11438767, 0.007083657, -0.2708839, 0.95576525)
|
bones/56/rotation = Quaternion(0.03920827, -0.09832406, -0.75485575, 0.64729285)
|
||||||
bones/57/position = Vector3(0.20476907, 0, -5.551115e-17)
|
bones/57/position = Vector3(0.20476907, 0, -5.551115e-17)
|
||||||
bones/58/rotation = Quaternion(-0.00023867, -0.056162532, 0.13990264, 0.98857117)
|
bones/58/rotation = Quaternion(0.01656407, -0.06386153, 0.030505493, 0.9973549)
|
||||||
bones/60/position = Vector3(0.22094241, 3.035766e-18, -2.7755576e-17)
|
bones/60/position = Vector3(0.22094241, 3.035766e-18, -2.7755576e-17)
|
||||||
bones/67/position = Vector3(-4.440892e-16, 0, 7.632783e-17)
|
bones/67/position = Vector3(-4.440892e-16, 0, 7.632783e-17)
|
||||||
bones/67/rotation = Quaternion(-2.8449465e-16, 8.326673e-17, 2.7755576e-17, 1)
|
bones/67/rotation = Quaternion(-2.8449465e-16, 8.326673e-17, 2.7755576e-17, 1)
|
||||||
|
|||||||
Binary file not shown.
BIN
core/ai/agents/human/sit.fbx
Normal file
BIN
core/ai/agents/human/sit.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/sit.fbx.import
Normal file
2103
core/ai/agents/human/sit.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/ai/agents/human/sit.res
Normal file
BIN
core/ai/agents/human/sit.res
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
extends State
|
extends State
|
||||||
|
|
||||||
func enter() -> void:
|
func enter() -> void:
|
||||||
|
super.enter()
|
||||||
run_animation()
|
run_animation()
|
||||||
agent.navigate_to_random_point()
|
agent.navigate_to_random_point()
|
||||||
|
|
||||||
6
core/ai/framework/run_animation_state.gd
Normal file
6
core/ai/framework/run_animation_state.gd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
extends State
|
||||||
|
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
super.enter()
|
||||||
|
run_animation()
|
||||||
1
core/ai/framework/run_animation_state.gd.uid
Normal file
1
core/ai/framework/run_animation_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://d3hy70ec8vqo5
|
||||||
@@ -5,26 +5,53 @@ class_name State
|
|||||||
@export var state_id: StringName = &""
|
@export var state_id: StringName = &""
|
||||||
@export var next_state_id: StringName
|
@export var next_state_id: StringName
|
||||||
@export var animation_name: String
|
@export var animation_name: String
|
||||||
|
@export var exit_on_animation_finished: bool
|
||||||
|
@export var wait_time: float = 3.0
|
||||||
|
|
||||||
|
var runtime_timer: Timer
|
||||||
|
|
||||||
@onready var agent: AIBase = owner
|
@onready var agent: AIBase = owner
|
||||||
|
|
||||||
@warning_ignore("unused_signal")
|
|
||||||
signal transitioned(state: State, new_state_id: StringName)
|
signal transitioned(state: State, new_state_id: StringName)
|
||||||
|
|
||||||
func enter() -> void:
|
func _ready() -> void:
|
||||||
|
if wait_time > 0:
|
||||||
|
runtime_timer = Timer.new()
|
||||||
|
runtime_timer.name = "IdleTimer"
|
||||||
|
runtime_timer.one_shot = true
|
||||||
|
add_child(runtime_timer)
|
||||||
|
runtime_timer.timeout.connect(_on_timer_timeout)
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
if exit_on_animation_finished:
|
||||||
|
if not agent.anim_player.animation_finished.is_connected(_on_animation_finished):
|
||||||
|
agent.anim_player.animation_finished.connect(_on_animation_finished)
|
||||||
|
elif wait_time > 0:
|
||||||
|
runtime_timer.start(wait_time)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
if exit_on_animation_finished and agent.anim_player.animation_finished.is_connected(_on_animation_finished):
|
||||||
|
agent.anim_player.animation_finished.disconnect(_on_animation_finished)
|
||||||
|
|
||||||
|
if runtime_timer and not runtime_timer.is_stopped():
|
||||||
|
runtime_timer.stop()
|
||||||
|
|
||||||
|
func update(_delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func exit() -> void:
|
func physics_update(_delta: float) -> void:
|
||||||
pass
|
|
||||||
|
|
||||||
func update(_delta) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
func physics_update(_delta) -> void:
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func run_animation() -> void:
|
func run_animation() -> void:
|
||||||
if agent.anim_player and agent.anim_player.has_animation(animation_name):
|
if agent.anim_player and agent.anim_player.has_animation(animation_name):
|
||||||
var anim = agent.anim_player.get_animation(animation_name)
|
|
||||||
anim.loop_mode = Animation.LOOP_LINEAR
|
|
||||||
agent.anim_player.play(animation_name)
|
agent.anim_player.play(animation_name)
|
||||||
|
|
||||||
|
func _on_animation_finished(anim_name: StringName) -> void:
|
||||||
|
if animation_name == anim_name:
|
||||||
|
if wait_time > 0:
|
||||||
|
runtime_timer.start(wait_time)
|
||||||
|
else:
|
||||||
|
transitioned.emit(self, next_state_id)
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
transitioned.emit(self, next_state_id)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
[gd_scene format=3 uid="uid://dqvrhiqgkd3w1"]
|
[gd_scene format=3 uid="uid://dqvrhiqgkd3w1"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bnnuke5e7e1yr" path="res://core/ai/agents/human/ai_citizen_walker.tscn" id="1_a2xtd"]
|
[ext_resource type="PackedScene" uid="uid://bnnuke5e7e1yr" path="res://core/ai/agents/human/ai_citizen_walker.tscn" id="1_a2xtd"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ceqxsqfiotm5j" path="res://core/ai/agents/human/ai_farmer.tscn" id="2_n3ssi"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bbseno7clbepx" path="res://core/ai/agents/human/ai_citizen_sitter.tscn" id="3_fdj8t"]
|
||||||
|
|
||||||
[sub_resource type="NavigationMesh" id="NavigationMesh_optuv"]
|
[sub_resource type="NavigationMesh" id="NavigationMesh_optuv"]
|
||||||
vertices = PackedVector3Array(10.984741, 0.25012434, -1.0140381, 11.234741, 0.25012434, 0.23596191, 19.484741, 0.25012434, 0.23596191, 19.484741, 0.25012434, -19.514038, 9.234741, 0.25012434, -1.0140381, -19.515259, 0.25012434, -19.514038, -19.515259, 0.25012434, -0.014038086, 8.984741, 0.25012434, -0.014038086, 10.984741, 0.25012434, 1.2359619, 19.484741, 0.25012434, 19.235962, 9.234741, 0.25012434, 1.2359619, -19.515259, 0.25012434, 19.235962)
|
vertices = PackedVector3Array(10.984741, 0.25012434, -1.0140381, 11.234741, 0.25012434, 0.23596191, 19.484741, 0.25012434, 0.23596191, 19.484741, 0.25012434, -19.514038, 9.234741, 0.25012434, -1.0140381, -19.515259, 0.25012434, -19.514038, -19.515259, 0.25012434, -0.014038086, 8.984741, 0.25012434, -0.014038086, 10.984741, 0.25012434, 1.2359619, 19.484741, 0.25012434, 19.235962, 9.234741, 0.25012434, 1.2359619, -19.515259, 0.25012434, 19.235962)
|
||||||
@@ -90,3 +92,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 1, -6)
|
|||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=1753000680]
|
[node name="Camera3D" type="Camera3D" parent="." unique_id=1753000680]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.42261824, 0.9063078, 0, -0.9063078, 0.42261824, 0, 18.361065, 15.377485)
|
transform = Transform3D(1, 0, 0, 0, 0.42261824, 0.9063078, 0, -0.9063078, 0.42261824, 0, 18.361065, 15.377485)
|
||||||
|
|
||||||
|
[node name="AiFarmer" parent="." unique_id=1839077075 instance=ExtResource("2_n3ssi")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2447205, 0.94226265, 2.9251099)
|
||||||
|
|
||||||
|
[node name="AiCitizenSitter" parent="." unique_id=127569260 instance=ExtResource("3_fdj8t")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.074956, 1.3552468, 11.883549)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ config/icon="uid://bfar1kk3pgq8f"
|
|||||||
|
|
||||||
UIEvents="*uid://dehu28iq27mbn"
|
UIEvents="*uid://dehu28iq27mbn"
|
||||||
GameState="*uid://b17g2w2g101o6"
|
GameState="*uid://b17g2w2g101o6"
|
||||||
CollectionManager="*uid://c3kq1qddpm8tf"
|
CollectionManager="*uid://22orqdm34hfm"
|
||||||
AudioManager="*uid://dcttbbavtwtsg"
|
AudioManager="*uid://dcttbbavtwtsg"
|
||||||
SceneManager="*uid://bw8hwkw55j675"
|
SceneManager="*uid://bw8hwkw55j675"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user