Compare commits
104 Commits
rev_ffabbr
...
polish8
| Author | SHA1 | Date | |
|---|---|---|---|
| 77df5fbbfd | |||
|
|
ed5eb706a1 | ||
|
|
58f9188794 | ||
|
|
b463f55f53 | ||
| c0a68da7d1 | |||
| 97bbca95e8 | |||
|
|
ed25b40969 | ||
| 2b1370bd40 | |||
| d09a975578 | |||
| c77d227f33 | |||
| aad14ab242 | |||
| 298e6cd229 | |||
| efb7a78cf1 | |||
| 5dd8f8092c | |||
| 5c807d7b69 | |||
| b602e3b521 | |||
| 9579f26a63 | |||
| 326d32c946 | |||
| d80aa93bb9 | |||
| f049c538bd | |||
| 2fa562d5d2 | |||
| f962bcef42 | |||
| 83fd257484 | |||
| cd3a40287c | |||
| f97af73de6 | |||
| 0e02f31d6e | |||
| ed82078628 | |||
| 584579afb8 | |||
| 243f89d9d2 | |||
| afbda265b6 | |||
| 97a8ce3f9c | |||
| 47a2bf5a2e | |||
| fdfe2336f8 | |||
| 0c44b420d1 | |||
| dcf5d28248 | |||
| 50ea1d8bbd | |||
| c08007c446 | |||
| eedd303faa | |||
| 55aea7bdc4 | |||
| 6cb5104729 | |||
| 7f7f9d6ae3 | |||
| 05b01f70cc | |||
| b059a2ef1d | |||
| d823cf4554 | |||
|
|
e061eb7275 | ||
| 64a9efcbc3 | |||
| ee8d6458ed | |||
| fcab02469a | |||
| 0e56a84a95 | |||
| 22877bffbe | |||
| b4a2bb6144 | |||
| 90b9739ee0 | |||
| 43556ac110 | |||
| 7ea515c824 | |||
| 4658250206 | |||
| c25e3bb4f6 | |||
|
|
c796ea289d | ||
|
|
a18dc64a4f | ||
| c52b11388a | |||
| ce8a977541 | |||
| 8ceb6cb16b | |||
| bcf854fd74 | |||
| 10b437d236 | |||
| 9c41da14a6 | |||
| 2aa7d1f7d4 | |||
| 040ded5f0b | |||
| ddec91d515 | |||
| d8efa735dd | |||
|
|
9bc7f38d07 | ||
|
|
f4c8775a45 | ||
| 70d3dfe15c | |||
|
|
9827b98b3e | ||
|
|
977e8012aa | ||
| 72d06560b1 | |||
| 9d62d97422 | |||
| c1e99a3b8e | |||
| 8e1ba915a2 | |||
|
|
577b4570da | ||
| 36dff9c070 | |||
| 56591bb907 | |||
| 9f254d9725 | |||
| abae8434fc | |||
|
|
e211f89fca | ||
| 3c7cbdc662 | |||
| 8c7f1c3c82 | |||
| b7308c5d66 | |||
|
|
d709d9236c | ||
|
|
9ee6d08918 | ||
| ff93a7ab2c | |||
| 122ec189eb | |||
| 889334e7a3 | |||
|
|
3521839ed9 | ||
|
|
6a62f92ed5 | ||
|
|
ead4e557c4 | ||
|
|
b868584b78 | ||
| d668804038 | |||
| e8f2c4db84 | |||
| 72c933ba73 | |||
| 8f02afa796 | |||
| 211455f5da | |||
| ab87c7f478 | |||
| b95e8598b2 | |||
|
|
5ddf363368 | ||
| fda8188102 |
13
.idea/.gitignore
generated
vendored
Normal file
13
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/contentModel.xml
|
||||
/modules.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.tgcc.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
.idea/indexLayout.xml
generated
Normal file
8
.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
1097
addons/TweenFX/TweenFX.gd
Normal file
1097
addons/TweenFX/TweenFX.gd
Normal file
File diff suppressed because it is too large
Load Diff
1
addons/TweenFX/TweenFX.gd.uid
Normal file
1
addons/TweenFX/TweenFX.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d2n10rw2dnx8o
|
||||
43
addons/TweenFX/TweenManager.gd
Normal file
43
addons/TweenFX/TweenManager.gd
Normal file
@@ -0,0 +1,43 @@
|
||||
## Internal tracking system for TweenFX.
|
||||
## [br][br]
|
||||
## Manages active tweens per node, handles cleanup when nodes are freed,
|
||||
## and provides stop/query methods. Not intended for direct use —
|
||||
## access through [TweenFX] instead.
|
||||
|
||||
static var _active: Dictionary = {} # { node: { TweenFX.Animations.X: tween } }
|
||||
|
||||
static func track(node: CanvasItem, anim: TweenFX.Animations, tween: Tween) -> void:
|
||||
if not _active.has(node):
|
||||
_active[node] = {}
|
||||
if not node.tree_exiting.is_connected(_on_node_exiting):
|
||||
node.tree_exiting.connect(_on_node_exiting.bind(node), CONNECT_ONE_SHOT)
|
||||
_active[node][anim] = tween
|
||||
tween.finished.connect(_on_tween_finished.bind(node, anim), CONNECT_ONE_SHOT)
|
||||
|
||||
static func stop(node: CanvasItem, anim: TweenFX.Animations) -> void:
|
||||
if not _active.has(node) or not _active[node].has(anim):
|
||||
return
|
||||
_active[node][anim].kill()
|
||||
_active[node].erase(anim)
|
||||
if _active[node].is_empty():
|
||||
_active.erase(node)
|
||||
|
||||
static func stop_all(node: CanvasItem) -> void:
|
||||
if not _active.has(node):
|
||||
return
|
||||
for tween in _active[node].values():
|
||||
tween.kill()
|
||||
_active.erase(node)
|
||||
|
||||
static func is_playing(node: CanvasItem, anim: TweenFX.Animations) -> bool:
|
||||
return _active.has(node) and _active[node].has(anim)
|
||||
|
||||
static func _on_tween_finished(node: CanvasItem, anim: TweenFX.Animations) -> void:
|
||||
if not _active.has(node):
|
||||
return
|
||||
_active[node].erase(anim)
|
||||
if _active[node].is_empty():
|
||||
_active.erase(node)
|
||||
|
||||
static func _on_node_exiting(node: CanvasItem) -> void:
|
||||
_active.erase(node)
|
||||
1
addons/TweenFX/TweenManager.gd.uid
Normal file
1
addons/TweenFX/TweenManager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bc8i1qm1d8hrv
|
||||
BIN
addons/TweenFX/icon.png
Normal file
BIN
addons/TweenFX/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
40
addons/TweenFX/icon.png.import
Normal file
40
addons/TweenFX/icon.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://chf2ss61jydw3"
|
||||
path="res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/TweenFX/icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
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
|
||||
7
addons/TweenFX/plugin.cfg
Normal file
7
addons/TweenFX/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
name="TweenFX"+
|
||||
icon="res://addons/TweenFX/icon.png"
|
||||
description= "A simple, juicy tween animation library for Godot"
|
||||
author="EvilBunnyMan"
|
||||
version="1.2"
|
||||
script="plugin.gd"
|
||||
10
addons/TweenFX/plugin.gd
Normal file
10
addons/TweenFX/plugin.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
func _enable_plugin():
|
||||
add_autoload_singleton("TweenFX", "res://addons/TweenFX/TweenFX.gd")
|
||||
print("[TweenFX] Enabled")
|
||||
|
||||
func _disable_plugin():
|
||||
remove_autoload_singleton("TweenFX")
|
||||
print("[TweenFX] Disabled")
|
||||
1
addons/TweenFX/plugin.gd.uid
Normal file
1
addons/TweenFX/plugin.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://wu3r36bvv8u
|
||||
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/androidarm64/libsteam_api.so
Normal file
BIN
addons/godotsteam/androidarm64/libsteam_api.so
Normal file
Binary file not shown.
8
addons/godotsteam/editor/steamworks_panel.gd
Normal file
8
addons/godotsteam/editor/steamworks_panel.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
@onready var container_frame: VBoxContainer = %ContainerFrame
|
||||
|
||||
|
||||
func add_companion_dock(companion_dock: Control) -> void:
|
||||
container_frame.add_child(companion_dock)
|
||||
1
addons/godotsteam/editor/steamworks_panel.gd.uid
Normal file
1
addons/godotsteam/editor/steamworks_panel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://1oo0gvamoxgp
|
||||
125
addons/godotsteam/editor/steamworks_panel.tscn
Normal file
125
addons/godotsteam/editor/steamworks_panel.tscn
Normal file
@@ -0,0 +1,125 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cyniebd6yahu5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://1oo0gvamoxgp" path="res://addons/godotsteam/editor/steamworks_panel.gd" id="1_qn6cd"]
|
||||
[ext_resource type="Script" uid="uid://b4nvgu7h84u53" path="res://addons/godotsteam/editor/updates/updates.gd" id="2_qn6cd"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qn6cd"]
|
||||
content_margin_top = 2.0
|
||||
content_margin_bottom = 2.0
|
||||
bg_color = Color(0.0980392, 0.0980392, 0.0980392, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qf1vo"]
|
||||
content_margin_top = 2.0
|
||||
content_margin_bottom = 2.0
|
||||
bg_color = Color(0.337255, 0.619608, 1, 1)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_sqmbs"]
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_qn6cd")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_qf1vo")
|
||||
|
||||
[node name="Steamworks" type="Control"]
|
||||
process_mode = 3
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_qn6cd")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Scroller" type="ScrollContainer" parent="."]
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="DockFrame" type="TabContainer" parent="Scroller"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
current_tab = 0
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Updates" type="MarginContainer" parent="Scroller/DockFrame"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
script = ExtResource("2_qn6cd")
|
||||
metadata/_tab_index = 0
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="ContainerFrame" type="VBoxContainer" parent="Scroller/DockFrame/Updates"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="HFrame" type="HBoxContainer" parent="Scroller/DockFrame/Updates/ContainerFrame"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 25
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Type" type="Label" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame"]
|
||||
custom_minimum_size = Vector2(125, 25)
|
||||
layout_mode = 2
|
||||
text = "GodotSteam"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="InstalledLabel" type="Label" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Installed version 4.18"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="UpdateLabel" type="Label" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Updating" type="HBoxContainer" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
theme_override_constants/separation = 25
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Downloading" type="ProgressBar" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame/Updating"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(200, 30)
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_sqmbs")
|
||||
step = 1.0
|
||||
rounded = true
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="InstallButton" type="Button" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame/Updating"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Install"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="UpdateButton" type="Button" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame/Updating"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
disabled = true
|
||||
text = "Up-to-date"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="CancelButton" type="Button" parent="Scroller/DockFrame/Updates/ContainerFrame/HFrame/Updating"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Cancel"
|
||||
metadata/_edit_lock_ = true
|
||||
1
addons/godotsteam/editor/ui/steam.svg
Normal file
1
addons/godotsteam/editor/ui/steam.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,256,256" width="50px" height="50px" fill-rule="nonzero"><g fill="#ffffff" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><g transform="scale(5.12,5.12)"><path d="M25,3c-11.41,0 -20.79062,8.68078 -21.89062,19.80078l11.19141,5.72852c1.13,-0.95 2.59922,-1.5293 4.19922,-1.5293h0.05078c0.39,-0.6 0.83859,-1.35086 1.30859,-2.13086c0.98,-1.61 2.08016,-3.43008 3.16016,-4.83008c0.24,-4.47 3.95047,-8.03906 8.48047,-8.03906c4.69,0 8.5,3.81 8.5,8.5c0,4.53 -3.56906,8.24047 -8.03906,8.48047c-1.4,1.08 -3.21008,2.18039 -4.83008,3.15039c-0.78,0.48 -1.53086,0.92836 -2.13086,1.31836v0.05078c0,3.59 -2.91,6.5 -6.5,6.5c-3.59,0 -6.5,-2.91 -6.5,-6.5c0,-0.17 0.00953,-0.33 0.01953,-0.5l-8.74023,-4.48047c1.69,10.48 10.7707,18.48047 21.7207,18.48047c12.15,0 22,-9.85 22,-22c0,-12.15 -9.85,-22 -22,-22zM31.5,14c-3.58,0 -6.5,2.92 -6.5,6.5c0,3.58 2.92,6.5 6.5,6.5c3.58,0 6.5,-2.92 6.5,-6.5c0,-3.58 -2.92,-6.5 -6.5,-6.5zM31.5,16c2.49,0 4.5,2.01 4.5,4.5c0,2.49 -2.01,4.5 -4.5,4.5c-2.49,0 -4.5,-2.01 -4.5,-4.5c0,-2.49 2.01,-4.5 4.5,-4.5zM18.5,29c-0.79,0 -1.53969,0.20031 -2.17969,0.57031l3.32031,1.69922c1.23,0.63 1.70984,2.14109 1.08984,3.37109c-0.45,0.86 -1.32047,1.35938 -2.23047,1.35938c-0.39,0 -0.77062,-0.08953 -1.14062,-0.26953l-3.33008,-1.71094c0.26,2.24 2.1607,3.98047 4.4707,3.98047c2.49,0 4.5,-2.01 4.5,-4.5c0,-2.49 -2.01,-4.5 -4.5,-4.5z"></path></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
43
addons/godotsteam/editor/ui/steam.svg.import
Normal file
43
addons/godotsteam/editor/ui/steam.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dhn3vkdxvetbn"
|
||||
path="res://.godot/imported/steam.svg-1c1b1c87b286630e8735047e7af015ac.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/godotsteam/editor/ui/steam.svg"
|
||||
dest_files=["res://.godot/imported/steam.svg-1c1b1c87b286630e8735047e7af015ac.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
59
addons/godotsteam/editor/updates/confirmation.gd
Normal file
59
addons/godotsteam/editor/updates/confirmation.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
@tool
|
||||
extends ConfirmationDialog
|
||||
|
||||
signal cancel_update
|
||||
signal continue_update
|
||||
|
||||
@onready var cancel_button: Button = %Cancel
|
||||
@onready var continue_button: Button = %Continue
|
||||
@onready var downloading: ProgressBar = %Downloading
|
||||
@onready var message: Label = %Message
|
||||
@onready var version_title: Label = %VersionTitle
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
connect_signals()
|
||||
set_defaults()
|
||||
|
||||
|
||||
#region Setup
|
||||
func set_defaults() -> void:
|
||||
size = Vector2(450, 330)
|
||||
get_ok_button().visible = false
|
||||
get_cancel_button().visible = false
|
||||
#endregion
|
||||
|
||||
|
||||
#region Signals
|
||||
func connect_signals() -> void:
|
||||
cancel_button.pressed.connect(_on_cancel_pressed)
|
||||
continue_button.pressed.connect(_on_continue_pressed)
|
||||
|
||||
|
||||
func _on_cancel_pressed() -> void:
|
||||
cancel_update.emit()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_continue_pressed() -> void:
|
||||
continue_update.emit()
|
||||
#endregion
|
||||
|
||||
|
||||
#region Updating text
|
||||
func update_interface(version_string: String, is_downloader: bool) -> void:
|
||||
if not is_node_ready(): await ready
|
||||
cancel_button.visible = true
|
||||
continue_button.visible = not is_downloader
|
||||
downloading.visible = is_downloader
|
||||
if is_downloader:
|
||||
message.text = "You are downloading the update, please wait. Closing this window will cancel the update."
|
||||
version_title.text = "Downloading GodotSteam %s" % version_string
|
||||
else:
|
||||
message.text = "You are about to update plug-in version to %s. The editor will restart at the end of this process." % version_string
|
||||
version_title.text = "Update To GodotSteam %s" % version_string
|
||||
|
||||
|
||||
func update_progress(new_percentage: int) -> void:
|
||||
downloading.value = new_percentage
|
||||
#endregion
|
||||
1
addons/godotsteam/editor/updates/confirmation.gd.uid
Normal file
1
addons/godotsteam/editor/updates/confirmation.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bjb747gou4fbo
|
||||
174
addons/godotsteam/editor/updates/confirmation.tscn
Normal file
174
addons/godotsteam/editor/updates/confirmation.tscn
Normal file
@@ -0,0 +1,174 @@
|
||||
[gd_scene format=3 uid="uid://bb6pyk4s77qvo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjb747gou4fbo" path="res://addons/godotsteam/editor/updates/confirmation.gd" id="1_fskym"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhn3vkdxvetbn" path="res://addons/godotsteam/editor/ui/steam.svg" id="1_xklt4"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cnr4s"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jjufo"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_fskym"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0ql43"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0.3372549, 0.61960787, 1, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_apu4b"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0.09803922, 0.09803922, 0.09803922, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bi3ss"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cnr4s"]
|
||||
content_margin_top = 2.0
|
||||
content_margin_bottom = 2.0
|
||||
bg_color = Color(0.09803922, 0.09803922, 0.09803922, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jjufo"]
|
||||
content_margin_top = 2.0
|
||||
content_margin_bottom = 2.0
|
||||
bg_color = Color(0.3372549, 0.61960787, 1, 1)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_cnr4s"]
|
||||
AcceptDialog/constants/title_height = 0
|
||||
AcceptDialog/styles/embedded_border = SubResource("StyleBoxEmpty_cnr4s")
|
||||
AcceptDialog/styles/embedded_unfocused_border = SubResource("StyleBoxEmpty_jjufo")
|
||||
AcceptDialog/styles/panel = SubResource("StyleBoxEmpty_fskym")
|
||||
Button/colors/font_color = Color(1, 1, 1, 1)
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_0ql43")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_apu4b")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_bi3ss")
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_cnr4s")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_jjufo")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fskym"]
|
||||
bg_color = Color(0.15686275, 0.15686275, 0.15686275, 1)
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.3372549, 0.61960787, 1, 1)
|
||||
|
||||
[node name="Confirmation" type="ConfirmationDialog" unique_id=1649782113]
|
||||
transparent_bg = true
|
||||
oversampling_override = 1.0
|
||||
title = "Updating GodotSteam"
|
||||
initial_position = 1
|
||||
size = Vector2i(450, 330)
|
||||
visible = true
|
||||
wrap_controls = false
|
||||
unresizable = true
|
||||
borderless = true
|
||||
min_size = Vector2i(450, 200)
|
||||
keep_title_visible = false
|
||||
content_scale_mode = 1
|
||||
theme = SubResource("Theme_cnr4s")
|
||||
ok_button_text = "Continue"
|
||||
dialog_hide_on_ok = false
|
||||
dialog_close_on_escape = false
|
||||
script = ExtResource("1_fskym")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Panel" type="Panel" parent="." unique_id=336687509]
|
||||
custom_minimum_size = Vector2(450, 330)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -225.0
|
||||
offset_top = -165.0
|
||||
offset_right = 225.0
|
||||
offset_bottom = 165.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_fskym")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Margin" type="MarginContainer" parent="Panel" unique_id=598549467]
|
||||
custom_minimum_size = Vector2(450, 330)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 50
|
||||
theme_override_constants/margin_top = 50
|
||||
theme_override_constants/margin_right = 50
|
||||
theme_override_constants/margin_bottom = 50
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="VFrame" type="VBoxContainer" parent="Panel/Margin" unique_id=7442794]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="HFrame" type="HBoxContainer" parent="Panel/Margin/VFrame" unique_id=1314013334]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="Panel/Margin/VFrame/HFrame" unique_id=521288466]
|
||||
custom_minimum_size = Vector2(26, 30)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_xklt4")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="VersionTitle" type="Label" parent="Panel/Margin/VFrame/HFrame" unique_id=906249057]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(275, 30)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
theme_override_constants/outline_size = 1
|
||||
theme_override_font_sizes/font_size = 18
|
||||
text = "Downloading GodotSteam 99.99"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Message" type="Label" parent="Panel/Margin/VFrame" unique_id=345793881]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(315, 85)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "You are about to update plug-in version to %s. The editor will restart at the end of this process."
|
||||
autowrap_mode = 3
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Downloading" type="ProgressBar" parent="Panel/Margin/VFrame" unique_id=1922739661]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 30)
|
||||
layout_mode = 2
|
||||
step = 1.0
|
||||
value = 50.0
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Options" type="HBoxContainer" parent="Panel/Margin/VFrame" unique_id=2126576529]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
theme_override_constants/separation = 15
|
||||
alignment = 2
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Continue" type="Button" parent="Panel/Margin/VFrame/Options" unique_id=851000998]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Continue"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Cancel" type="Button" parent="Panel/Margin/VFrame/Options" unique_id=1895267580]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Cancel"
|
||||
metadata/_edit_lock_ = true
|
||||
186
addons/godotsteam/editor/updates/updates.gd
Normal file
186
addons/godotsteam/editor/updates/updates.gd
Normal file
@@ -0,0 +1,186 @@
|
||||
@tool
|
||||
extends MarginContainer
|
||||
###
|
||||
# Super-huge thanks to Nathan Hoad and Marcus Skov for ideas and inspiration on how to create a
|
||||
# plug-in updater.
|
||||
###
|
||||
|
||||
const TEMP_FILE = "user://update.zip"
|
||||
const VERSION_URL: StringName = "https://godotengine.org/asset-library/api/asset/2445"
|
||||
|
||||
var download_location: String = ""
|
||||
var downloading_update: bool = false
|
||||
# This will act as both our version checker and update downloader
|
||||
var http_request: HTTPRequest = null
|
||||
var is_actively_downloading: bool = false
|
||||
var new_version: String = ""
|
||||
|
||||
@onready var cancel_button: Button = %CancelButton
|
||||
@onready var downloading: ProgressBar = %Downloading
|
||||
@onready var install_button: Button = %InstallButton
|
||||
@onready var installed_label: Label = %InstalledLabel
|
||||
@onready var update_label: Label = %UpdateLabel
|
||||
@onready var update_button: Button = %UpdateButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
connect_signals()
|
||||
set_defaults()
|
||||
check_for_updates()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if is_actively_downloading:
|
||||
downloading.value = http_request.get_downloaded_bytes() * 100 / http_request.get_body_size()
|
||||
|
||||
|
||||
#region Setup
|
||||
func set_defaults() -> void:
|
||||
downloading.value = 0
|
||||
installed_label.text = "Installed version %s" % Steam.get_godotsteam_version()
|
||||
update_button.text = "Up-to-date"
|
||||
update_button.disabled = true
|
||||
update_label.text = ""
|
||||
updating_visibility(false, false, false, true)
|
||||
#endregion
|
||||
|
||||
|
||||
#region Signals
|
||||
func connect_signals() -> void:
|
||||
cancel_button.pressed.connect(_on_cancel_pressed)
|
||||
install_button.pressed.connect(_on_install_pressed)
|
||||
update_button.pressed.connect(_on_update_pressed)
|
||||
#endregion
|
||||
|
||||
|
||||
#region Checking for updates
|
||||
func check_for_updates() -> void:
|
||||
if not ProjectSettings.get_setting("steam/updates/godotsteam/check_for_updates"):
|
||||
return
|
||||
|
||||
http_request = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
http_request.request_completed.connect(_on_http_request_completed)
|
||||
if http_request.request(VERSION_URL) != OK:
|
||||
printerr("Failed to request GodotSteam plug-in remote current version")
|
||||
|
||||
|
||||
func _on_http_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
http_request.request_completed.disconnect(_on_http_request_completed)
|
||||
http_request.queue_free()
|
||||
|
||||
if result != HTTPRequest.RESULT_SUCCESS:
|
||||
return
|
||||
var response = JSON.parse_string(body.get_string_from_utf8())
|
||||
if response == null:
|
||||
return
|
||||
|
||||
download_location = response.download_url
|
||||
new_version = response.version_string
|
||||
|
||||
if convert_version(new_version) > convert_version(Steam.get_godotsteam_version()):
|
||||
print("New GodotSteam version %s available" % new_version)
|
||||
update_label.text = "New version %s" % new_version
|
||||
update_button.text = "Download"
|
||||
update_button.disabled = false
|
||||
#endregion
|
||||
|
||||
|
||||
#region Updating versions
|
||||
func _on_cancel_pressed() -> void:
|
||||
updating_visibility(false, false, false, true)
|
||||
|
||||
if is_actively_downloading:
|
||||
http_request.cancel_request()
|
||||
http_request.queue_free()
|
||||
is_actively_downloading = false
|
||||
update_label.text = "Canceling %s plug-in update download" % new_version
|
||||
else:
|
||||
DirAccess.remove_absolute(TEMP_FILE)
|
||||
update_label.text = "Canceling %s plug-in update and deleting temporary files" % new_version
|
||||
|
||||
update_button.text = "Download"
|
||||
update_button.disabled = false
|
||||
update_label.text = "New version %s" % new_version
|
||||
|
||||
|
||||
func _on_install_pressed() -> void:
|
||||
print("Removing older GodotSteam %s plug-in" % Steam.get_godotsteam_version())
|
||||
OS.move_to_trash(ProjectSettings.globalize_path("res://addons/godotsteam"))
|
||||
|
||||
update_button.text = "Unpacking"
|
||||
print("Unpacking new %s plug-in" % new_version)
|
||||
var zip_reader: ZIPReader = ZIPReader.new()
|
||||
zip_reader.open(TEMP_FILE)
|
||||
var files: PackedStringArray = zip_reader.get_files()
|
||||
|
||||
var base_path := files[1]
|
||||
# Remove archive folder
|
||||
files.remove_at(0)
|
||||
# Remove assets folder
|
||||
files.remove_at(0)
|
||||
|
||||
for path in files:
|
||||
var new_file_path: String = path.replace(base_path, "")
|
||||
if path.ends_with("/"):
|
||||
DirAccess.make_dir_recursive_absolute("res://addons/%s" % new_file_path)
|
||||
else:
|
||||
var file: FileAccess = FileAccess.open("res://addons/%s" % new_file_path, FileAccess.WRITE)
|
||||
file.store_buffer(zip_reader.read_file(path))
|
||||
|
||||
zip_reader.close()
|
||||
restart_post_update()
|
||||
|
||||
|
||||
func _on_update_pressed() -> void:
|
||||
is_actively_downloading = true
|
||||
update_label.text = "Downloading %s plug-in update, please wait" % new_version
|
||||
updating_visibility(true, true, false, false)
|
||||
|
||||
http_request = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
http_request.request_completed.connect(_on_download_request_completed)
|
||||
if http_request.request(download_location) != OK:
|
||||
printerr("Failed to request %s plug-in update download" % new_version)
|
||||
is_actively_downloading = false
|
||||
update_button.text = "Failed"
|
||||
update_button.disabled = false
|
||||
return
|
||||
|
||||
|
||||
func _on_download_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
http_request.request_completed.disconnect(_on_download_request_completed)
|
||||
http_request.queue_free()
|
||||
is_actively_downloading = false
|
||||
updating_visibility(true, false, true, false)
|
||||
|
||||
if result != HTTPRequest.RESULT_SUCCESS:
|
||||
printerr("Failed to download new GodotSteam version %s" % result)
|
||||
update_button.disabled = false
|
||||
return
|
||||
|
||||
update_label.text = "Update downloaded, ready to install %s" % new_version
|
||||
var zip_file: FileAccess = FileAccess.open(TEMP_FILE, FileAccess.WRITE)
|
||||
zip_file.store_buffer(body)
|
||||
zip_file.close()
|
||||
|
||||
|
||||
func restart_post_update() -> void:
|
||||
update_button.text = "Restarting"
|
||||
update_label.text = "Updated to version %s, restarting the editor" % new_version
|
||||
DirAccess.remove_absolute(TEMP_FILE)
|
||||
EditorInterface.restart_editor(true)
|
||||
#endregion
|
||||
|
||||
|
||||
#region Helpers
|
||||
func convert_version(version_string: String) -> int:
|
||||
return int(version_string.replace(".", "").rpad(4, "0"))
|
||||
|
||||
|
||||
func updating_visibility(cancel: bool, download: bool, install: bool, update: bool) -> void:
|
||||
cancel_button.visible = cancel
|
||||
downloading.visible = download
|
||||
install_button.visible = install
|
||||
update_button.visible = update
|
||||
#endregion
|
||||
1
addons/godotsteam/editor/updates/updates.gd.uid
Normal file
1
addons/godotsteam/editor/updates/updates.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b4nvgu7h84u53
|
||||
29
addons/godotsteam/godotsteam.gdextension
Normal file
29
addons/godotsteam/godotsteam.gdextension
Normal file
@@ -0,0 +1,29 @@
|
||||
[configuration]
|
||||
entry_symbol = "godotsteam_init"
|
||||
compatibility_minimum = "4.4"
|
||||
|
||||
[libraries]
|
||||
android.debug.arm64 = "res://addons/godotsteam/androidarm64/libgodotsteam.android.template_debug.arm64.so"
|
||||
android.release.arm64 = "res://addons/godotsteam/androidarm64/libgodotsteam.android.template_release.arm64.so"
|
||||
linux.debug.arm64 = "res://addons/godotsteam/linuxarm64/libgodotsteam.linux.template_debug.arm64.so"
|
||||
linux.debug.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_debug.x86_64.so"
|
||||
linux.debug.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_debug.x86_32.so"
|
||||
linux.release.arm64 = "res://addons/godotsteam/linuxarm64/libgodotsteam.linux.template_release.arm64.so"
|
||||
linux.release.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_release.x86_64.so"
|
||||
linux.release.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_release.x86_32.so"
|
||||
macos.debug = "res://addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib"
|
||||
macos.release = "res://addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib"
|
||||
windows.debug.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_debug.x86_64.dll"
|
||||
windows.debug.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_debug.x86_32.dll"
|
||||
windows.release.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_release.x86_64.dll"
|
||||
windows.release.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_release.x86_32.dll"
|
||||
|
||||
[dependencies]
|
||||
android.arm64 = { "res://addons/godotsteam/androidarm64/libsteam_api.so": "" }
|
||||
linux.arm64 = { "res://addons/godotsteam/linuxarm64/libsteam_api.so": "" }
|
||||
linux.x86_64 = { "res://addons/godotsteam/linux64/libsteam_api.so": "" }
|
||||
linux.x86_32 = { "res://addons/godotsteam/linux32/libsteam_api.so": "" }
|
||||
macos.universal = { "res://addons/godotsteam/osx/libsteam_api.dylib": "" }
|
||||
windows.x86_64 = { "res://addons/godotsteam/win64/steam_api64.dll": "" }
|
||||
windows.x86_32 = { "res://addons/godotsteam/win32/steam_api.dll": "" }
|
||||
|
||||
1
addons/godotsteam/godotsteam.gdextension.uid
Normal file
1
addons/godotsteam/godotsteam.gdextension.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d4gadhvchsddo
|
||||
86
addons/godotsteam/godotsteam_plugin.gd
Normal file
86
addons/godotsteam/godotsteam_plugin.gd
Normal file
@@ -0,0 +1,86 @@
|
||||
@tool
|
||||
class_name GodotSteamPlugin
|
||||
extends EditorPlugin
|
||||
|
||||
const EDITOR_PANEL = preload("uid://cyniebd6yahu5")
|
||||
|
||||
static var dock_frame
|
||||
|
||||
var link_changelog: String = "[url=https://godotsteam.com/changelog/gdextension/]changelog[/url]"
|
||||
var link_website: String = "[url=https://godotsteam.com]website[/url]"
|
||||
var steamworks_dock: Control
|
||||
|
||||
|
||||
## Used specifically to add/remove additional dock content
|
||||
static func get_dock_frame() -> Control:
|
||||
return dock_frame
|
||||
|
||||
|
||||
func _enable_plugin() -> void:
|
||||
print("GodotSteam GDExtension updater functionality enabled")
|
||||
|
||||
|
||||
func _disable_plugin() -> void:
|
||||
print("GodotSteam GDEXtension updater functionality disabled")
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
print_rich("GodotSteam v%s | %s | %s" % [Steam.get_godotsteam_version(), link_website, link_changelog])
|
||||
add_project_settings()
|
||||
add_steamworks_dock()
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
remove_steamworks_dock()
|
||||
|
||||
|
||||
func _make_visible(visible) -> void:
|
||||
if steamworks_dock:
|
||||
steamworks_dock.set_visible(visible)
|
||||
|
||||
|
||||
#region Add and remove things
|
||||
func add_project_settings() -> void:
|
||||
# Used for the Updater looking for redist files and SteamCMD
|
||||
if not ProjectSettings.has_setting("steam/updates/godotsteam/check_for_updates"):
|
||||
ProjectSettings.set_setting("steam/updates/godotsteam/check_for_updates", true)
|
||||
ProjectSettings.add_property_info({
|
||||
"name": "steam/updates/godotsteam/check_for_updates",
|
||||
"type": TYPE_BOOL
|
||||
})
|
||||
ProjectSettings.set_initial_value("steam/updates/godotsteam/check_for_updates", true)
|
||||
ProjectSettings.set_as_basic("steam/updates/godotsteam/check_for_updates", true)
|
||||
# Which channel of updates to pull from
|
||||
# Sponsors repo should require the user to have access to that repository already
|
||||
# In theory, they can connect via SSH?
|
||||
if not ProjectSettings.has_setting("steam/updates/godotsteam/update_channel"):
|
||||
ProjectSettings.set_setting("steam/updates/godotsteam/update_channel", 0)
|
||||
ProjectSettings.add_property_info({
|
||||
"name": "steam/updates/godotsteam/update_channel",
|
||||
"type": TYPE_INT,
|
||||
"hint": PROPERTY_HINT_ENUM,
|
||||
"hint_string": "Community, Sponsors"
|
||||
})
|
||||
ProjectSettings.set_initial_value("steam/updates/godotsteam/update_channel", 0)
|
||||
ProjectSettings.set_as_basic("steam/updates/godotsteam/update_channel", true)
|
||||
|
||||
|
||||
func add_steamworks_dock() -> void:
|
||||
steamworks_dock = EDITOR_PANEL.instantiate()
|
||||
# This will be used when 4.4.x is deprecated
|
||||
#add_control_to_dock(DockSlot.DOCK_SLOT_BOTTOM, steamworks_dock)
|
||||
# This is deprecated as of 4.6; when it is removed then 4.4.x will be deprecated for GodotSteam
|
||||
add_control_to_bottom_panel(steamworks_dock, "Steamworks")
|
||||
dock_frame = steamworks_dock
|
||||
|
||||
|
||||
func remove_steamworks_dock() -> void:
|
||||
# This will be used when 4.4.x is deprecated
|
||||
#remove_control_from_docks(steamworks_dock)
|
||||
# This is deprecated as of 4.6; when it is removed then 4.4.x will be deprecated for GodotSteam
|
||||
remove_control_from_bottom_panel(steamworks_dock)
|
||||
# This may be causing crashes for some people and is unnecessary with the call above
|
||||
# steamworks_dock.queue_free()
|
||||
steamworks_dock = null
|
||||
dock_frame = null
|
||||
#endregion
|
||||
1
addons/godotsteam/godotsteam_plugin.gd.uid
Normal file
1
addons/godotsteam/godotsteam_plugin.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://btts11rgropcp
|
||||
23
addons/godotsteam/license.md
Normal file
23
addons/godotsteam/license.md
Normal file
@@ -0,0 +1,23 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-Current | GP Garcia, Chris Ridenour, and Contributors
|
||||
|
||||
View all contributors at https://godotsteam.com/contribute/contributors/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linux32/libsteam_api.so
Normal file
BIN
addons/godotsteam/linux32/libsteam_api.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linux64/libsteam_api.so
Normal file
BIN
addons/godotsteam/linux64/libsteam_api.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linuxarm64/libsteam_api.so
Normal file
BIN
addons/godotsteam/linuxarm64/libsteam_api.so
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib
Normal file
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib
Normal file
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libsteam_api.dylib
Normal file
BIN
addons/godotsteam/osx/libsteam_api.dylib
Normal file
Binary file not shown.
7
addons/godotsteam/plugin.cfg
Normal file
7
addons/godotsteam/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="GodotSteam GDExtension Updater"
|
||||
description="An updater for GodotSteam GDExtension. This is not required to use Steamworks functionality, just updating the plug-in."
|
||||
author="Gramps Garcia, GodotSteam"
|
||||
version="4.19.1"
|
||||
script="godotsteam_plugin.gd"
|
||||
95
addons/godotsteam/readme.md
Normal file
95
addons/godotsteam/readme.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# GodotSteam for GDExtension | Community Edition
|
||||
An ecosystem of tools for [Godot Engine](https://godotengine.org) and [Valve's Steam](https://store.steampowered.com). For the Windows, Linux, and Mac platforms.
|
||||
|
||||
|
||||
Additional Flavors
|
||||
---
|
||||
Standard Module | Standard Plug-ins | Server Module | Server Plug-ins | Examples
|
||||
--- | --- | --- | --- | ---
|
||||
[Godot 2.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot2) | [GDNative](https://codeberg.org/godotsteam/godotsteam/src/branch/gdnative) | [Server 3.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot3) | [GDNative](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdnative) | [Skillet](https://codeberg.org/godotsteam/skillet)
|
||||
[Godot 3.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot3) | [GDExtension](https://codeberg.org/godotsteam/godotsteam/src/branch/gdextension) | [Server 4.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot4) | [GDExtension](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdextension) | [Skillet UGC Editor](https://codeberg.org/godotsteam/skillet/src/branch/ugc_editor)
|
||||
[Godot 4.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot4) | --- | --- | --- | ---
|
||||
[MultiplayerPeer](https://codeberg.org/godotsteam/multiplayerpeer)| --- | --- | --- | ---
|
||||
|
||||
|
||||
Documentation
|
||||
---
|
||||
[Documentation is available here](https://godotsteam.com/). You can also check out the Search Help section inside Godot Engine. [To start, try checking out our tutorial on initializing Steam.](https://godotsteam.com/tutorials/initializing/) There are additional tutorials, with more in the works. You can also [check out additional Godot and Steam related videos, text, additional tools, plug-ins, etc. here.](https://godotsteam.com/resources/external/)
|
||||
|
||||
Feel free to chat with us about GodotSteam or ask for assistance on the [Stoat server](https://stt.gg/9DxQ3Dcd) or [IRC on Libera Chat](irc://irc.libera.chat/#godotsteam).
|
||||
|
||||
|
||||
Donate
|
||||
---
|
||||
Pull-requests are the best way to help the project out but you can also donate through [Github Sponsors](https://github.com/sponsors/Gramps) or [LiberaPay](https://liberapay.com/godotsteam/donate)! [You can read more about donor perks here.](https://godotsteam.com/contribute/donations/) [You can also view all our awesome donors here.](https://godotsteam.com/contribute/donors/)
|
||||
|
||||
|
||||
Current Build
|
||||
---
|
||||
You can [download pre-compiled versions of this repo here](https://codeberg.org/godotsteam/godotsteam/releases).
|
||||
|
||||
**Version 4.19.1 Changes**
|
||||
|
||||
- Changed: commented out possible issue with removing dock node
|
||||
- Fixed: in-editor docs error, thanks to ***evanwang0***
|
||||
|
||||
[You can read more change-logs here](https://godotsteam.com/changelog/gdextension/).
|
||||
|
||||
|
||||
Compatibility
|
||||
---
|
||||
While rare, sometimes Steamworks SDK updates will break compatilibity with older GodotSteam versions. Any compatability breaks are noted below. Newer API files (dll, so, dylib) _should_ still work for older versions.
|
||||
|
||||
Steamworks SDK Version | GodotSteam Version
|
||||
---|---
|
||||
1.63 or newer | 4.17
|
||||
1.62 | 4.14 or 4.16.2
|
||||
1.61 | 4.12 to 4.13
|
||||
1.60 | 4.6 to 4.11
|
||||
1.59 | 4.6 to 4.8
|
||||
1.58a or older | 4.5.4 or older
|
||||
|
||||
Versions of GodotSteam that have compatibility breaks introduced.
|
||||
|
||||
GodotSteam Version | Broken Compatibility
|
||||
---|---
|
||||
4.8 | Networking identity system removed, replaced with Steam IDs
|
||||
4.9 | sendMessages returns an Array
|
||||
4.11 | setLeaderboardDetailsMax removed
|
||||
4.13 | getItemDefinitionProperty return a dictionary, html_needs_paint key 'bgra' changed to 'rbga'
|
||||
4.14 | Removed first argument for stat request in steamInit and steamInitEx, steamInit returns intended bool value
|
||||
4.16 | Variety of small break points, refer to [4.16 changelog for details](https://godotsteam.com/changelog/godot4/#version-416)
|
||||
4.17 | Windows projects using Steam SDK 1.63 are meant to work with Proton 11 or Experimental on Linux / Steam Deck.
|
||||
4.19 | Lots of changes to Voice functions, refer to [4.19 changelog for details](https://godotsteam.com/changelog/godot4/#version-419)
|
||||
|
||||
|
||||
Known Issues
|
||||
---
|
||||
- GDExtension for 4.4 is **not** compatible with 4.3.x or lower. Please check the versions you are using.
|
||||
- Overlay will not work in the editor but will work in export projects when uploaded to Steam. This seems to a limitation with Vulkan currently.
|
||||
|
||||
|
||||
Quick How-To
|
||||
---
|
||||
For complete instructions on how to build the GDExtension version of GodotSteam, [please refer to our documentation's 'How-To GDExtension' section.](https://godotsteam.com/howto/gdextension/) It will have the most up-to-date information.
|
||||
|
||||
Alternatively, you can just [download the pre-compiled versions in our Releases section](https://codeberg.org/godotsteam/godotsteam/releases) or [from the Godot Asset Library](https://godotengine.org/asset-library/asset/2445) and skip compiling it yourself!
|
||||
|
||||
|
||||
Usage
|
||||
---
|
||||
Once the plug-in is added to your project, the Steam class should be available and ready to go. Enabling the plug-in in the ProjectSettings only affects the Steamworks dock and not the actual functionality.
|
||||
|
||||
Do not use the GDExtension version of GodotSteam with any of the module versions whether it be our pre-compiled versions or ones you compile. They are not compatible with each other.
|
||||
|
||||
When exporting with the GDExtension version, please use the normal Godot Engine templates instead of our GodotSteam templates or you will have a lot of issues.
|
||||
|
||||
|
||||
No LLM Policy / No "AI" Policy
|
||||
---
|
||||
No LLMs are allowed to be used for issues, patches, or pull-requests. They will be closed or rejected and the submitter may be blocked from future submissions.
|
||||
|
||||
|
||||
License
|
||||
---
|
||||
MIT license
|
||||
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/win32/steam_api.dll
Normal file
BIN
addons/godotsteam/win32/steam_api.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/win64/steam_api64.dll
Normal file
BIN
addons/godotsteam/win64/steam_api64.dll
Normal file
Binary file not shown.
76
core/ai/agents/base/ai_base.gd
Normal file
76
core/ai/agents/base/ai_base.gd
Normal file
@@ -0,0 +1,76 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
class_name AIBase
|
||||
|
||||
@export_group("Settings")
|
||||
@export var speed: float = 4.0
|
||||
@export_flags_3d_navigation var navigation_layers: int = 1
|
||||
var _enable_state_machine: bool = true
|
||||
@export var enable_state_machine: bool:
|
||||
set(value):
|
||||
_enable_state_machine = value
|
||||
toggle_enable_state_machine()
|
||||
get:
|
||||
return _enable_state_machine
|
||||
@export var anim_player: AnimationPlayer
|
||||
|
||||
@export_group("Entities")
|
||||
enum EntityType { FARMER, CITIZEN_WALKER, CITIZEN_SITTER, CAT, CROW, FOX, GOAT, RACOON, WAGYU }
|
||||
@export var entity_type: EntityType = EntityType.FARMER
|
||||
@export var entity_name: String = ""
|
||||
@export var allowed_biomes: Array[String] = []
|
||||
@export_range(0.0, 100.0, 0.1) var spawn_uniqueness: float = 1.0
|
||||
|
||||
@onready var patrol_radius_shape: CollisionShape3D = $%PatrolRadiusShape
|
||||
@onready var nav_agent: NavigationAgent3D = $%NavigationAgent3D
|
||||
@onready var state_machine: StateMachine = $%StateMachine
|
||||
|
||||
func _ready() -> void:
|
||||
randomize()
|
||||
if nav_agent:
|
||||
nav_agent.navigation_layers = navigation_layers
|
||||
toggle_enable_state_machine()
|
||||
|
||||
func toggle_enable_state_machine() -> void:
|
||||
if state_machine:
|
||||
state_machine.enable = _enable_state_machine
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !_enable_state_machine:
|
||||
return
|
||||
|
||||
state_machine.physics_process(delta)
|
||||
|
||||
if nav_agent.is_navigation_finished():
|
||||
velocity = Vector3.ZERO
|
||||
move_and_slide()
|
||||
return
|
||||
|
||||
var next_point = nav_agent.get_next_path_position()
|
||||
var direction = global_position.direction_to(next_point)
|
||||
|
||||
velocity.x = direction.x * speed
|
||||
velocity.z = direction.z * speed
|
||||
|
||||
if velocity.length_squared() > 0.1:
|
||||
var look_dir = Vector3(velocity.x, 0, velocity.z)
|
||||
var target_transform = global_transform.looking_at(global_position - look_dir, Vector3.UP)
|
||||
global_transform = global_transform.interpolate_with(target_transform, delta * 10.0)
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func navigate_to_random_point() -> void:
|
||||
var nav_map_rid = get_world_3d().get_navigation_map()
|
||||
var patrol_radius = patrol_radius_shape.shape.radius
|
||||
|
||||
for i in range(10):
|
||||
var target_point_in_space = global_position + Vector3(randf_range(-1, 1), 0, randf_range(-1, 1)).normalized() * randf_range(0, patrol_radius)
|
||||
var closest_valid_point = NavigationServer3D.map_get_closest_point(nav_map_rid, target_point_in_space)
|
||||
nav_agent.target_position = closest_valid_point
|
||||
|
||||
if nav_agent.is_target_reachable():
|
||||
return
|
||||
|
||||
# Fallback: if we can't find a reachable point (e.g. we drifted slightly off navmesh),
|
||||
# try to navigate to the closest navmesh point to our CURRENT position to get unstuck.
|
||||
nav_agent.target_position = NavigationServer3D.map_get_closest_point(nav_map_rid, global_position)
|
||||
1
core/ai/agents/base/ai_base.gd.uid
Normal file
1
core/ai/agents/base/ai_base.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b30p1yqojbbbk
|
||||
24
core/ai/agents/base/ai_base.tscn
Normal file
24
core/ai/agents/base/ai_base.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene format=3 uid="uid://clx701xdwelgx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b30p1yqojbbbk" path="res://core/ai/agents/base/ai_base.gd" id="1_4d1nn"]
|
||||
[ext_resource type="Script" uid="uid://ps3vlu2qvmop" path="res://core/ai/framework/state_machine.gd" id="2_q1hg3"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_lim44"]
|
||||
radius = 20.0
|
||||
|
||||
[node name="AiBase" type="CharacterBody3D" unique_id=1228675528]
|
||||
script = ExtResource("1_4d1nn")
|
||||
entity_name = "Humanoid"
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="." unique_id=1370024449]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." unique_id=1286404264]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_q1hg3")
|
||||
|
||||
[node name="PatrolRadiusShape" type="CollisionShape3D" parent="." unique_id=1379515938]
|
||||
unique_name_in_owner = true
|
||||
shape = SubResource("SphereShape3D_lim44")
|
||||
disabled = true
|
||||
debug_color = Color(1, 1, 0, 1)
|
||||
BIN
core/ai/agents/cat/Cat_rig.fbx
Normal file
BIN
core/ai/agents/cat/Cat_rig.fbx
Normal file
Binary file not shown.
4159
core/ai/agents/cat/Cat_rig.fbx.import
Normal file
4159
core/ai/agents/cat/Cat_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
38
core/ai/agents/cat/ai_cat.gd
Normal file
38
core/ai/agents/cat/ai_cat.gd
Normal file
@@ -0,0 +1,38 @@
|
||||
extends AIBase
|
||||
|
||||
class_name AICat
|
||||
|
||||
@export_group("Cat Colors")
|
||||
@export var mesh: MeshInstance3D
|
||||
@export var fur_colors: Array[Color] = []
|
||||
@export var eye_colors: Array[Color] = []
|
||||
|
||||
@export var fur_material_index: int = 0
|
||||
@export var eye_material_index: int = 1
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
_apply_random_color()
|
||||
|
||||
func _apply_random_color() -> void:
|
||||
if fur_colors.is_empty() or eye_colors.is_empty():
|
||||
return
|
||||
|
||||
if not mesh or not mesh.mesh:
|
||||
return
|
||||
|
||||
var max_index = min(fur_colors.size(), eye_colors.size())
|
||||
var random_idx = randi() % max_index
|
||||
|
||||
_override_material_color(mesh, fur_material_index, fur_colors[random_idx])
|
||||
_override_material_color(mesh, eye_material_index, eye_colors[random_idx])
|
||||
|
||||
func _override_material_color(mesh_node: MeshInstance3D, surface_idx: int, color: Color) -> void:
|
||||
if surface_idx < 0 or surface_idx >= mesh_node.mesh.get_surface_count():
|
||||
return
|
||||
|
||||
var mat = mesh_node.mesh.surface_get_material(surface_idx)
|
||||
if mat and mat is StandardMaterial3D:
|
||||
var new_mat = mat.duplicate() as StandardMaterial3D
|
||||
new_mat.albedo_color = color
|
||||
mesh_node.set_surface_override_material(surface_idx, new_mat)
|
||||
1
core/ai/agents/cat/ai_cat.gd.uid
Normal file
1
core/ai/agents/cat/ai_cat.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cx67xas1hxv3x
|
||||
122
core/ai/agents/cat/ai_cat.tscn
Normal file
122
core/ai/agents/cat/ai_cat.tscn
Normal file
@@ -0,0 +1,122 @@
|
||||
[gd_scene format=3 uid="uid://duppccreftg3v"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_85o24"]
|
||||
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_6mu8r"]
|
||||
[ext_resource type="Script" uid="uid://cx67xas1hxv3x" path="res://core/ai/agents/cat/ai_cat.gd" id="2_cat_script"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5rccx22gs6jt" path="res://core/ai/agents/cat/Cat_rig.fbx" id="2_rohxe"]
|
||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_0jm3k"]
|
||||
[ext_resource type="Script" uid="uid://dty1p02kqviwf" path="res://core/ai/framework/sit_state.gd" id="3_scd7t"]
|
||||
[ext_resource type="Shader" uid="uid://d0ch5ofrgf7y6" path="res://core/daynight/trunk_shader.gdshader" id="7_rxsfd"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1rb57"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("7_rxsfd")
|
||||
shader_parameter/albedo_color = Color(0.7389186, 0.53468716, 0.19165063, 1)
|
||||
shader_parameter/use_texture = true
|
||||
shader_parameter/uv_scale = Vector2(1, 1)
|
||||
shader_parameter/palette_shift_y = 0.0
|
||||
shader_parameter/gradient_start_y = 0.0
|
||||
shader_parameter/gradient_end_y = 10.0
|
||||
shader_parameter/light_steps = 3.0
|
||||
shader_parameter/step_softness = 0.1
|
||||
shader_parameter/shadow_color = Color(0.4, 0.4, 0.6, 1)
|
||||
shader_parameter/shadow_offset = 0.0
|
||||
shader_parameter/cast_shadow_strength = 0.6
|
||||
shader_parameter/use_ghibli_glint = true
|
||||
shader_parameter/glint_color = Color(1, 0.95, 0.85, 1)
|
||||
shader_parameter/glint_intensity = 1.0
|
||||
shader_parameter/glint_sharpness = 32.0
|
||||
shader_parameter/emission_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/emission_energy = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_42ie3"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("7_rxsfd")
|
||||
shader_parameter/albedo_color = Color(0.099985994, 0.09998601, 0.099985965, 1)
|
||||
shader_parameter/use_texture = true
|
||||
shader_parameter/uv_scale = Vector2(1, 1)
|
||||
shader_parameter/palette_shift_y = 0.0
|
||||
shader_parameter/gradient_start_y = 0.0
|
||||
shader_parameter/gradient_end_y = 10.0
|
||||
shader_parameter/light_steps = 3.0
|
||||
shader_parameter/step_softness = 0.1
|
||||
shader_parameter/shadow_color = Color(0.4, 0.4, 0.6, 1)
|
||||
shader_parameter/shadow_offset = 0.0
|
||||
shader_parameter/cast_shadow_strength = 0.6
|
||||
shader_parameter/use_ghibli_glint = true
|
||||
shader_parameter/glint_color = Color(1, 0.95, 0.85, 1)
|
||||
shader_parameter/glint_intensity = 1.0
|
||||
shader_parameter/glint_sharpness = 32.0
|
||||
shader_parameter/emission_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/emission_energy = 0.0
|
||||
|
||||
[node name="AiCat" unique_id=1228675528 node_paths=PackedStringArray("mesh", "anim_player") instance=ExtResource("1_85o24")]
|
||||
script = ExtResource("2_cat_script")
|
||||
mesh = NodePath("Cat_rig/Rig_Cat/Skeleton3D/Cat")
|
||||
fur_colors = Array[Color]([Color(0.8716863, 0.762116, 0.1809479, 1)])
|
||||
eye_colors = Array[Color]([Color(0.12955844, 0.12955847, 0.12955844, 1), Color(0.6901961, 0.3019608, 0.12156863, 1), Color(0.6830768, 0.6830776, 0.68307686, 1), Color(0.6273405, 0.15743047, 0, 1)])
|
||||
fur_material_index = 0
|
||||
eye_material_index = 1
|
||||
anim_player = NodePath("Cat_rig/AnimationPlayer")
|
||||
entity_type = 3
|
||||
entity_name = "Cat"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=1884542620]
|
||||
script = ExtResource("2_6mu8r")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
random_next_state_ids = Array[StringName]([&"patrol", &"sit"])
|
||||
animation_name = "Cat_Idle"
|
||||
|
||||
[node name="SitState" type="Node" parent="StateMachine" index="1" unique_id=860354787]
|
||||
script = ExtResource("3_scd7t")
|
||||
state_id = &"sit"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Cat_Sit"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="2" unique_id=1861645340]
|
||||
script = ExtResource("3_0jm3k")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Cat_Walk"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Cat_rig" parent="." index="3" unique_id=1332997618 instance=ExtResource("2_rohxe")]
|
||||
|
||||
[node name="Skeleton3D" parent="Cat_rig/Rig_Cat" parent_id_path=PackedInt32Array(1332997618, 1024066488) index="0" unique_id=1455145313]
|
||||
bones/1/position = Vector3(1.6719584e-08, 0.23547882, 0.34218493)
|
||||
bones/1/rotation = Quaternion(0.12769094, -0.6954821, -0.12769029, 0.69548184)
|
||||
bones/2/rotation = Quaternion(-1.5819447e-07, -1.9079575e-07, -0.5904159, 0.8070992)
|
||||
bones/3/position = Vector3(0.21655759, -1.1490099e-06, 4.6904738e-08)
|
||||
bones/3/rotation = Quaternion(4.4475364e-08, -1.16689236e-07, 0.042394996, 0.999101)
|
||||
bones/4/rotation = Quaternion(4.694551e-09, 1.2888964e-07, 0.30337927, 0.9528699)
|
||||
bones/7/rotation = Quaternion(9.573777e-09, -1.3302474e-07, -0.40028554, 0.9163905)
|
||||
bones/9/rotation = Quaternion(0.0005057682, -0.00040186392, -0.7732871, 0.63405573)
|
||||
bones/10/rotation = Quaternion(7.318899e-08, 1.07771655e-07, 0.23513123, 0.97196364)
|
||||
bones/11/rotation = Quaternion(-0.013215952, -0.0063107302, 0.33804607, 0.9410156)
|
||||
bones/13/rotation = Quaternion(-0.00018823319, 2.7849663e-05, -0.77314246, 0.6342325)
|
||||
bones/14/rotation = Quaternion(7.324482e-08, 1.0779509e-07, 0.23506226, 0.9719804)
|
||||
bones/15/rotation = Quaternion(0.01474526, 0.007664346, 0.33750835, 0.94117594)
|
||||
bones/17/rotation = Quaternion(0.06574773, -0.012684476, 0.9796892, 0.18901183)
|
||||
bones/18/rotation = Quaternion(-0.046865243, -0.04779876, -0.69851494, 0.7124576)
|
||||
bones/19/position = Vector3(0.18072681, -0.041122876, -4.2319297e-08)
|
||||
bones/19/rotation = Quaternion(-0.0051541063, -0.0666377, -0.080000654, 0.9945516)
|
||||
bones/21/rotation = Quaternion(1.2657155e-07, 4.030732e-07, 0.96184576, -0.27359232)
|
||||
bones/22/position = Vector3(0.0749221, -0.0072982265, -0.03856178)
|
||||
bones/22/rotation = Quaternion(-8.139895e-08, 1.15607975e-07, -0.47071916, 0.88228315)
|
||||
bones/23/position = Vector3(0.18089643, -0.000116025236, -0.011642921)
|
||||
bones/23/rotation = Quaternion(2.998039e-07, -1.6746765e-07, 0.5290288, 0.84860384)
|
||||
bones/26/position = Vector3(-0.03817617, 0.03956073, 0.04669925)
|
||||
bones/26/rotation = Quaternion(-3.380398e-05, -0.00016875651, 0.9618461, -0.27359122)
|
||||
bones/27/rotation = Quaternion(-8.140452e-08, 1.1560887e-07, -0.47071794, 0.8822838)
|
||||
bones/28/position = Vector3(0.18089616, -0.000116375166, 0.011642809)
|
||||
bones/28/rotation = Quaternion(4.5638826e-05, -8.8217595e-05, 0.5290293, 0.84860367)
|
||||
|
||||
[node name="Cat" parent="Cat_rig/Rig_Cat/Skeleton3D" index="0" unique_id=869144045]
|
||||
surface_material_override/0 = SubResource("ShaderMaterial_1rb57")
|
||||
surface_material_override/1 = SubResource("ShaderMaterial_42ie3")
|
||||
|
||||
[editable path="Cat_rig"]
|
||||
BIN
core/ai/agents/crow/Crow_rig.fbx
Normal file
BIN
core/ai/agents/crow/Crow_rig.fbx
Normal file
Binary file not shown.
4159
core/ai/agents/crow/Crow_rig.fbx.import
Normal file
4159
core/ai/agents/crow/Crow_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
29
core/ai/agents/crow/ai_crow.tscn
Normal file
29
core/ai/agents/crow/ai_crow.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene format=3 uid="uid://cxi6phs4fieli"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_tx3nx"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfdeepw5p5nb8" path="res://core/ai/agents/crow/Crow_rig.fbx" id="2_1pxwy"]
|
||||
[ext_resource type="Script" uid="uid://da5vhmxbxkdbc" path="res://core/ai/framework/wait_train_state.gd" id="3_wait"]
|
||||
[ext_resource type="Script" uid="uid://tys4fmqvneom" path="res://core/ai/framework/fly_away_state.gd" id="4_fly"]
|
||||
|
||||
[node name="AiCrow" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_tx3nx")]
|
||||
anim_player = NodePath("Crow_rig/AnimationPlayer")
|
||||
entity_type = 4
|
||||
entity_name = "Crow"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("WaitTrainState")
|
||||
|
||||
[node name="WaitTrainState" type="Node" parent="StateMachine" index="0" unique_id=1000000000]
|
||||
script = ExtResource("3_wait")
|
||||
fly_distance_threshold = 10.0
|
||||
state_id = &"wait"
|
||||
next_state_id = &"fly"
|
||||
animation_name = "Idle_Crow"
|
||||
|
||||
[node name="FlyAwayState" type="Node" parent="StateMachine" index="1" unique_id=1000000001]
|
||||
script = ExtResource("4_fly")
|
||||
destroy_after_seconds = 20.0
|
||||
state_id = &"fly"
|
||||
animation_name = "Fly_Crow"
|
||||
|
||||
[node name="Crow_rig" parent="." index="3" unique_id=2141026440 instance=ExtResource("2_1pxwy")]
|
||||
BIN
core/ai/agents/fox/Fox_rig.fbx
Normal file
BIN
core/ai/agents/fox/Fox_rig.fbx
Normal file
Binary file not shown.
6215
core/ai/agents/fox/Fox_rig.fbx.import
Normal file
6215
core/ai/agents/fox/Fox_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
64
core/ai/agents/fox/ai_fox.tscn
Normal file
64
core/ai/agents/fox/ai_fox.tscn
Normal file
@@ -0,0 +1,64 @@
|
||||
[gd_scene format=3 uid="uid://bk45etvtdd6m5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_m3efo"]
|
||||
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_58gnd"]
|
||||
[ext_resource type="PackedScene" uid="uid://4y4tffc723lg" path="res://core/ai/agents/fox/Fox_rig.fbx" id="2_xaafp"]
|
||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_d1sp2"]
|
||||
[ext_resource type="Script" uid="uid://b5y4u0itec8g1" path="res://core/ai/framework/run_state.gd" id="4_d1sp2"]
|
||||
|
||||
[node name="AiFox" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_m3efo")]
|
||||
navigation_layers = 4
|
||||
anim_player = NodePath("Fox_rig/AnimationPlayer")
|
||||
entity_type = 5
|
||||
entity_name = "Fox"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=933090954]
|
||||
script = ExtResource("2_58gnd")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
random_next_state_ids = Array[StringName]([&"patrol", &"run"])
|
||||
animation_name = "Idle_Fox"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="1" unique_id=48187684]
|
||||
script = ExtResource("3_d1sp2")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Walk_Fox"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="RunState" type="Node" parent="StateMachine" index="2" unique_id=30664919]
|
||||
script = ExtResource("4_d1sp2")
|
||||
state_id = &"run"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Run_Fox"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Fox_rig" parent="." index="3" unique_id=2044859181 instance=ExtResource("2_xaafp")]
|
||||
|
||||
[node name="Skeleton3D" parent="Fox_rig/Rig_Fox" parent_id_path=PackedInt32Array(2044859181, 975246732) index="0" unique_id=1559174379]
|
||||
bones/1/position = Vector3(1.2443564e-08, 0.24551632, 0.408434)
|
||||
bones/1/rotation = Quaternion(0.12769088, -0.6954821, -0.12769023, 0.69548184)
|
||||
bones/2/rotation = Quaternion(-1.492881e-07, -1.7862074e-07, -0.5904159, 0.8070992)
|
||||
bones/3/rotation = Quaternion(4.4853135e-08, 2.4038487e-09, 0.042394996, 0.999101)
|
||||
bones/4/rotation = Quaternion(-3.9116873e-08, 1.0805254e-08, 0.30337915, 0.95286995)
|
||||
bones/7/rotation = Quaternion(6.614782e-08, -2.2280902e-08, -0.4002855, 0.9163905)
|
||||
bones/9/rotation = Quaternion(0.00050595123, -0.00040185585, -0.7732871, 0.63405573)
|
||||
bones/10/rotation = Quaternion(4.4809266e-08, -6.81585e-09, 0.23513126, 0.97196364)
|
||||
bones/11/rotation = Quaternion(-0.013216025, -0.0063106352, 0.33804604, 0.94101566)
|
||||
bones/13/rotation = Quaternion(-0.00018805025, 2.7857828e-05, -0.77314246, 0.6342325)
|
||||
bones/14/rotation = Quaternion(4.4874945e-08, -6.797017e-09, 0.23506236, 0.9719803)
|
||||
bones/15/rotation = Quaternion(0.014745249, 0.00766435, 0.33750823, 0.9411759)
|
||||
bones/17/rotation = Quaternion(0.06574762, -0.012684453, 0.9796892, 0.18901181)
|
||||
bones/18/rotation = Quaternion(-0.0045532905, -0.06678549, -0.06784821, 0.99544746)
|
||||
bones/19/rotation = Quaternion(-0.00312141, -0.06676418, -0.049661905, 0.99652725)
|
||||
bones/21/rotation = Quaternion(-5.0142333e-08, 4.1612444e-07, 0.9618458, -0.27359205)
|
||||
bones/22/rotation = Quaternion(-1.9314905e-08, 4.503425e-08, -0.47071874, 0.88228333)
|
||||
bones/23/rotation = Quaternion(1.5250623e-07, -2.2114624e-07, 0.5290283, 0.84860426)
|
||||
bones/26/rotation = Quaternion(-3.3980676e-05, -0.00016874354, 0.9618461, -0.27359122)
|
||||
bones/27/rotation = Quaternion(-1.9324155e-08, 4.5031282e-08, -0.47071794, 0.8822838)
|
||||
bones/28/rotation = Quaternion(4.549153e-05, -8.8271285e-05, 0.5290293, 0.84860367)
|
||||
|
||||
[editable path="Fox_rig"]
|
||||
BIN
core/ai/agents/goat/Goat_rig.fbx
Normal file
BIN
core/ai/agents/goat/Goat_rig.fbx
Normal file
Binary file not shown.
4159
core/ai/agents/goat/Goat_rig.fbx.import
Normal file
4159
core/ai/agents/goat/Goat_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
54
core/ai/agents/goat/ai_goat.tscn
Normal file
54
core/ai/agents/goat/ai_goat.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene format=3 uid="uid://c8e8vy2yx0vuj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_f7hhh"]
|
||||
[ext_resource type="PackedScene" uid="uid://cumnmnbdjbgas" path="res://core/ai/agents/goat/Goat_rig.fbx" id="2_oxwbf"]
|
||||
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_ucoix"]
|
||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_lqqd8"]
|
||||
|
||||
[node name="AiGoat" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_f7hhh")]
|
||||
anim_player = NodePath("Goat_rig/AnimationPlayer")
|
||||
entity_type = 6
|
||||
entity_name = "Goat"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=874855696]
|
||||
script = ExtResource("2_ucoix")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
animation_name = "Goat_Idle"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="1" unique_id=450542027]
|
||||
script = ExtResource("3_lqqd8")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Goat_Walk"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Goat_rig" parent="." index="3" unique_id=1336829719 instance=ExtResource("2_oxwbf")]
|
||||
|
||||
[node name="Skeleton3D" parent="Goat_rig/Rig_Goat" parent_id_path=PackedInt32Array(1336829719, 123281310) index="0" unique_id=1526518923]
|
||||
bones/1/position = Vector3(-8.352713e-09, 0.36986786, 0.8951362)
|
||||
bones/1/rotation = Quaternion(0.1276911, -0.695482, -0.12769035, 0.69548184)
|
||||
bones/2/rotation = Quaternion(-8.7811394e-08, -9.458198e-08, -0.5904155, 0.80709946)
|
||||
bones/3/rotation = Quaternion(4.747651e-08, -1.1784627e-07, 0.017411958, 0.9998484)
|
||||
bones/4/rotation = Quaternion(6.0150165e-09, 1.2466938e-07, 0.30337915, 0.95287)
|
||||
bones/7/rotation = Quaternion(5.4816347e-08, -2.1401915e-08, -0.40028566, 0.9163904)
|
||||
bones/9/rotation = Quaternion(0.00046716904, -0.0004462793, -0.7121794, 0.7019972)
|
||||
bones/10/rotation = Quaternion(1.4472131e-07, 8.2933745e-08, 0.037125967, 0.9993106)
|
||||
bones/11/rotation = Quaternion(-0.012037385, -0.007822092, 0.4605625, 0.8875113)
|
||||
bones/13/rotation = Quaternion(0.0004971335, -0.00088232313, -0.7120875, 0.70209)
|
||||
bones/14/rotation = Quaternion(1.2098344e-07, 6.220867e-08, 0.03712596, 0.9993106)
|
||||
bones/15/rotation = Quaternion(0.016517974, 0.014013905, 0.46007547, 0.8876156)
|
||||
bones/17/rotation = Quaternion(5.284289e-08, 2.4923622e-07, 0.98189294, 0.1894366)
|
||||
bones/18/rotation = Quaternion(-1.4809112e-07, -6.559211e-08, -0.4198785, 0.9075803)
|
||||
bones/19/rotation = Quaternion(-2.2811262e-09, 1.0970184e-07, 0.011576452, 0.999933)
|
||||
bones/21/rotation = Quaternion(3.0247494e-07, 7.4317376e-07, 0.9653871, -0.26082122)
|
||||
bones/22/rotation = Quaternion(-3.8364158e-07, 5.6172302e-09, -0.3680436, 0.92980856)
|
||||
bones/23/rotation = Quaternion(0.0002487348, 5.1511866e-05, 0.45848387, 0.8887027)
|
||||
bones/26/rotation = Quaternion(2.713829e-07, 8.5825764e-07, 0.9653876, -0.26081985)
|
||||
bones/27/rotation = Quaternion(-3.8362674e-07, 5.6200027e-09, -0.3680436, 0.92980856)
|
||||
bones/28/rotation = Quaternion(-0.00015313082, -7.842175e-05, 0.45790914, 0.888999)
|
||||
|
||||
[editable path="Goat_rig"]
|
||||
BIN
core/ai/agents/human/Farmer1.fbx
Normal file
BIN
core/ai/agents/human/Farmer1.fbx
Normal file
Binary file not shown.
@@ -3,13 +3,13 @@
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://ch7aa7s6dk0bl"
|
||||
path="res://.godot/imported/Blockout_Stazione.fbx-29b82f4e4e38d5b32258c0185d53d2a1.scn"
|
||||
uid="uid://b3j2dbcqwodx1"
|
||||
path="res://.godot/imported/Farmer1.fbx-c6b3fa9e901f9ab5b38c67c1343eab85.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://tgcc/chunk/railway/Blockout_Stazione.fbx"
|
||||
dest_files=["res://.godot/imported/Blockout_Stazione.fbx-29b82f4e4e38d5b32258c0185d53d2a1.scn"]
|
||||
source_file="res://core/ai/agents/human/Farmer1.fbx"
|
||||
dest_files=["res://.godot/imported/Farmer1.fbx-c6b3fa9e901f9ab5b38c67c1343eab85.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
BIN
core/ai/agents/human/Farmer2.fbx
Normal file
BIN
core/ai/agents/human/Farmer2.fbx
Normal file
Binary file not shown.
44
core/ai/agents/human/Farmer2.fbx.import
Normal file
44
core/ai/agents/human/Farmer2.fbx.import
Normal file
@@ -0,0 +1,44 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://c5x3ycaxixpxy"
|
||||
path="res://.godot/imported/Farmer2.fbx-da830fcedaed7d46b77458a4c0e1f611.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://core/ai/agents/human/Farmer2.fbx"
|
||||
dest_files=["res://.godot/imported/Farmer2.fbx-da830fcedaed7d46b77458a4c0e1f611.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=true
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
fbx/importer=0
|
||||
fbx/allow_geometry_helper_nodes=false
|
||||
fbx/embedded_image_handling=1
|
||||
fbx/naming_version=2
|
||||
BIN
core/ai/agents/human/Gathering.fbx
Normal file
BIN
core/ai/agents/human/Gathering.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/Gathering.fbx.import
Normal file
2103
core/ai/agents/human/Gathering.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/ai/agents/human/Idle.fbx
Normal file
BIN
core/ai/agents/human/Idle.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/Idle.fbx.import
Normal file
2103
core/ai/agents/human/Idle.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/ai/agents/human/Sitting.fbx
Normal file
BIN
core/ai/agents/human/Sitting.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/Sitting.fbx.import
Normal file
2103
core/ai/agents/human/Sitting.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/ai/agents/human/Walking.fbx
Normal file
BIN
core/ai/agents/human/Walking.fbx
Normal file
Binary file not shown.
2103
core/ai/agents/human/Walking.fbx.import
Normal file
2103
core/ai/agents/human/Walking.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
304
core/ai/agents/human/ai_citizen.tscn
Normal file
304
core/ai/agents/human/ai_citizen.tscn
Normal file
File diff suppressed because one or more lines are too long
55
core/ai/agents/human/ai_citizen_sitter.tscn
Normal file
55
core/ai/agents/human/ai_citizen_sitter.tscn
Normal file
@@ -0,0 +1,55 @@
|
||||
[gd_scene format=3 uid="uid://bbseno7clbepx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bdqeshcwwnyc4" path="res://core/ai/agents/human/ai_citizen.tscn" id="1_cduuu"]
|
||||
|
||||
[node name="AiCitizenSitter" unique_id=1228675528 instance=ExtResource("1_cduuu")]
|
||||
entity_type = 2
|
||||
entity_name = "CitizenSitter"
|
||||
|
||||
[node name="Skeleton3D" parent="BaseMesh/BaseMesh" parent_id_path=PackedInt32Array(1846171523, 1142246531) index="0" unique_id=928995817]
|
||||
bones/0/position = Vector3(4.6274214e-05, 0.53962195, 0.01442101)
|
||||
bones/0/rotation = Quaternion(-0.08261974, -0.011491157, 0.01847047, 0.99634373)
|
||||
bones/1/rotation = Quaternion(0.14039387, -0.0048084054, -0.034078293, 0.9894974)
|
||||
bones/2/rotation = Quaternion(0.019730499, -0.0005302894, -0.003380251, 0.9997995)
|
||||
bones/3/rotation = Quaternion(0.019732494, -0.00056420703, -0.0034286412, 0.99979925)
|
||||
bones/4/rotation = Quaternion(0.047632027, 0.0044146716, 5.5285243e-05, 0.99885523)
|
||||
bones/5/rotation = Quaternion(-0.1481004, 0.030818012, 0.027112251, 0.98812014)
|
||||
bones/8/rotation = Quaternion(-0.64003974, -0.37008905, 0.49884537, -0.45225725)
|
||||
bones/9/rotation = Quaternion(0.26399517, -0.016558504, 0.18318768, 0.9468234)
|
||||
bones/10/rotation = Quaternion(-0.024250507, -0.09629851, 0.46758032, 0.8783548)
|
||||
bones/11/rotation = Quaternion(-0.12018964, 0.24466898, 0.1851929, 0.9441373)
|
||||
bones/12/rotation = Quaternion(0.23282185, 0.045711264, 0.11371554, 0.9647659)
|
||||
bones/13/rotation = Quaternion(0.11161193, 0.015611293, -0.07621057, 0.9907024)
|
||||
bones/14/rotation = Quaternion(-0.0120385215, 0.035021365, -0.027293455, 0.99894124)
|
||||
bones/17/rotation = Quaternion(0.47229832, -0.07009207, -0.07346811, 0.87557054)
|
||||
bones/18/rotation = Quaternion(0.28523657, -0.0033537035, -0.016236508, 0.9583138)
|
||||
bones/19/rotation = Quaternion(0.114431076, 0.0009974723, -0.016153814, 0.99329937)
|
||||
bones/22/rotation = Quaternion(0.38703713, -0.07161111, -0.055929746, 0.9175762)
|
||||
bones/23/rotation = Quaternion(0.27320057, -0.0025043646, -0.0333917, 0.96137416)
|
||||
bones/24/rotation = Quaternion(0.18236126, 0.0039793584, -0.014504941, 0.9831166)
|
||||
bones/27/rotation = Quaternion(0.67000026, -0.3385617, 0.49965796, 0.432224)
|
||||
bones/28/rotation = Quaternion(0.2097779, 0.0323844, -0.30925584, 0.92698723)
|
||||
bones/29/rotation = Quaternion(-0.013720488, 0.064641, -0.3156722, 0.94656456)
|
||||
bones/30/rotation = Quaternion(0.023524001, -0.2031076, -0.21903762, 0.95405275)
|
||||
bones/31/rotation = Quaternion(0.10362807, -0.060477145, -0.0822956, 0.989359)
|
||||
bones/32/rotation = Quaternion(0.2005617, -0.080317385, 0.08554337, 0.9726287)
|
||||
bones/33/rotation = Quaternion(0.09055836, 0.16444178, -0.016598457, 0.9820808)
|
||||
bones/36/rotation = Quaternion(0.41982892, 0.05875236, 0.110271834, 0.89896166)
|
||||
bones/37/rotation = Quaternion(0.3084902, -5.0797826e-06, 0.016977265, 0.9510761)
|
||||
bones/38/rotation = Quaternion(0.15843387, -0.0010695796, -0.0025179624, 0.9873659)
|
||||
bones/41/rotation = Quaternion(0.39090672, 0.07217823, 0.08132209, 0.9139852)
|
||||
bones/42/rotation = Quaternion(0.23195146, -0.00022551513, 0.057113327, 0.97104925)
|
||||
bones/43/rotation = Quaternion(0.04765674, -0.005312021, -0.037802245, 0.9981341)
|
||||
bones/46/rotation = Quaternion(0.07913973, 0.67941314, 0.72431135, -0.08664747)
|
||||
bones/47/rotation = Quaternion(-0.7301858, 0.021535583, -0.08527201, 0.6775645)
|
||||
bones/48/rotation = Quaternion(0.42302147, 0.034331664, 0.030263728, 0.9049632)
|
||||
bones/49/rotation = Quaternion(0.3195373, 0.059513275, -0.020113025, 0.94548905)
|
||||
bones/52/rotation = Quaternion(-0.048473507, 0.6923688, 0.7180678, 0.05152073)
|
||||
bones/53/rotation = Quaternion(-0.75171393, 0.06818038, -0.046880867, 0.6542782)
|
||||
bones/54/rotation = Quaternion(0.44898874, -0.026657255, -0.051447295, 0.8916567)
|
||||
bones/55/rotation = Quaternion(0.32369038, -0.05870039, 0.019949934, 0.9441297)
|
||||
|
||||
[node name="AnimationPlayer" parent="BaseMesh" parent_id_path=PackedInt32Array(1846171523) index="1" unique_id=2096005878]
|
||||
autoplay = &"custom/sitting"
|
||||
|
||||
[editable path="BaseMesh"]
|
||||
31
core/ai/agents/human/ai_citizen_walker.tscn
Normal file
31
core/ai/agents/human/ai_citizen_walker.tscn
Normal file
@@ -0,0 +1,31 @@
|
||||
[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="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/framework/patrol_state.gd" id="3_8d0tj"]
|
||||
|
||||
[node name="AiCitizenWalker" unique_id=1228675528 instance=ExtResource("1_dms8s")]
|
||||
entity_type = 1
|
||||
entity_name = "CitizenWalker"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=42226979]
|
||||
script = ExtResource("2_awhwq")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
animation_name = "custom/idle"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="1" unique_id=1357892786]
|
||||
script = ExtResource("3_8d0tj")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "custom/walking"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Skeleton3D" parent="BaseMesh/BaseMesh" parent_id_path=PackedInt32Array(1846171523, 1142246531) index="0" unique_id=928995817]
|
||||
bones/8/rotation = Quaternion(-0.6173422, -0.37346625, 0.5666242, -0.3979305)
|
||||
bones/46/rotation = Quaternion(0.059241787, 0.12928401, 0.9836761, -0.110261135)
|
||||
|
||||
[editable path="BaseMesh"]
|
||||
74
core/ai/agents/human/ai_farmer.tscn
Normal file
74
core/ai/agents/human/ai_farmer.tscn
Normal file
@@ -0,0 +1,74 @@
|
||||
[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="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")]
|
||||
navigation_layers = 2
|
||||
entity_name = "Farmer"
|
||||
allowed_biomes = Array[String](["countryside"])
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[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"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="GatherState" type="Node" parent="StateMachine" index="1" unique_id=48091671]
|
||||
script = ExtResource("4_2oda6")
|
||||
state_id = &"gather"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "custom/gathering"
|
||||
exit_on_animation_finished = true
|
||||
min_wait_time = 0.0
|
||||
max_wait_time = 0.0
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="2" unique_id=402985597]
|
||||
script = ExtResource("4_2oda6")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
animation_name = "custom/idle"
|
||||
|
||||
[node name="Skeleton3D" parent="BaseMesh/BaseMesh" parent_id_path=PackedInt32Array(1846171523, 1363988051) index="0" unique_id=1848874512]
|
||||
bones/0/position = Vector3(-0.0015795716, 0.9761277, 0.0012886743)
|
||||
bones/0/rotation = Quaternion(0.008345705, 0.02440254, -0.0222881, 0.999419)
|
||||
bones/1/rotation = Quaternion(-0.033856627, 0.0019547925, 0.01148837, 0.9993588)
|
||||
bones/2/rotation = Quaternion(0.003385691, 0.0057030413, 0.004773842, 0.9999666)
|
||||
bones/3/rotation = Quaternion(0.0033856947, 0.0057030534, 0.0047738357, 0.9999666)
|
||||
bones/4/rotation = Quaternion(0.03554347, -0.0036022358, -0.01067691, 0.9993046)
|
||||
bones/5/rotation = Quaternion(0.023500564, -0.0268053, 0.016007349, 0.9992362)
|
||||
bones/8/rotation = Quaternion(-0.677935, -0.3162402, 0.5391133, -0.3869797)
|
||||
bones/9/rotation = Quaternion(0.33057448, -0.0144906035, -0.024771411, 0.9433436)
|
||||
bones/10/rotation = Quaternion(0.071588665, 0.16423635, 0.26876602, 0.9463965)
|
||||
bones/11/rotation = Quaternion(-0.11033899, 0.19317266, 0.18225361, 0.95775425)
|
||||
bones/12/rotation = Quaternion(0.28979003, -0.100065045, 0.021221647, 0.95160836)
|
||||
bones/13/rotation = Quaternion(-0.01075587, -0.003262491, 0.085242614, 0.9962969)
|
||||
bones/17/rotation = Quaternion(0.372185, -0.04203017, 0.003265603, 0.9272007)
|
||||
bones/18/rotation = Quaternion(0.6449709, -0.022805, 0.11591787, 0.7550203)
|
||||
bones/22/rotation = Quaternion(0.5152635, -0.09862117, 0.07484319, 0.8480425)
|
||||
bones/23/rotation = Quaternion(0.7634141, -0.01797779, 0.14009176, 0.63027775)
|
||||
bones/27/rotation = Quaternion(0.6460654, -0.34361044, 0.58023506, 0.35757324)
|
||||
bones/28/rotation = Quaternion(0.3564352, 0.033001784, 0.1479881, 0.9219352)
|
||||
bones/29/rotation = Quaternion(0.10407414, -0.119882874, -0.20823832, 0.96510804)
|
||||
bones/30/rotation = Quaternion(-0.040577345, -0.20657076, -0.14159827, 0.96728075)
|
||||
bones/31/rotation = Quaternion(0.18718895, 0.11185156, -0.005364931, 0.97592044)
|
||||
bones/32/rotation = Quaternion(0.077440694, -0.18545257, 0.02808432, 0.9791944)
|
||||
bones/36/rotation = Quaternion(0.33726785, 0.06133867, 0.07482985, 0.93642324)
|
||||
bones/37/rotation = Quaternion(0.5483169, 0.027307179, -0.058035128, 0.83380747)
|
||||
bones/41/rotation = Quaternion(0.4086348, 0.09420283, 0.037183065, 0.90706164)
|
||||
bones/42/rotation = Quaternion(0.59161603, 0.030198008, -0.037664413, 0.8047733)
|
||||
bones/46/rotation = Quaternion(0.060233127, 0.24369022, 0.966249, -0.05787964)
|
||||
bones/47/rotation = Quaternion(-0.56581247, 0.0105282655, -0.0027436528, 0.8244622)
|
||||
bones/48/rotation = Quaternion(0.46872035, 0.0146656195, -0.0033694527, 0.88321847)
|
||||
bones/49/rotation = Quaternion(0.49349385, 0.06718427, -0.01829647, 0.86695755)
|
||||
bones/52/rotation = Quaternion(-0.0765912, 0.12600712, 0.988389, -0.03665043)
|
||||
bones/53/rotation = Quaternion(-0.25056988, -0.06629382, 0.018621337, 0.96564656)
|
||||
bones/54/rotation = Quaternion(0.549743, -0.041815143, -0.046032935, 0.83301574)
|
||||
bones/55/rotation = Quaternion(0.3627838, -0.05369254, 0.01255593, 0.9302406)
|
||||
|
||||
[editable path="BaseMesh"]
|
||||
197
core/ai/agents/human/ai_human.tscn
Normal file
197
core/ai/agents/human/ai_human.tscn
Normal file
@@ -0,0 +1,197 @@
|
||||
[gd_scene format=3 uid="uid://mvh2v6v72stt"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_hko2w"]
|
||||
[ext_resource type="Animation" uid="uid://qhkny5iyd4mi" path="res://core/ai/agents/human/gathering.res" id="3_8kg0q"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbix54xp87fk0" path="res://core/ai/agents/human/human_base_mesh.fbx" id="3_ef4cu"]
|
||||
[ext_resource type="Animation" uid="uid://ptj85lvvtjpg" path="res://core/ai/agents/human/sitting.res" id="4_8kg0q"]
|
||||
[ext_resource type="Animation" uid="uid://oq22ilhxjejj" path="res://core/ai/agents/human/idle.res" id="4_cuxdk"]
|
||||
[ext_resource type="Animation" uid="uid://6xnsf8x7nmsl" path="res://core/ai/agents/human/walking.res" id="6_cuxdk"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3j2dbcqwodx1" path="res://core/ai/agents/human/Farmer1.fbx" id="7_hguxe"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5x3ycaxixpxy" path="res://core/ai/agents/human/Farmer2.fbx" id="8_ke7sb"]
|
||||
[ext_resource type="Script" uid="uid://dauqq8cqmwrqh" path="res://core/ai/agents/human/dress_human.gd" id="9_2tpdi"]
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8kg0q"]
|
||||
_data = {
|
||||
&"gathering": ExtResource("3_8kg0q"),
|
||||
&"idle": ExtResource("4_cuxdk"),
|
||||
&"sitting": ExtResource("4_8kg0q"),
|
||||
&"walking": ExtResource("6_cuxdk")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ke7sb"]
|
||||
_data = {
|
||||
&"gathering": ExtResource("3_8kg0q"),
|
||||
&"idle": ExtResource("4_cuxdk"),
|
||||
&"sitting": ExtResource("4_8kg0q"),
|
||||
&"walking": ExtResource("6_cuxdk")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2tpdi"]
|
||||
_data = {
|
||||
&"gathering": ExtResource("3_8kg0q"),
|
||||
&"idle": ExtResource("4_cuxdk"),
|
||||
&"sitting": ExtResource("4_8kg0q"),
|
||||
&"walking": ExtResource("6_cuxdk")
|
||||
}
|
||||
|
||||
[node name="AiHuman" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_hko2w")]
|
||||
anim_player = NodePath("BaseMesh/AnimationPlayer")
|
||||
|
||||
[node name="BaseMesh" parent="." index="3" unique_id=1846171523 instance=ExtResource("3_ef4cu")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.9, 0)
|
||||
|
||||
[node name="Skeleton3D" parent="BaseMesh/BaseMesh" parent_id_path=PackedInt32Array(1846171523, 2032005240) index="0" unique_id=1876883359]
|
||||
bones/0/position = Vector3(-0.0024333135, 0.9952637, 6.9276895e-05)
|
||||
bones/0/rotation = Quaternion(-0.0049152793, -0.050206795, -0.026513178, 0.99837476)
|
||||
bones/1/rotation = Quaternion(-0.025209453, 0.006135946, 0.009180705, 0.9996213)
|
||||
bones/2/rotation = Quaternion(0.020680578, 0.011754706, 0.015464293, 0.99959743)
|
||||
bones/3/rotation = Quaternion(0.020680578, 0.011754692, 0.015464287, 0.99959743)
|
||||
bones/4/rotation = Quaternion(-0.053108443, 0.009324013, 0.011697456, 0.9984768)
|
||||
bones/5/rotation = Quaternion(0.03947722, 0.0123098595, -0.024802445, 0.99883676)
|
||||
bones/8/rotation = Quaternion(-0.5728458, -0.38286844, 0.60871977, -0.39334446)
|
||||
bones/9/rotation = Quaternion(0.44939622, 0.29187396, 0.053696252, 0.84259677)
|
||||
bones/10/rotation = Quaternion(-0.013349593, 0.006303966, 0.231745, 0.97266454)
|
||||
bones/11/rotation = Quaternion(-0.13493852, -0.23365982, 0.088579476, 0.95882654)
|
||||
bones/12/rotation = Quaternion(0.1921569, 0.10821218, -0.024087887, 0.9750824)
|
||||
bones/13/rotation = Quaternion(0.025333803, 0.00917047, 0.048555605, 0.9984571)
|
||||
bones/14/rotation = Quaternion(-0.0120385215, 0.035021365, -0.027293455, 0.99894124)
|
||||
bones/17/rotation = Quaternion(0.09417869, -0.072669275, -0.17156787, 0.9779642)
|
||||
bones/18/rotation = Quaternion(0.14308922, 0.0019350327, -0.0097575225, 0.98965985)
|
||||
bones/19/rotation = Quaternion(0.114431076, 0.0009974723, -0.016153814, 0.99329937)
|
||||
bones/22/rotation = Quaternion(0.11025663, -0.026056329, -0.115814656, 0.9867886)
|
||||
bones/23/rotation = Quaternion(0.08941777, 0.0010620031, -0.023814844, 0.9957089)
|
||||
bones/24/rotation = Quaternion(0.18236126, 0.0039793584, -0.014504941, 0.9831166)
|
||||
bones/27/rotation = Quaternion(0.5637914, -0.40525162, 0.5912719, 0.41025364)
|
||||
bones/28/rotation = Quaternion(0.5117543, -0.062450167, 0.07040776, 0.8539615)
|
||||
bones/29/rotation = Quaternion(0.06749446, 0.22771753, -0.20722775, 0.9490237)
|
||||
bones/30/rotation = Quaternion(-0.0005478785, -0.33554533, -0.112540804, 0.93527734)
|
||||
bones/31/rotation = Quaternion(0.13877106, 0.12508087, 0.031252213, 0.9818965)
|
||||
bones/32/rotation = Quaternion(-0.01564488, 0.0028465544, -0.073795564, 0.9971466)
|
||||
bones/33/rotation = Quaternion(0.09055836, 0.16444178, -0.016598457, 0.9820808)
|
||||
bones/36/rotation = Quaternion(0.048626706, 0.08521321, 0.1502388, 0.98376954)
|
||||
bones/37/rotation = Quaternion(0.20746112, 0.00031290663, 0.0112788575, 0.97817826)
|
||||
bones/38/rotation = Quaternion(0.15843387, -0.0010695796, -0.0025179624, 0.9873659)
|
||||
bones/41/rotation = Quaternion(0.16202472, 0.04171574, 0.09497025, 0.98131984)
|
||||
bones/42/rotation = Quaternion(0.14799795, 0.00100551, 0.030993575, 0.9885015)
|
||||
bones/43/rotation = Quaternion(0.04765674, -0.005312021, -0.037802245, 0.9981341)
|
||||
bones/46/rotation = Quaternion(0.024758164, 0.13509843, 0.9874187, -0.07835583)
|
||||
bones/47/rotation = Quaternion(-0.1871983, 0.0008643933, -0.010582049, 0.98226476)
|
||||
bones/48/rotation = Quaternion(0.46037424, -0.13497493, 0.042778272, 0.87636036)
|
||||
bones/49/rotation = Quaternion(0.3209879, 0.038273156, 0.0024189365, 0.9463065)
|
||||
bones/52/rotation = Quaternion(-0.060150255, 0.009860813, 0.99663967, -0.05471906)
|
||||
bones/53/rotation = Quaternion(-0.10502596, -0.00032293255, 0.008123855, 0.9944363)
|
||||
bones/54/rotation = Quaternion(0.51151097, 0.066536464, -0.07767137, 0.8531686)
|
||||
bones/55/rotation = Quaternion(0.3453064, -0.067497015, 0.02391528, 0.93575406)
|
||||
|
||||
[node name="AnimationPlayer" parent="BaseMesh" index="1" unique_id=226905852]
|
||||
libraries/custom = SubResource("AnimationLibrary_8kg0q")
|
||||
|
||||
[node name="Farmer1" parent="." index="4" unique_id=925374995 instance=ExtResource("7_hguxe")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.9, 0)
|
||||
visible = false
|
||||
|
||||
[node name="Skeleton3D" parent="Farmer1/BaseMesh" parent_id_path=PackedInt32Array(925374995, 35893719) index="0" unique_id=264693097]
|
||||
bones/0/position = Vector3(0.00060560287, 0.9719096, 0.007789615)
|
||||
bones/0/rotation = Quaternion(-0.03158553, -0.024531638, -0.086598895, 0.9954402)
|
||||
bones/1/rotation = Quaternion(-0.068302006, -0.011589706, 0.088431515, 0.99367017)
|
||||
bones/2/rotation = Quaternion(0.013750468, -0.0028497525, 0.022636604, 0.99964523)
|
||||
bones/3/rotation = Quaternion(0.014052153, -0.0046672956, 0.021981178, 0.99964875)
|
||||
bones/4/rotation = Quaternion(0.08060878, 0.0009885994, -0.05385771, 0.99528927)
|
||||
bones/5/rotation = Quaternion(-0.08819712, -0.010719821, 0.004734955, 0.9960341)
|
||||
bones/8/rotation = Quaternion(-0.6173422, -0.37346625, 0.5666242, -0.3979305)
|
||||
bones/9/rotation = Quaternion(0.5403529, 0.038538188, -0.087646246, 0.8359735)
|
||||
bones/10/rotation = Quaternion(-0.009744837, 0.0007412914, 0.18789424, 0.98214066)
|
||||
bones/11/rotation = Quaternion(0.019992959, 0.15807849, 0.15262179, 0.9753554)
|
||||
bones/12/rotation = Quaternion(0.11525436, -0.03521942, -0.0147265345, 0.9926023)
|
||||
bones/13/rotation = Quaternion(0.004553697, -0.0011956134, 0.0748576, 0.9971832)
|
||||
bones/14/rotation = Quaternion(-0.021573644, -0.09607655, -0.02610063, 0.9947978)
|
||||
bones/17/rotation = Quaternion(0.10615231, -0.012490018, -0.06538699, 0.9921191)
|
||||
bones/18/rotation = Quaternion(0.112639524, -0.0005986789, -0.020016164, 0.99343413)
|
||||
bones/19/rotation = Quaternion(0.13624819, 0.001439244, -0.018421004, 0.9905025)
|
||||
bones/22/rotation = Quaternion(0.051831737, -0.007218998, -0.063239366, 0.9966254)
|
||||
bones/23/rotation = Quaternion(0.12439526, 0.00031310506, -0.03746358, 0.99152523)
|
||||
bones/24/rotation = Quaternion(0.14832872, 0.0028264069, -0.017447466, 0.9887802)
|
||||
bones/27/rotation = Quaternion(0.6085938, -0.37735197, 0.5827399, 0.3842309)
|
||||
bones/28/rotation = Quaternion(0.42811802, -0.12440211, 0.04666202, 0.8939026)
|
||||
bones/29/rotation = Quaternion(-0.010464899, -0.0008133942, -0.24076757, 0.97052604)
|
||||
bones/30/rotation = Quaternion(0.01554073, -0.15455346, -0.11519627, 0.9811226)
|
||||
bones/31/rotation = Quaternion(0.109474085, 0.02398801, 0.02464503, 0.99339455)
|
||||
bones/32/rotation = Quaternion(-0.03558804, 0.04901748, 0.08471445, 0.9945624)
|
||||
bones/33/rotation = Quaternion(0.014632019, 0.019343862, -0.1317728, 0.9909832)
|
||||
bones/36/rotation = Quaternion(0.19392295, 0.020005528, 0.11780725, 0.973712)
|
||||
bones/37/rotation = Quaternion(0.090232305, 2.462184e-07, 0.01726049, 0.9957712)
|
||||
bones/38/rotation = Quaternion(0.13336712, -0.0009009653, 0.002359003, 0.9910635)
|
||||
bones/41/rotation = Quaternion(0.12012116, 0.015946638, 0.088212825, 0.9887037)
|
||||
bones/42/rotation = Quaternion(0.11693482, 0.00096280884, 0.06057904, 0.99128985)
|
||||
bones/43/rotation = Quaternion(0.22191456, 0.026510797, -0.016629422, 0.9745638)
|
||||
bones/46/rotation = Quaternion(0.059241787, 0.12928401, 0.9836761, -0.110261135)
|
||||
bones/47/rotation = Quaternion(-0.34151906, -0.06546942, 0.0071559767, 0.93756455)
|
||||
bones/48/rotation = Quaternion(0.60213244, 0.010313871, -0.012120304, 0.7982376)
|
||||
bones/49/rotation = Quaternion(0.31586254, 0.059334766, -0.020474449, 0.9467265)
|
||||
bones/52/rotation = Quaternion(-0.07240856, 0.034467246, 0.9931159, -0.085380435)
|
||||
bones/53/rotation = Quaternion(-0.20515193, 0.049833227, 0.0071537, 0.9774345)
|
||||
bones/54/rotation = Quaternion(0.55275166, -0.049315806, -0.007871797, 0.8318483)
|
||||
bones/55/rotation = Quaternion(0.326561, -0.058840513, 0.019667907, 0.9431378)
|
||||
|
||||
[node name="AnimationPlayer" parent="Farmer1" index="1" unique_id=1795570086]
|
||||
libraries/custom = SubResource("AnimationLibrary_ke7sb")
|
||||
|
||||
[node name="Farmer2" parent="." index="5" unique_id=1239853450 instance=ExtResource("8_ke7sb")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.9, 0)
|
||||
visible = false
|
||||
|
||||
[node name="Skeleton3D" parent="Farmer2/BaseMesh" parent_id_path=PackedInt32Array(1239853450, 2123768022) index="0" unique_id=1560566445]
|
||||
bones/0/position = Vector3(0.00060560287, 0.9719096, 0.007789615)
|
||||
bones/0/rotation = Quaternion(-0.03158553, -0.024531638, -0.086598895, 0.9954402)
|
||||
bones/1/rotation = Quaternion(-0.068302006, -0.011589706, 0.088431515, 0.99367017)
|
||||
bones/2/rotation = Quaternion(0.013750468, -0.0028497525, 0.022636604, 0.99964523)
|
||||
bones/3/rotation = Quaternion(0.014052153, -0.0046672956, 0.021981178, 0.99964875)
|
||||
bones/4/rotation = Quaternion(0.08060878, 0.0009885994, -0.05385771, 0.99528927)
|
||||
bones/5/rotation = Quaternion(-0.08819712, -0.010719821, 0.004734955, 0.9960341)
|
||||
bones/8/rotation = Quaternion(-0.6173422, -0.37346625, 0.5666242, -0.3979305)
|
||||
bones/9/rotation = Quaternion(0.5403529, 0.038538188, -0.087646246, 0.8359735)
|
||||
bones/10/rotation = Quaternion(-0.009744837, 0.0007412914, 0.18789424, 0.98214066)
|
||||
bones/11/rotation = Quaternion(0.019992959, 0.15807849, 0.15262179, 0.9753554)
|
||||
bones/12/rotation = Quaternion(0.11525436, -0.03521942, -0.0147265345, 0.9926023)
|
||||
bones/13/rotation = Quaternion(0.004553697, -0.0011956134, 0.0748576, 0.9971832)
|
||||
bones/14/rotation = Quaternion(-0.021573644, -0.09607655, -0.02610063, 0.9947978)
|
||||
bones/17/rotation = Quaternion(0.10615231, -0.012490018, -0.06538699, 0.9921191)
|
||||
bones/18/rotation = Quaternion(0.112639524, -0.0005986789, -0.020016164, 0.99343413)
|
||||
bones/19/rotation = Quaternion(0.13624819, 0.001439244, -0.018421004, 0.9905025)
|
||||
bones/22/rotation = Quaternion(0.051831737, -0.007218998, -0.063239366, 0.9966254)
|
||||
bones/23/rotation = Quaternion(0.12439526, 0.00031310506, -0.03746358, 0.99152523)
|
||||
bones/24/rotation = Quaternion(0.14832872, 0.0028264069, -0.017447466, 0.9887802)
|
||||
bones/27/rotation = Quaternion(0.6085938, -0.37735197, 0.5827399, 0.3842309)
|
||||
bones/28/rotation = Quaternion(0.42811802, -0.12440211, 0.04666202, 0.8939026)
|
||||
bones/29/rotation = Quaternion(-0.010464899, -0.0008133942, -0.24076757, 0.97052604)
|
||||
bones/30/rotation = Quaternion(0.01554073, -0.15455346, -0.11519627, 0.9811226)
|
||||
bones/31/rotation = Quaternion(0.109474085, 0.02398801, 0.02464503, 0.99339455)
|
||||
bones/32/rotation = Quaternion(-0.03558804, 0.04901748, 0.08471445, 0.9945624)
|
||||
bones/33/rotation = Quaternion(0.014632019, 0.019343862, -0.1317728, 0.9909832)
|
||||
bones/36/rotation = Quaternion(0.19392295, 0.020005528, 0.11780725, 0.973712)
|
||||
bones/37/rotation = Quaternion(0.090232305, 2.462184e-07, 0.01726049, 0.9957712)
|
||||
bones/38/rotation = Quaternion(0.13336712, -0.0009009653, 0.002359003, 0.9910635)
|
||||
bones/41/rotation = Quaternion(0.12012116, 0.015946638, 0.088212825, 0.9887037)
|
||||
bones/42/rotation = Quaternion(0.11693482, 0.00096280884, 0.06057904, 0.99128985)
|
||||
bones/43/rotation = Quaternion(0.22191456, 0.026510797, -0.016629422, 0.9745638)
|
||||
bones/46/rotation = Quaternion(0.059241787, 0.12928401, 0.9836761, -0.110261135)
|
||||
bones/47/rotation = Quaternion(-0.34151906, -0.06546942, 0.0071559767, 0.93756455)
|
||||
bones/48/rotation = Quaternion(0.60213244, 0.010313871, -0.012120304, 0.7982376)
|
||||
bones/49/rotation = Quaternion(0.31586254, 0.059334766, -0.020474449, 0.9467265)
|
||||
bones/52/rotation = Quaternion(-0.07240856, 0.034467246, 0.9931159, -0.085380435)
|
||||
bones/53/rotation = Quaternion(-0.20515193, 0.049833227, 0.0071537, 0.9774345)
|
||||
bones/54/rotation = Quaternion(0.55275166, -0.049315806, -0.007871797, 0.8318483)
|
||||
bones/55/rotation = Quaternion(0.326561, -0.058840513, 0.019667907, 0.9431378)
|
||||
|
||||
[node name="AnimationPlayer" parent="Farmer2" index="1" unique_id=916643412]
|
||||
libraries/custom = SubResource("AnimationLibrary_2tpdi")
|
||||
|
||||
[node name="DressHuman" type="Node3D" parent="." index="6" unique_id=107727715 node_paths=PackedStringArray("farmers", "main_anim_player")]
|
||||
script = ExtResource("9_2tpdi")
|
||||
farmers = [NodePath("../Farmer1"), NodePath("../Farmer2")]
|
||||
colors = Array[Color]([Color(0, 0, 0, 1), Color(1, 1, 1, 1), Color(1, 0, 0, 1), Color(0, 1, 0, 1), Color(0, 0, 1, 1)])
|
||||
main_anim_player = NodePath("../BaseMesh/AnimationPlayer")
|
||||
|
||||
[editable path="BaseMesh"]
|
||||
[editable path="Farmer1"]
|
||||
[editable path="Farmer2"]
|
||||
59
core/ai/agents/human/dress_human.gd
Normal file
59
core/ai/agents/human/dress_human.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
extends Node
|
||||
|
||||
@export var farmers: Array[Node3D]
|
||||
@export var colors: Array[Color]
|
||||
|
||||
@export var main_anim_player: AnimationPlayer
|
||||
var dress_anim_player: AnimationPlayer
|
||||
|
||||
func _ready() -> void:
|
||||
if farmers.is_empty():
|
||||
return
|
||||
|
||||
for farmer in farmers:
|
||||
if farmer:
|
||||
farmer.hide()
|
||||
|
||||
var selected_farmer = farmers.pick_random()
|
||||
if selected_farmer:
|
||||
selected_farmer.show()
|
||||
|
||||
dress_anim_player = selected_farmer.get_node_or_null("AnimationPlayer")
|
||||
|
||||
if main_anim_player and dress_anim_player:
|
||||
main_anim_player.current_animation_changed.connect(_on_animation_sync)
|
||||
main_anim_player.animation_started.connect(_on_animation_sync)
|
||||
|
||||
if main_anim_player.current_animation != "":
|
||||
_on_animation_sync(main_anim_player.current_animation)
|
||||
dress_anim_player.seek(main_anim_player.current_animation_position)
|
||||
|
||||
if colors.size() > 0:
|
||||
var parts_to_color = ["pants", "shirt"]
|
||||
var shared_color = colors.pick_random()
|
||||
|
||||
for part_name in parts_to_color:
|
||||
var piece_node = _find_mesh_case_insensitive(selected_farmer, part_name)
|
||||
|
||||
if piece_node:
|
||||
var mat = StandardMaterial3D.new()
|
||||
mat.albedo_color = shared_color
|
||||
|
||||
piece_node.set_surface_override_material(0, mat)
|
||||
|
||||
func _on_animation_sync(anim_name: StringName) -> void:
|
||||
if dress_anim_player and dress_anim_player.has_animation(anim_name):
|
||||
dress_anim_player.play(anim_name)
|
||||
dress_anim_player.speed_scale = main_anim_player.speed_scale
|
||||
|
||||
func _find_mesh_case_insensitive(parent: Node, part_name: String) -> MeshInstance3D:
|
||||
var target = part_name.to_lower()
|
||||
for child in parent.get_children():
|
||||
if child.name.to_lower().contains(target) and child is MeshInstance3D:
|
||||
return child
|
||||
|
||||
var found = _find_mesh_case_insensitive(child, target)
|
||||
if found:
|
||||
return found
|
||||
|
||||
return null
|
||||
1
core/ai/agents/human/dress_human.gd.uid
Normal file
1
core/ai/agents/human/dress_human.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dauqq8cqmwrqh
|
||||
BIN
core/ai/agents/human/gathering.res
Normal file
BIN
core/ai/agents/human/gathering.res
Normal file
Binary file not shown.
BIN
core/ai/agents/human/human_base_mesh.fbx
Normal file
BIN
core/ai/agents/human/human_base_mesh.fbx
Normal file
Binary file not shown.
44
core/ai/agents/human/human_base_mesh.fbx.import
Normal file
44
core/ai/agents/human/human_base_mesh.fbx.import
Normal file
@@ -0,0 +1,44 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cbix54xp87fk0"
|
||||
path="res://.godot/imported/human_base_mesh.fbx-f7c776fe2fa7f0a6658ca2b639d0b975.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://core/ai/agents/human/human_base_mesh.fbx"
|
||||
dest_files=["res://.godot/imported/human_base_mesh.fbx-f7c776fe2fa7f0a6658ca2b639d0b975.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=true
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
fbx/importer=0
|
||||
fbx/allow_geometry_helper_nodes=false
|
||||
fbx/embedded_image_handling=1
|
||||
fbx/naming_version=2
|
||||
BIN
core/ai/agents/human/idle.res
Normal file
BIN
core/ai/agents/human/idle.res
Normal file
Binary file not shown.
BIN
core/ai/agents/human/sitting.res
Normal file
BIN
core/ai/agents/human/sitting.res
Normal file
Binary file not shown.
BIN
core/ai/agents/human/walking.res
Normal file
BIN
core/ai/agents/human/walking.res
Normal file
Binary file not shown.
BIN
core/ai/agents/racoon/Raccoon_rig.fbx
Normal file
BIN
core/ai/agents/racoon/Raccoon_rig.fbx
Normal file
Binary file not shown.
4159
core/ai/agents/racoon/Raccoon_rig.fbx.import
Normal file
4159
core/ai/agents/racoon/Raccoon_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
102
core/ai/agents/racoon/ai_racoon.tscn
Normal file
102
core/ai/agents/racoon/ai_racoon.tscn
Normal file
@@ -0,0 +1,102 @@
|
||||
[gd_scene format=3 uid="uid://dgpkoccwlypct"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_seif5"]
|
||||
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_c6y48"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3s7f6ntc8lua" path="res://core/ai/agents/racoon/Raccoon_rig.fbx" id="2_obtl0"]
|
||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_x67t3"]
|
||||
|
||||
[node name="AiRacoon" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_seif5")]
|
||||
navigation_layers = 4
|
||||
anim_player = NodePath("Raccoon_rig/AnimationPlayer")
|
||||
entity_type = 7
|
||||
entity_name = "Racoon"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=445061494]
|
||||
script = ExtResource("2_c6y48")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
animation_name = "Raccoon_Idle"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="1" unique_id=1096336671]
|
||||
script = ExtResource("3_x67t3")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "Raccoon_walk"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Raccoon_rig" parent="." index="3" unique_id=338211330 instance=ExtResource("2_obtl0")]
|
||||
|
||||
[node name="Skeleton3D" parent="Raccoon_rig/Rig_Raccoon" parent_id_path=PackedInt32Array(338211330, 1450300070) index="0" unique_id=745849430]
|
||||
bones/1/position = Vector3(2.0224038e-08, 0.20926544, 0.2908604)
|
||||
bones/1/rotation = Quaternion(0.12769087, -0.6954821, -0.12769023, 0.69548184)
|
||||
bones/1/scale = Vector3(1, 0.99999994, 0.99999994)
|
||||
bones/2/position = Vector3(0.12958723, 0.07514775, -1.15517205e-08)
|
||||
bones/2/rotation = Quaternion(-8.768937e-08, -9.441525e-08, -0.59041584, 0.8070993)
|
||||
bones/2/scale = Vector3(0.99999994, 1, 1)
|
||||
bones/3/position = Vector3(0.22119753, 0.0069588325, 4.8590223e-08)
|
||||
bones/3/rotation = Quaternion(4.7472064e-08, -1.1799982e-07, 0.017411917, 0.9998484)
|
||||
bones/3/scale = Vector3(1, 0.99999994, 1)
|
||||
bones/4/position = Vector3(0.19968472, -0.07484539, -3.6076216e-08)
|
||||
bones/4/rotation = Quaternion(5.3009783e-09, 1.2681039e-07, 0.30337906, 0.95286995)
|
||||
bones/4/scale = Vector3(0.9999999, 0.9999999, 1)
|
||||
bones/5/position = Vector3(-1.6408816e-08, -2.420219e-08, 7.257661e-15)
|
||||
bones/5/rotation = Quaternion(5.51443e-16, 1.517952e-14, 4.7269896e-08, 1)
|
||||
bones/5/scale = Vector3(1.0000001, 1, 1)
|
||||
bones/7/position = Vector3(0.103939, -0.07868026, 2.3476135e-08)
|
||||
bones/7/rotation = Quaternion(9.0738554e-09, -1.3033788e-07, -0.40028542, 0.91639054)
|
||||
bones/7/scale = Vector3(1, 1, 1)
|
||||
bones/9/position = Vector3(0.11748607, -0.13258429, 0.069675714)
|
||||
bones/9/rotation = Quaternion(0.0004671751, -0.00044618634, -0.7121794, 0.7019972)
|
||||
bones/9/scale = Vector3(1, 1, 1)
|
||||
bones/10/position = Vector3(0.12467117, -0.0022201955, -2.8368248e-08)
|
||||
bones/10/rotation = Quaternion(5.363282e-08, 1.05591454e-07, 0.037125982, 0.9993106)
|
||||
bones/10/scale = Vector3(1, 1, 1)
|
||||
bones/11/position = Vector3(0.16112469, 0.046494268, -0.006244522)
|
||||
bones/11/rotation = Quaternion(-0.0120373955, -0.007822201, 0.46056247, 0.8875113)
|
||||
bones/11/scale = Vector3(1.0000001, 0.99999994, 1)
|
||||
bones/13/position = Vector3(0.117486075, -0.1325843, -0.0696799)
|
||||
bones/13/rotation = Quaternion(0.0004971096, -0.00088223023, -0.7120875, 0.70209)
|
||||
bones/13/scale = Vector3(0.9999999, 0.9999999, 1)
|
||||
bones/14/position = Vector3(0.12467118, -0.0022202404, -3.56783e-08)
|
||||
bones/14/rotation = Quaternion(5.3701754e-08, 1.05572354e-07, 0.037125997, 0.9993106)
|
||||
bones/14/scale = Vector3(1.0000001, 1.0000001, 1)
|
||||
bones/15/position = Vector3(0.16112465, 0.04649423, 0.0062444974)
|
||||
bones/15/rotation = Quaternion(0.016517976, 0.014013659, 0.46007556, 0.88761556)
|
||||
bones/15/scale = Vector3(0.9999999, 0.9999999, 1)
|
||||
bones/17/position = Vector3(0.04661899, 0.17346847, -1.18498086e-07)
|
||||
bones/17/rotation = Quaternion(2.770023e-07, 3.177246e-07, 0.99957025, -0.029315341)
|
||||
bones/17/scale = Vector3(1.000003, 1, 1)
|
||||
bones/18/position = Vector3(0.14637275, -0.04410621, -9.865532e-08)
|
||||
bones/18/rotation = Quaternion(-2.6851015e-07, -5.1783097e-08, -0.38697308, 0.92209107)
|
||||
bones/18/scale = Vector3(1, 0.99999994, 1)
|
||||
bones/19/position = Vector3(0.14074759, 0.012081423, -1.07438225e-07)
|
||||
bones/19/rotation = Quaternion(-5.266017e-08, 3.9203155e-07, -0.22906616, 0.9734109)
|
||||
bones/19/scale = Vector3(0.99999994, 1.0000001, 1)
|
||||
bones/21/position = Vector3(0.08406017, 0.07054766, -0.046703663)
|
||||
bones/21/rotation = Quaternion(2.472915e-07, 4.2034915e-07, 0.9653872, -0.26082113)
|
||||
bones/21/scale = Vector3(0.99999994, 1.0000001, 1)
|
||||
bones/22/position = Vector3(0.18519638, 0.014841081, -0.03856185)
|
||||
bones/22/rotation = Quaternion(-1.04219914e-07, 2.4218835e-07, -0.36804387, 0.92980844)
|
||||
bones/23/position = Vector3(0.09934621, 0.042793605, -0.011642947)
|
||||
bones/23/rotation = Quaternion(0.00024863242, 5.0840557e-05, 0.45848417, 0.88870263)
|
||||
bones/23/scale = Vector3(1, 0.9999999, 1)
|
||||
bones/24/position = Vector3(0.10396489, 0.016853496, -0.010173391)
|
||||
bones/24/rotation = Quaternion(9.3242754e-08, 2.4390525e-07, 0.5472883, 0.83694416)
|
||||
bones/24/scale = Vector3(1.0000001, 1.0000001, 1)
|
||||
bones/26/position = Vector3(0.08406015, 0.07054774, 0.046699274)
|
||||
bones/26/rotation = Quaternion(2.1619995e-07, 5.3543306e-07, 0.96538764, -0.2608197)
|
||||
bones/26/scale = Vector3(0.99999994, 1.0000001, 1)
|
||||
bones/27/position = Vector3(0.18519638, 0.014841113, 0.038561605)
|
||||
bones/27/rotation = Quaternion(-1.0420509e-07, 2.4219113e-07, -0.36804387, 0.92980844)
|
||||
bones/27/scale = Vector3(1, 0.9999999, 1)
|
||||
bones/28/position = Vector3(0.09934621, 0.04279366, 0.011642782)
|
||||
bones/28/rotation = Quaternion(-0.00015323279, -7.909327e-05, 0.45790946, 0.8889988)
|
||||
bones/28/scale = Vector3(0.9999999, 0.9999999, 1)
|
||||
bones/29/position = Vector3(0.10396492, 0.01685347, 0.0101733515)
|
||||
bones/29/rotation = Quaternion(6.860365e-08, 2.2637091e-07, 0.5472883, 0.83694416)
|
||||
bones/29/scale = Vector3(1.0000001, 1, 1)
|
||||
|
||||
[editable path="Raccoon_rig"]
|
||||
BIN
core/ai/agents/wagyu/Wagyu_rig.fbx
Normal file
BIN
core/ai/agents/wagyu/Wagyu_rig.fbx
Normal file
Binary file not shown.
4159
core/ai/agents/wagyu/Wagyu_rig.fbx.import
Normal file
4159
core/ai/agents/wagyu/Wagyu_rig.fbx.import
Normal file
File diff suppressed because it is too large
Load Diff
54
core/ai/agents/wagyu/ai_wagyu.tscn
Normal file
54
core/ai/agents/wagyu/ai_wagyu.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene format=3 uid="uid://cp8tf1uitoj57"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_01jto"]
|
||||
[ext_resource type="Script" uid="uid://d3hy70ec8vqo5" path="res://core/ai/framework/run_animation_state.gd" id="2_euyvm"]
|
||||
[ext_resource type="PackedScene" uid="uid://dg6eq5bjdv77x" path="res://core/ai/agents/wagyu/Wagyu_rig.fbx" id="2_kinfw"]
|
||||
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/framework/patrol_state.gd" id="3_stslt"]
|
||||
|
||||
[node name="AiWagyu" unique_id=1228675528 node_paths=PackedStringArray("anim_player") instance=ExtResource("1_01jto")]
|
||||
anim_player = NodePath("Wagyu_rig/AnimationPlayer")
|
||||
entity_type = 8
|
||||
entity_name = "Wagyu"
|
||||
|
||||
[node name="StateMachine" parent="." index="1" unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||
initial_state = NodePath("IdleState")
|
||||
|
||||
[node name="IdleState" type="Node" parent="StateMachine" index="0" unique_id=1768876006]
|
||||
script = ExtResource("2_euyvm")
|
||||
state_id = &"idle"
|
||||
next_state_id = &"patrol"
|
||||
animation_name = "wagyu_Idle"
|
||||
|
||||
[node name="PatrolState" type="Node" parent="StateMachine" index="1" unique_id=1424605081]
|
||||
script = ExtResource("3_stslt")
|
||||
state_id = &"patrol"
|
||||
next_state_id = &"idle"
|
||||
animation_name = "wagyu_walk"
|
||||
exit_on_action_finished = true
|
||||
|
||||
[node name="Wagyu_rig" parent="." index="3" unique_id=434062845 instance=ExtResource("2_kinfw")]
|
||||
|
||||
[node name="Skeleton3D" parent="Wagyu_rig/Rig_wagyu" parent_id_path=PackedInt32Array(434062845, 984050088) index="0" unique_id=1381831503]
|
||||
bones/1/position = Vector3(3.0605813e-06, 0.93198204, 1.5827273)
|
||||
bones/1/rotation = Quaternion(0.12769, -0.69548225, -0.12769146, 0.6954816)
|
||||
bones/2/rotation = Quaternion(-7.474808e-08, -1.0355375e-07, -0.5904155, 0.80709946)
|
||||
bones/3/rotation = Quaternion(4.6805877e-08, -1.1830556e-07, 0.017411785, 0.9998484)
|
||||
bones/4/rotation = Quaternion(1.771281e-08, 1.0884481e-07, 0.19398119, 0.9810053)
|
||||
bones/7/rotation = Quaternion(3.415823e-08, -6.211047e-10, -0.29438308, 0.9556875)
|
||||
bones/9/rotation = Quaternion(0.00046733156, -0.00044638076, -0.7121791, 0.7019975)
|
||||
bones/10/rotation = Quaternion(1.1991547e-07, 8.809733e-08, 0.037125666, 0.9993106)
|
||||
bones/11/rotation = Quaternion(-0.012037467, -0.007821967, 0.46056256, 0.88751113)
|
||||
bones/13/rotation = Quaternion(0.00049730047, -0.0008825069, -0.71208733, 0.7020902)
|
||||
bones/14/rotation = Quaternion(1.5469529e-07, -1.483681e-08, 0.037125666, 0.9993106)
|
||||
bones/15/rotation = Quaternion(0.016517892, 0.014014246, 0.46007577, 0.8876154)
|
||||
bones/17/rotation = Quaternion(9.343425e-08, 2.4610299e-07, 0.9818929, 0.18943687)
|
||||
bones/18/rotation = Quaternion(2.348474e-07, -1.7702094e-07, 0.3209432, 0.9470985)
|
||||
bones/19/rotation = Quaternion(2.0569273e-09, 2.3186735e-07, 0.008903695, 0.99996036)
|
||||
bones/21/rotation = Quaternion(3.5893487e-07, 1.1177136e-06, 0.9652683, -0.2612609)
|
||||
bones/22/rotation = Quaternion(-6.1835095e-07, -2.3081903e-07, -0.36804387, 0.92980844)
|
||||
bones/23/rotation = Quaternion(0.0002490793, 5.1833915e-05, 0.45848417, 0.88870263)
|
||||
bones/26/rotation = Quaternion(3.2779312e-07, 1.2327837e-06, 0.9652686, -0.2612597)
|
||||
bones/27/rotation = Quaternion(-6.191086e-07, -2.305114e-07, -0.36804327, 0.9298087)
|
||||
bones/28/rotation = Quaternion(-0.0001528551, -7.8230434e-05, 0.45790893, 0.8889991)
|
||||
|
||||
[editable path="Wagyu_rig"]
|
||||
64
core/ai/framework/fly_away_state.gd
Normal file
64
core/ai/framework/fly_away_state.gd
Normal file
@@ -0,0 +1,64 @@
|
||||
extends State
|
||||
|
||||
class_name FlyAwayState
|
||||
|
||||
@export var fly_speed: float = 6.0
|
||||
@export var fly_up_speed: float = 3.0
|
||||
@export var destroy_after_seconds: float = 8.0
|
||||
|
||||
var _timer: float = 0.0
|
||||
var _fly_direction: Vector3 = Vector3.UP
|
||||
|
||||
func enter() -> void:
|
||||
super.enter()
|
||||
run_animation()
|
||||
|
||||
# Disable NavigationAgent3D influence since we want manual flight
|
||||
agent.nav_agent.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
|
||||
var weather_nodes = get_tree().get_nodes_in_group("weather_node")
|
||||
var train_node = null
|
||||
for node in weather_nodes:
|
||||
if "Treno" in node.name or "Train" in node.name:
|
||||
train_node = node
|
||||
break
|
||||
|
||||
if not train_node:
|
||||
var train = get_tree().root.find_child("*Treno*", true, false)
|
||||
if train and train is Node3D:
|
||||
train_node = train
|
||||
else:
|
||||
train = get_tree().root.find_child("*Train*", true, false)
|
||||
if train and train is Node3D:
|
||||
train_node = train
|
||||
|
||||
if train_node:
|
||||
# Fly away from the train
|
||||
var dir_to_train = agent.global_position.direction_to(train_node.global_position)
|
||||
dir_to_train.y = 0
|
||||
if dir_to_train.length() > 0.1:
|
||||
_fly_direction = -dir_to_train.normalized()
|
||||
else:
|
||||
_fly_direction = -agent.global_transform.basis.z.normalized()
|
||||
else:
|
||||
# If no train found, just fly forward relative to current facing
|
||||
_fly_direction = -agent.global_transform.basis.z.normalized()
|
||||
|
||||
func physics_update(delta: float) -> void:
|
||||
_timer += delta
|
||||
if _timer >= destroy_after_seconds:
|
||||
agent.queue_free()
|
||||
return
|
||||
|
||||
var horizontal_vel = _fly_direction * fly_speed
|
||||
agent.velocity.x = horizontal_vel.x
|
||||
agent.velocity.y = fly_up_speed
|
||||
agent.velocity.z = horizontal_vel.z
|
||||
|
||||
# Rotate agent to face flight direction
|
||||
if horizontal_vel.length_squared() > 0.1:
|
||||
var look_dir = Vector3(agent.velocity.x, 0, agent.velocity.z)
|
||||
var target_transform = agent.global_transform.looking_at(agent.global_position - look_dir, Vector3.UP)
|
||||
agent.global_transform = agent.global_transform.interpolate_with(target_transform, delta * 5.0)
|
||||
|
||||
agent.move_and_slide()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user