5 Commits

75 changed files with 18025 additions and 253 deletions

BIN
assets/models/maps/lowpoly_tdm/lowpoly_tdm_1.glb (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/models/maps/lowpoly_tdm/lowpoly_tdm_1.glb.import (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/models/maps/lowpoly_tdm/lowpoly_tdm_2.glb (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/models/maps/lowpoly_tdm/lowpoly_tdm_2.glb.import (Stored with Git LFS) Normal file

Binary file not shown.

18
godot-jolt/LICENSE.txt Normal file
View File

@ -0,0 +1,18 @@
Copyright (c) Mikael Hermansson and Godot Jolt 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.

91
godot-jolt/THIRDPARTY.txt Normal file
View File

@ -0,0 +1,91 @@
Godot Jolt incorporates third-party material from the projects listed below.
Godot Engine (https://github.com/godotengine/godot)
Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md).
Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.
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.
godot-cpp (https://github.com/godot-jolt/godot-cpp)
Copyright (c) 2017-present Godot Engine contributors.
Copyright (c) 2022-present Mikael Hermansson.
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.
Jolt Physics (https://github.com/godot-jolt/jolt)
Copyright (c) 2021 Jorrit Rouwe.
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.
mimalloc (https://github.com/godot-jolt/mimalloc)
Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen.
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,41 @@
[godot-jolt]
version = "0.14.0-stable"
build = "3392156fab"
[configuration]
entry_symbol = "godot_jolt_main"
compatibility_minimum = "4.3"
compatibility_maximum = "4.3"
[libraries]
windows.release.single.x86_64 = "windows/godot-jolt_windows-x64.dll"
windows.debug.single.x86_64 = "windows/godot-jolt_windows-x64_editor.dll"
windows.release.single.x86_32 = "windows/godot-jolt_windows-x86.dll"
windows.debug.single.x86_32 = "windows/godot-jolt_windows-x86_editor.dll"
linux.release.single.x86_64 = "linux/godot-jolt_linux-x64.so"
linux.debug.single.x86_64 = "linux/godot-jolt_linux-x64_editor.so"
linux.release.single.x86_32 = "linux/godot-jolt_linux-x86.so"
linux.debug.single.x86_32 = "linux/godot-jolt_linux-x86_editor.so"
macos.release.single = "macos/godot-jolt_macos.framework"
macos.debug.single = "macos/godot-jolt_macos_editor.framework"
ios.release.single = "ios/godot-jolt_ios.framework"
ios.debug.single = "ios/godot-jolt_ios_editor.framework"
android.release.single.arm64 = "android/libgodot-jolt_android-arm64.so"
android.debug.single.arm64 = "android/libgodot-jolt_android-arm64_editor.so"
android.release.single.arm32 = "android/libgodot-jolt_android-arm32.so"
android.debug.single.arm32 = "android/libgodot-jolt_android-arm32_editor.so"
android.release.single.x86_64 = "android/libgodot-jolt_android-x64.so"
android.debug.single.x86_64 = "android/libgodot-jolt_android-x64_editor.so"
android.release.single.x86_32 = "android/libgodot-jolt_android-x86.so"
android.debug.single.x86_32 = "android/libgodot-jolt_android-x86_editor.so"

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>godot-jolt_ios</string>
<key>CFBundleName</key>
<string>Godot Jolt</string>
<key>CFBundleDisplayName</key>
<string>Godot Jolt</string>
<key>CFBundleIdentifier</key>
<string>org.godot-jolt.godot-jolt</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) Mikael Hermansson and Godot Jolt contributors.</string>
<key>CFBundleVersion</key>
<string>0.14.0</string>
<key>CFBundleShortVersionString</key>
<string>0.14.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CSResourcesFileMapped</key>
<true/>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<!--
HACK(mihe): This is to work around a bug in Godot 4.3-beta1, where it treats Framework
bundles the same as XCFramework bundles, and expects there to be an `AvailableLibraries`
entry, which is really only a thing in XCFramework bundles. Note that we also lie about the
binary path having a `.dylib` extension in order for Godot to correctly identify this as a
dynamically linked bundle.
-->
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>godot-jolt_ios.dylib</string>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>godot-jolt_ios_editor</string>
<key>CFBundleName</key>
<string>Godot Jolt</string>
<key>CFBundleDisplayName</key>
<string>Godot Jolt</string>
<key>CFBundleIdentifier</key>
<string>org.godot-jolt.godot-jolt</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) Mikael Hermansson and Godot Jolt contributors.</string>
<key>CFBundleVersion</key>
<string>0.14.0</string>
<key>CFBundleShortVersionString</key>
<string>0.14.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CSResourcesFileMapped</key>
<true/>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<!--
HACK(mihe): This is to work around a bug in Godot 4.3-beta1, where it treats Framework
bundles the same as XCFramework bundles, and expects there to be an `AvailableLibraries`
entry, which is really only a thing in XCFramework bundles. Note that we also lie about the
binary path having a `.dylib` extension in order for Godot to correctly identify this as a
dynamically linked bundle.
-->
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>godot-jolt_ios_editor.dylib</string>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>godot-jolt_macos</string>
<key>CFBundleName</key>
<string>Godot Jolt</string>
<key>CFBundleDisplayName</key>
<string>Godot Jolt</string>
<key>CFBundleIdentifier</key>
<string>org.godot-jolt.godot-jolt</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) Mikael Hermansson and Godot Jolt contributors.</string>
<key>CFBundleVersion</key>
<string>0.14.0</string>
<key>CFBundleShortVersionString</key>
<string>0.14.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CSResourcesFileMapped</key>
<true/>
<key>DTPlatformName</key>
<string>macosx</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Resources/Info.plist</key>
<data>
et0C7sxAlu4eIDcq2ihFQ2BhDSk=
</data>
</dict>
<key>files2</key>
<dict>
<key>Resources/Info.plist</key>
<dict>
<key>hash2</key>
<data>
ZnG0hD4DciikOVWrf1Ai1Qedz9hESuIFvUujZAebHRY=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>godot-jolt_macos_editor</string>
<key>CFBundleName</key>
<string>Godot Jolt</string>
<key>CFBundleDisplayName</key>
<string>Godot Jolt</string>
<key>CFBundleIdentifier</key>
<string>org.godot-jolt.godot-jolt</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) Mikael Hermansson and Godot Jolt contributors.</string>
<key>CFBundleVersion</key>
<string>0.14.0</string>
<key>CFBundleShortVersionString</key>
<string>0.14.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CSResourcesFileMapped</key>
<true/>
<key>DTPlatformName</key>
<string>macosx</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Resources/Info.plist</key>
<data>
oIAzxlQz4Hun6JnLVOu9jafYxGE=
</data>
</dict>
<key>files2</key>
<dict>
<key>Resources/Info.plist</key>
<dict>
<key>hash2</key>
<data>
FA6I/u5+Ww0DzXAvawYXs792eum+8Bim8uHBbg98jqY=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,8 +11,9 @@ config_version=5
[application]
config/name="Open Strike"
run/main_scene="res://scenes/utils/Menu.tscn"
run/main_scene="res://scenes/utils/menus/main/main_menu.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
run/max_fps=120
config/icon="res://icon.svg"
[autoload]
@ -25,6 +26,9 @@ window/size/viewport_width=1920
window/size/viewport_height=1964
window/size/mode=4
window/size/borderless=true
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
window/vsync/vsync_mode=2
[filesystem]
@ -34,6 +38,7 @@ import/blender/enabled=false
body=""
target=""
player_placeholder=""
[input]
@ -90,6 +95,7 @@ crouch={
[physics]
3d/physics_engine="JoltPhysics3D"
3d/default_gravity=15.0
[rendering]

View File

@ -1,8 +1,11 @@
extends Node3D
var owner_placeholder: CharacterBody3D = null
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$Body/Armature/Skeleton3D.physical_bones_start_simulation()
owner_placeholder = _get_owner()
pass # Replace with function body.
@ -12,5 +15,27 @@ func _process(delta: float) -> void:
func _on_head_collision_body_part_hit(dam: Variant) -> void:
print("head is hit")
#print("head is hit" + str(dam))
#print(owner_placeholder)
#if owner_placeholder.has_method("take_damage"):
if owner_placeholder:
owner_placeholder.take_damage(dam)
pass # Replace with function body.
func _get_owner() -> CharacterBody3D:
var owner_placeholder := find_parent("PlayerPlaceholder*")
return owner_placeholder
func die():
for child in $Body/Armature/Skeleton3D/PhysicalBoneSimulator3D.get_children():
if child is PhysicalBone3D:
child.collision_layer = 1
child.collision_mask = 1
$Body/Armature/Skeleton3D.physical_bones_stop_simulation()
$Body/Armature/Skeleton3D/PhysicalBoneSimulator3D.physical_bones_start_simulation()
func make_invisible():
$Body/Armature/Skeleton3D/Alpha_Joints.set_layer_mask_value(1, false)
$Body/Armature/Skeleton3D/Alpha_Surface.set_layer_mask_value(1, false)
$Body/Armature/Skeleton3D/Alpha_Joints.set_layer_mask_value(2, true)
$Body/Armature/Skeleton3D/Alpha_Surface.set_layer_mask_value(2, true)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=4 uid="uid://1txob6jskn5s"]
[gd_scene load_steps=28 format=4 uid="uid://1txob6jskn5s"]
[ext_resource type="Script" path="res://scenes/characters/blue/dummy.gd" id="1_cyeub"]
[ext_resource type="Script" path="res://scenes/characters/blue/head_collision.gd" id="1_lianf"]
@ -258,9 +258,70 @@ blend_shape_mode = 0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_j3emx"]
albedo_color = Color(0, 0, 1, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_k5bjr"]
radius = 11.245
height = 27.8
[sub_resource type="SphereShape3D" id="SphereShape3D_axep3"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_0ptuo"]
radius = 11.7055
height = 28.953
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_126jt"]
radius = 3.944
height = 12.926
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1gw5y"]
radius = 10.779
height = 24.58
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_krlof"]
radius = 2.74047
height = 27.4047
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2k34c"]
radius = 2.76145
height = 27.6145
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_5fgdh"]
radius = 5.286
height = 20.647
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8vkyv"]
radius = 2.74047
height = 27.4047
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fh1k4"]
radius = 2.76144
height = 27.6144
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1m8r5"]
radius = 5.286
height = 20.647
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3cygo"]
radius = 4.05994
height = 40.5994
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vwdij"]
radius = 4.2099
height = 42.099
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qyg6j"]
radius = 1.57216
height = 15.7216
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_a81km"]
radius = 4.05995
height = 40.5995
[sub_resource type="CylinderShape3D" id="CylinderShape3D_2binp"]
height = 42.0
radius = 3.0
[sub_resource type="CylinderShape3D" id="CylinderShape3D_l2il6"]
height = 27.0
radius = 1.75
[sub_resource type="SphereShape3D" id="SphereShape3D_wnhib"]
radius = 1.2
[sub_resource type="Animation" id="Animation_6g1lc"]
resource_name = "Run Forward"
@ -867,7 +928,7 @@ _data = {
}
[node name="Dummy" type="Node3D"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
transform = Transform3D(-1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1, 0, 0, 0)
script = ExtResource("1_cyeub")
[node name="Body" type="Node3D" parent="."]
@ -1048,7 +1109,7 @@ bones/24/name = "mixamorig_LeftHandRing2"
bones/24/parent = 23
bones/24/rest = Transform3D(1, 1.61871e-05, -9.45085e-08, -1.61871e-05, 1, 3.29224e-06, 9.45618e-08, -3.29224e-06, 1, 6.3543e-07, 3.60118, -1.47875e-05)
bones/24/enabled = true
bones/24/position = Vector3(-3.30613e-06, 3.60119, 1.50863e-07)
bones/24/position = Vector3(-3.30613e-06, 3.60119, 1.50864e-07)
bones/24/rotation = Quaternion(0.563924, -3.30111e-07, -0.0577891, 0.823803)
bones/24/scale = Vector3(1, 1, 1)
bones/25/name = "mixamorig_LeftHandRing3"
@ -1077,7 +1138,7 @@ bones/28/parent = 27
bones/28/rest = Transform3D(1, 0.000736602, -7.57697e-07, -0.000736602, 1, 9.24707e-06, 7.64508e-07, -9.24651e-06, 1, 1.0844e-06, 4.13666, 1.41886e-05)
bones/28/enabled = true
bones/28/position = Vector3(-9.08385e-06, 4.13665, 5.47372e-06)
bones/28/rotation = Quaternion(0.433129, -6.53828e-07, -0.0443853, 0.900239)
bones/28/rotation = Quaternion(0.433129, -6.53827e-07, -0.0443853, 0.900239)
bones/28/scale = Vector3(1, 1, 1)
bones/29/name = "mixamorig_LeftHandPinky3"
bones/29/parent = 28
@ -1126,7 +1187,7 @@ bones/35/parent = 34
bones/35/rest = Transform3D(0.894428, 0.447212, -8.12113e-07, -0.387297, 0.774597, -0.500001, -0.223606, 0.447215, 0.866025, 3.00297, 3.7888, 2.16716)
bones/35/enabled = true
bones/35/position = Vector3(3.00297, 3.7888, 2.16716)
bones/35/rotation = Quaternion(0.227577, -0.0598799, -0.162411, 0.958252)
bones/35/rotation = Quaternion(0.227577, -0.0598799, -0.162411, 0.958251)
bones/35/scale = Vector3(1, 1, 1)
bones/36/name = "mixamorig_RightHandThumb2"
bones/36/parent = 35
@ -1210,14 +1271,14 @@ bones/47/parent = 34
bones/47/rest = Transform3D(1, 9.66599e-06, -1.40744e-07, -9.66599e-06, 1, -2.81994e-06, 1.40717e-07, 2.81994e-06, 1, -2.21663, 12.147, -0.00999829)
bones/47/enabled = true
bones/47/position = Vector3(-2.21664, 12.147, -0.00998812)
bones/47/rotation = Quaternion(0.0911117, 0.11369, 0.100504, 0.984211)
bones/47/rotation = Quaternion(0.0911117, 0.11369, 0.100504, 0.984212)
bones/47/scale = Vector3(1, 1, 1)
bones/48/name = "mixamorig_RightHandRing2"
bones/48/parent = 47
bones/48/rest = Transform3D(1, -1.60845e-05, 3.26056e-09, 1.60845e-05, 1, 1.32059e-06, -3.2818e-09, -1.32059e-06, 1, -2.50026e-07, 3.6012, -7.75122e-07)
bones/48/enabled = true
bones/48/position = Vector3(-2.50026e-07, 3.6012, -7.75122e-07)
bones/48/rotation = Quaternion(0.836665, 8.70473e-07, 0.068157, 0.543457)
bones/48/rotation = Quaternion(0.836665, 8.70474e-07, 0.068157, 0.543457)
bones/48/scale = Vector3(1, 1, 1)
bones/49/name = "mixamorig_RightHandRing3"
bones/49/parent = 48
@ -1301,14 +1362,14 @@ bones/60/parent = 0
bones/60/rest = Transform3D(-0.999981, -0.00611455, -7.52684e-05, 0.00611501, -0.999901, -0.0126672, 2.1931e-06, -0.0126674, 0.99992, -9.12503, -6.6556, -0.0553527)
bones/60/enabled = true
bones/60/position = Vector3(-9.12503, -6.6556, -0.0553527)
bones/60/rotation = Quaternion(-0.0339456, 0.334676, 0.92684, -0.166754)
bones/60/rotation = Quaternion(-0.0339455, 0.334676, 0.92684, -0.166754)
bones/60/scale = Vector3(1, 1, 1)
bones/61/name = "mixamorig_RightLeg"
bones/61/parent = 60
bones/61/rest = Transform3D(0.99993, -0.0118315, -0.000580536, 0.0118448, 0.999271, 0.0362854, 0.000150802, -0.0362897, 0.999341, 3.28565e-07, 40.5995, 1.49012e-08)
bones/61/enabled = true
bones/61/position = Vector3(3.28565e-07, 40.5995, 1.49012e-08)
bones/61/rotation = Quaternion(-0.581827, -0.0846291, -0.0166473, 0.808727)
bones/61/rotation = Quaternion(-0.581827, -0.0846291, -0.0166473, 0.808726)
bones/61/scale = Vector3(1, 1, 1)
bones/62/name = "mixamorig_RightFoot"
bones/62/parent = 61
@ -1344,7 +1405,7 @@ surface_material_override/0 = SubResource("StandardMaterial3D_j3emx")
[node name="HitCollisions" type="Node3D" parent="Body/Armature/Skeleton3D"]
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="Body/Armature/Skeleton3D"]
transform = Transform3D(0.978017, -0.176546, -0.110972, 0.15839, 0.282801, 0.94601, -0.135631, -0.942791, 0.304547, -11.8203, 17.7472, -135.936)
transform = Transform3D(0.978017, -0.176546, -0.110973, 0.15839, 0.282801, 0.946011, -0.135631, -0.942791, 0.304547, -11.8203, 17.7472, -135.936)
bone_name = "mixamorig_Head"
bone_idx = 5
@ -1352,10 +1413,265 @@ bone_idx = 5
transform = Transform3D(9.90229, 1.3945, -6.09554e-08, 0, -4.37114e-07, -10, -1.3945, 9.90229, -4.32843e-07, 0.58762, 7.43451, 1.4646)
script = ExtResource("1_lianf")
[node name="Collision" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/BoneAttachment3D/HeadCollision"]
shape = SubResource("CapsuleShape3D_k5bjr")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/BoneAttachment3D/HeadCollision"]
shape = SubResource("SphereShape3D_axep3")
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Body/Armature/Skeleton3D/BoneAttachment3D"]
[node name="PhysicalBoneSimulator3D" type="PhysicalBoneSimulator3D" parent="Body/Armature/Skeleton3D"]
[node name="Physical Bone mixamorig_Hips" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(82.5044, -54.0559, -16.4615, 55.0482, 83.4649, 1.8195, 12.756, -10.5629, 98.619, 1.31498, 0.290624, -87.4646)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.35312e-08, -5.58794e-09, 0.0499956)
body_offset = Transform3D(100, -0.0695305, -0.00860751, -1.19209e-05, 12.2744, -99.2438, 0.0700493, 99.2438, 12.2744, 0.00043869, 4.96175, -0.613665)
mass = 20.0
bone_name = "mixamorig_Hips"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_Hips"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0.0161502, -2.32831e-11, 1.01774e-18)
shape = SubResource("CapsuleShape3D_0ptuo")
[node name="Physical Bone mixamorig_Spine" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(80.9412, -58.546, -4.56913, 57.6046, 80.6695, -13.1964, 11.4119, 8.0493, 99.0201, 2.40599, 0.973749, -98.2036)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.2222e-09, 2.2377e-09, 0.05866)
body_offset = Transform3D(100, 7.62939e-06, 9.05991e-06, 4.76837e-06, -1.90735e-06, -100, -1.52588e-05, 100, -3.8147e-06, -9.53674e-07, 5.866, 0)
mass = 20.0
bone_name = "mixamorig_Spine"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_Spine"]
transform = Transform3D(0.0318071, 3.86358e-14, 4.9738e-14, -2.13163e-14, -1.62981e-09, 0.0318071, -4.26326e-14, -0.0318071, -1.62981e-09, -0.00245133, -5.91656e-09, -0.223859)
shape = SubResource("CapsuleShape3D_126jt")
[node name="Physical Bone mixamorig_Head" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-97.8019, 4.47329, 20.366, -15.8369, -79.4709, -58.5966, 13.5638, -60.5339, 78.4325, -13.8193, 23.4986, -143.635)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.90306e-08, -1.39698e-07, 0.0981531)
body_offset = Transform3D(-100, -0.00220013, -0.000778198, -5.24521e-06, 33.8066, -94.1122, 0.00232792, -94.1122, -33.8066, 7.24792e-05, 9.23741, 3.31821)
mass = 7.0
bone_name = "mixamorig_Head"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_Head"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_1gw5y")
[node name="Physical Bone mixamorig_LeftArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(86.1165, 14.0252, -48.8594, -45.4995, 64.1262, -61.787, 22.6659, 75.4396, 61.6046, 16.1942, 31.0309, -132.592)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.65892e-08, 2.39336e-07, 0.137023)
body_offset = Transform3D(100, -3.05176e-05, -2.67029e-05, 2.09808e-05, 100, -7.62939e-06, 1.71661e-05, -3.8147e-06, 100, 0, -2.28882e-05, -13.7023)
mass = 3.0
bone_name = "mixamorig_LeftArm"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftArm"]
transform = Transform3D(0.01, 0, 0, 0, 0.00997432, -0.000716193, 0, 0.000716193, 0.00997432, 4.61853e-15, 0.165399, 0.142978)
shape = SubResource("CapsuleShape3D_krlof")
[node name="Physical Bone mixamorig_LeftForeArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-48.2566, -12.058, 86.752, -78.7312, -37.4258, -48.997, 38.3757, -91.9452, 8.56699, 1.36485, 46.9033, -104.66)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.47239e-07, 6.31263e-08, 0.138072)
body_offset = Transform3D(100, 3.05176e-05, -4.19617e-05, -3.8147e-05, 0, -100, -3.8147e-06, 100, 9.53674e-06, 3.05176e-05, 13.8072, -7.62939e-06)
mass = 3.0
bone_name = "mixamorig_LeftForeArm"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftForeArm"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_2k34c")
[node name="Physical Bone mixamorig_LeftHand" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(9.11563, -98.6768, 13.4089, 23.9481, -10.8976, -96.4766, 96.6612, 12.0056, 22.6379, -10.9685, 56.2242, -106.442)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.24797e-07, -1.22003e-07, 0.0264902)
body_offset = Transform3D(-58.5197, 57.9894, 56.6805, 1.62125e-05, 69.899, -71.5132, -81.0891, -41.8493, -40.9047, -1.50148, 1.89441, 1.08356)
bone_name = "mixamorig_LeftHand"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftHand"]
transform = Transform3D(0.01, 0, 0, 0, 0.00697578, 0.00716509, 0, -0.00716509, 0.00697578, 9.31323e-12, 0.0631712, -0.0648856)
shape = SubResource("CapsuleShape3D_5fgdh")
[node name="Physical Bone mixamorig_RightArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(30.7246, 72.8896, 61.1809, 93.7855, -34.092, -6.48192, 16.1331, 59.3704, -78.8345, -27.5296, -1.29566, -110.13)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.63344e-08, 1.16326e-07, 0.137023)
body_offset = Transform3D(100, -5.72205e-06, 1.19209e-05, 6.67572e-06, 1.07288e-05, -100, -1.90735e-06, 100, 2.64645e-05, 0, 13.7023, -1.52588e-05)
mass = 3.0
bone_name = "mixamorig_RightArm"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightArm"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_8vkyv")
[node name="Physical Bone mixamorig_RightForeArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(24.3552, 37.4063, 89.4852, -25.0101, 91.5653, -31.4688, -93.7087, -14.716, 31.6563, -48.2682, 3.93749, -103.698)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.40737e-07, -2.80688e-08, 0.138072)
body_offset = Transform3D(100, -1.14441e-05, 8.58307e-06, -3.8147e-06, 100, 9.53674e-06, 5.72205e-06, -5.72205e-06, 100, -1.52588e-05, 1.49012e-06, -13.8072)
mass = 3.0
bone_name = "mixamorig_RightForeArm"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightForeArm"]
transform = Transform3D(0.01, 0, 0, 0, 0.00999714, -0.000239087, 0, 0.000239087, 0.00999714, 2.23821e-15, 0.145694, 0.138911)
shape = SubResource("CapsuleShape3D_fh1k4")
[node name="Physical Bone mixamorig_RightHand" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(89.0767, -24.8074, -38.0781, 5.05123, 88.6726, -45.9527, 45.1645, 39.0097, 80.2397, -24.5746, 26.0951, -105.517)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.86265e-08, 2.31434e-07, 0.0264903)
body_offset = Transform3D(-58.5197, -57.9893, -56.6805, -1.19209e-05, 69.8991, -71.5131, 81.0891, -41.8492, -40.9048, 1.5015, 1.89439, 1.08359)
bone_name = "mixamorig_RightHand"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightHand"]
transform = Transform3D(0.01, 0, 0, 0, 0.00693402, 0.00720551, 0, -0.00720551, 0.00693402, -3.72529e-11, 0.0680192, -0.0706824)
shape = SubResource("CapsuleShape3D_1m8r5")
[node name="Physical Bone mixamorig_LeftUpLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-96.1774, -26.2683, 7.73901, -23.4203, 64.2554, -72.957, 14.1919, -71.9807, -67.9513, 5.83707, 19.601, -60.9754)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.78612e-08, -7.74374e-09, 0.202997)
body_offset = Transform3D(100, -2.86102e-05, 9.53674e-06, 7.62939e-06, 7.62939e-06, -100, 3.71933e-05, 100, 3.8147e-06, -5.72205e-06, 20.2997, 0)
mass = 5.0
bone_name = "mixamorig_LeftUpLeg"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftUpLeg"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_3cygo")
[node name="Physical Bone mixamorig_LeftLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-97.5216, -11.6193, -18.8291, -22.0483, 58.1427, 78.3154, 1.84805, 80.5259, -59.2635, 8.22949, 17.9261, -34.7068)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.03053e-09, -1.30455e-08, 0.210495)
body_offset = Transform3D(100, 4.76837e-06, 1.33514e-05, 5.72205e-06, 0, -100, -9.53674e-07, 100, 1.52588e-05, -1.90735e-06, 21.0495, -1.90735e-06)
mass = 5.0
bone_name = "mixamorig_LeftLeg"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftLeg"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_vwdij")
[node name="Physical Bone mixamorig_LeftFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-93.6712, -34.5296, 5.78095, -34.9451, 91.207, -21.4506, 2.13418, -22.1132, -97.501, 11.7385, 3.12728, -14.5678)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.66258e-09, 5.6483e-08, 0.078608)
body_offset = Transform3D(100, 5.72205e-06, -2.38419e-06, -2.86102e-06, -1.52588e-05, -100, -5.72205e-06, 100, -3.24249e-05, 9.53674e-07, 7.8608, -3.09944e-06)
bone_name = "mixamorig_LeftFoot"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_LeftFoot"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_qyg6j")
[node name="Physical Bone mixamorig_RightUpLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-83.6898, -51.5224, 18.4786, -50.5592, 59.8312, -62.161, 20.9708, -61.3651, -76.122, -11.4062, 7.37456, -61.646)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31228e-08, 7.74372e-09, 0.202997)
body_offset = Transform3D(100, -1.52588e-05, 7.62939e-06, 5.72205e-06, -3.8147e-06, -100, 1.14441e-05, 100, -3.8147e-06, -2.86102e-06, 20.2997, 0)
mass = 5.0
bone_name = "mixamorig_RightUpLeg"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightUpLeg"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_a81km")
[node name="Physical Bone mixamorig_RightLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-91.8175, -23.5086, -31.8888, -36.0103, 83.0805, 42.437, 16.517, 50.4478, -84.7479, -8.44487, 11.0604, -28.3544)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.27453e-09, -2.4944e-07, 0.210495)
body_offset = Transform3D(100, -1.71661e-05, 1.33514e-05, -9.53674e-07, 4.19617e-05, -100, 1.90735e-05, 100, 6.86646e-05, -3.33786e-06, 21.0495, 1.04904e-05)
mass = 5.0
bone_name = "mixamorig_RightLeg"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightLeg"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CylinderShape3D_2binp")
[node name="Physical Bone mixamorig_RightFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-88.192, -17.3351, 43.8367, -46.8549, 42.4444, -77.4796, -5.17505, -88.8705, -45.5549, -5.17837, 8.21811, -6.93437)
collision_layer = 4
collision_mask = 4
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.24153e-08, -2.70381e-09, 0.078608)
body_offset = Transform3D(100, 1.14441e-05, -7.62939e-06, -7.62939e-06, -1.90735e-05, -100, 0, 100, -5.72205e-05, 5.84126e-06, 7.8608, 4.76837e-06)
bone_name = "mixamorig_RightFoot"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_RightFoot"]
transform = Transform3D(0.01, 1.50737e-10, 9.12129e-10, 0, 0.00258819, 0.00965926, -4.42378e-09, -0.00965926, 0.00258819, 6.02947e-10, 0.0103528, -0.038637)
shape = SubResource("CylinderShape3D_l2il6")
[node name="Collision" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(9.83936, 0.264962, 1.76546, 0.249217, 9.58855, -2.82801, -1.76775, 2.82658, 9.42791, -12.7207, 21.3283, -142.579)
shape = SubResource("SphereShape3D_wnhib")
[node name="AnimationPlayer" type="AnimationPlayer" parent="Body"]
libraries = {

View File

@ -1,16 +1,17 @@
extends Area3D
@export var damage: int = 100
@export var damage_multiplexer: float = 2.0
signal body_part_hit(dam)
signal body_part_hit(damage: int)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func hit():
emit_signal("body_part_hit", damage)
func hit(base_damage: int):
var final_damage = round(base_damage * damage_multiplexer)
emit_signal("body_part_hit", final_damage)

View File

@ -1,19 +1,23 @@
[gd_scene load_steps=9 format=3 uid="uid://b10lpwfjgxds4"]
[gd_scene load_steps=11 format=3 uid="uid://b10lpwfjgxds4"]
[ext_resource type="Script" path="res://scripts/player/player_input_controller.gd" id="1_q75ai"]
[ext_resource type="Texture2D" uid="uid://oopj5mj1vdp0" path="res://assets/crosshairs/crosshair_default.png" id="2_lsd7c"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jc50w"]
radius = 0.3
margin = 0.5
radius = 0.4
height = 1.6
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_tl74a"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/spawn = false
properties/0/replication_mode = 1
properties/1/path = NodePath(".:rotation")
properties/1/spawn = true
properties/1/spawn = false
properties/1/replication_mode = 1
properties/2/path = NodePath(".:health")
properties/2/spawn = false
properties/2/replication_mode = 2
[sub_resource type="Animation" id="Animation_falg4"]
length = 0.001
@ -72,6 +76,13 @@ _data = {
"shooting": SubResource("Animation_ah507")
}
[sub_resource type="LabelSettings" id="LabelSettings_toaij"]
font_size = 70
[sub_resource type="LabelSettings" id="LabelSettings_1j1uq"]
font_size = 100
font_color = Color(0.756874, 0, 0.223924, 1)
[node name="CharacterPlaceholder" type="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.799455, 0)
collision_layer = 9
@ -79,13 +90,14 @@ collision_mask = 9
script = ExtResource("1_q75ai")
[node name="Collision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0150437, 0)
shape = SubResource("CapsuleShape3D_jc50w")
[node name="PlayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_tl74a")
[node name="FirstPersonCameraMount" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.609154, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.609154, -0.209324)
[node name="Camera" type="Camera3D" parent="FirstPersonCameraMount"]
fov = 40.0
@ -96,6 +108,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0,
[node name="AimRay" type="RayCast3D" parent="FirstPersonCameraMount/BulletStartingPoint"]
target_position = Vector3(0, 0, 1000)
hit_from_inside = true
collide_with_areas = true
[node name="GunMount" type="Node3D" parent="FirstPersonCameraMount"]
@ -130,5 +143,23 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_lsd7c")
[node name="HealthIndicator" type="Label" parent="FirstPersonCameraMount/HUD"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -23.0
offset_right = 40.0
grow_vertical = 0
text = "100"
label_settings = SubResource("LabelSettings_toaij")
[node name="FPS" type="Label" parent="FirstPersonCameraMount/HUD" groups=["player_placeholder"]]
layout_mode = 1
offset_right = 40.0
offset_bottom = 23.0
text = "0"
label_settings = SubResource("LabelSettings_1j1uq")
[node name="ModelMount" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.790262, 0)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
extends Node
# This script shoud be able to find the player
var players: Dictionary = {}
func spawn_a_bullet():
# -- Get
pass
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var world: MapController = find_parent("Map")
# Get all the players on the server and add
# corresponding nodes to them
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@ -0,0 +1,8 @@
[gd_scene format=3 uid="uid://sh5diukewgs5"]
[node name="BulletSpawner" type="Node3D"]
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
spawn_path = NodePath("../Node3D")
[node name="Node3D" type="Node3D" parent="."]

View File

@ -0,0 +1,84 @@
class_name MapController extends Node
@export_category("MapController")
const PLAYER_SPAWNER: String = "res://scenes/maps/base/player_spawner/player_spawner.tscn"
const OBJECT_SPAWNER: String = "res://scenes/maps/base/object_spawner/object_spawner.tscn"
var player_spawner: PlayerSpawnerController
var object_spawner: Node3D
@onready var spawn_locations: SpawnController = $SpawnLocations
func _on_player_connected(id):
if multiplayer.is_server():
GameServerManager.load_map.rpc_id(id, GameServerManager.current_map)
# add the player to the
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# add player spawner
var err: Error = OK
err = _add_player_spawner()
if err != OK:
print("Couldn't load player spawner")
err = _add_object_spawner()
if err != OK:
print("Couldn't load object spawner")
# add objects spawner
if multiplayer.is_server():
_spawn_player(1)
else:
_request_spawn.rpc_id(1, multiplayer.get_unique_id())
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
@rpc("call_local", "reliable", "any_peer")
func _request_spawn(id: int):
_spawn_player(id)
func _spawn_player(id: int):
var char : Node3D = null
player_spawner.spawn_players(spawn_locations, id)
func _add_player_spawner() -> Error :
if not ResourceLoader.exists(PLAYER_SPAWNER):
return ERR_DOES_NOT_EXIST
var scene: PackedScene = ResourceLoader.load(PLAYER_SPAWNER)
if not scene.can_instantiate():
return ERR_CANT_OPEN
var node: Node3D = scene.instantiate()
add_child(node)
player_spawner = node
return OK
func _add_object_spawner() -> Error :
if not ResourceLoader.exists(OBJECT_SPAWNER):
return ERR_DOES_NOT_EXIST
var scene: PackedScene = ResourceLoader.load(OBJECT_SPAWNER)
if not scene.can_instantiate():
return ERR_CANT_OPEN
var node: Node3D = scene.instantiate()
add_child(node)
object_spawner = node
return OK
var bullet_amount: int = 0
func spawn_bullet(starting_point: Node3D, speed: int, damage: int):
var node: Node3D = ResourceLoader.load("res://scenes/weapon/bullet.tscn").instantiate()
node.position = starting_point.global_position
node.transform.basis = starting_point.global_transform.basis
node.name = str(bullet_amount)
node.speed = speed
node.damage = damage
bullet_amount += 1
var spawner: MultiplayerSpawner = object_spawner.find_child("MultiplayerSpawner")
var root_node: Node3D = object_spawner.find_child("Objects")
spawner.spawn(node)
root_node.add_child(node)

View File

@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://b0k17hibnhnv4"]
[node name="ObjectSpawner" type="Node3D"]
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
spawn_path = NodePath("../Objects")
spawn_limit = 10000
[node name="Objects" type="Node3D" parent="."]

View File

@ -0,0 +1,33 @@
class_name PlayerSpawnerController extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _get_spawner() -> MultiplayerSpawner:
return $MultiplayerSpawner
func _get_root() -> Node3D:
return $Players
# -- Spawn a player node and sync it across all peers
func spawn_players(spawn_location: SpawnController, id: int) -> Error:
if multiplayer.is_server():
var char : Node3D = null
var player_data: PlayerState = GameServerManager.players[id]
char = ResourceLoader.load("res://scenes/characters/placeholder.tscn").instantiate()
char.name = "PlayerPlaceholder_" + str(player_data.id)
print(player_data)
var position = spawn_location.get_spawner(SpawnController.Sides.BLUE)
char.global_position = position
char.global_position = position
#_get_spawner().spawn(char)
_get_root().add_child(char)
return OK
return ERR_UNAUTHORIZED

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://xh710fr73bid"]
[ext_resource type="Script" path="res://scenes/maps/base/player_spawner/player_spawner.gd" id="1_2hsyd"]
[node name="PlayerSpawner" type="Node3D"]
script = ExtResource("1_2hsyd")
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("res://scenes/characters/placeholder.tscn")
spawn_path = NodePath("../Players")
spawn_limit = 10
[node name="Players" type="Node3D" parent="."]

View File

@ -0,0 +1,11 @@
extends Node3D
var busy: bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func choose_spawn_location() -> Vector3:
busy = true
return global_position

View File

@ -0,0 +1,52 @@
class_name SpawnController extends Node3D
@export_category("SpawnController")
@onready var blue_spawners: Node3D = $Blue
@onready var red_spawners: Node3D = $Red
const SINGLE_SPAWN_CONTROLLER_PATH = "res://scenes/maps/base/single_spawn_controller.gd"
enum Sides {BLUE, RED, UNDEFINED}
@export var side: Sides = Sides.UNDEFINED
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var single_spawn_controller: GDScript = ResourceLoader.load(SINGLE_SPAWN_CONTROLLER_PATH)
for spawn: Node3D in blue_spawners.get_children():
spawn.set_script(single_spawn_controller)
for spawn: Node3D in red_spawners.get_children():
spawn.set_script(single_spawn_controller)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _get_available_spawn(spawn_set: Node3D) -> Node3D:
if multiplayer.is_server():
var spawns: Array[Node3D] = []
for spawn: Node3D in spawn_set.get_children():
if not spawn.busy:
spawns.push_back(spawn)
print(spawns.size())
var random_index: int = randi_range(0, spawns.size() - 1)
print(random_index)
return spawns[random_index]
return null
func get_spawner(team: Sides) -> Vector3:
match team:
Sides.BLUE:
var spawn := _get_available_spawn(blue_spawners)
return spawn.choose_spawn_location()
Sides.RED:
print("red")
return Vector3(0,0,0)
_:
print("хз")
return Vector3(0,0,0)
# Get all spawners for each team

View File

@ -1,32 +0,0 @@
extends Node3D
var player_side: String
@onready var intro_camera = $Intro/CameraMount/IntroCamera
@onready var intro_view_port = $Intro/CameraMount/IntroCamera/SubViewportContainer/SubViewport
@onready var spawns = $Spawns
@onready var root = $'.'
@onready var players = $Players
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var char : Node3D = null
var red_spawn: Node3D = $Spawns/Blue/SpawnArea
var position := red_spawn.global_position
if multiplayer.is_server():
for i in GameServerManager.players:
char = ResourceLoader.load("res://scenes/characters/placeholder.tscn").instantiate()
char.name = str(GameServerManager.players[i].name)
char.global_position = position
var my_random_number = RandomNumberGenerator.new().randf_range(0.0, 5.0)
char.global_position = position
char.global_position.x += my_random_number
char.global_position.y += 300 + my_random_number
char.global_position.z += my_random_number
$MultiplayerSpawner.spawn(char)
players.add_child(char)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@ -1,24 +0,0 @@
extends Node3D
var target_node_name: String = "TargetNode" # Name of the Node3D to detect
@onready var raycast : RayCast3D = $CameraMount/Camera3D/RayCast3D
@onready var camera : Camera3D = $CameraMount/Camera3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var blue := $ChooseTeam/Blue
var red := $ChooseTeam/Read
if
if raycast.is_colliding():
var collider = raycast.get_collider()
if collider and collider.name == target_node_name:
print("Mouse is pointing at:", collider.name)
else:
print("Mouse is not pointing at the target node.")
else:
print("Mouse is not pointing at anything.")

View File

@ -1,15 +1,59 @@
[gd_scene load_steps=81 format=4 uid="uid://c1v6kb00y77ij"]
[ext_resource type="Script" path="res://scenes/maps/el_test.gd" id="1_d5e7i"]
[ext_resource type="Texture2D" uid="uid://60qg81svnxfd" path="res://assets/models/maps/el_test_Image_0.png" id="2_o6seo"]
[ext_resource type="Texture2D" uid="uid://blj7gvw33u8qd" path="res://assets/models/maps/el_test_Image_1.png" id="3_7c4ej"]
[ext_resource type="Texture2D" uid="uid://to0g5ktan37x" path="res://assets/models/maps/el_test_Image_2.png" id="4_03be1"]
[ext_resource type="Script" path="res://scenes/maps/csg_box_3d.gd" id="5_3oqpw"]
[ext_resource type="Texture2D" uid="uid://60qg81svnxfd" path="res://assets/models/maps/el_test_Image_0.png" id="2_hsvct"]
[ext_resource type="Texture2D" uid="uid://blj7gvw33u8qd" path="res://assets/models/maps/el_test_Image_1.png" id="3_1mmpv"]
[ext_resource type="Texture2D" uid="uid://to0g5ktan37x" path="res://assets/models/maps/el_test_Image_2.png" id="4_r2n1c"]
[sub_resource type="GDScript" id="GDScript_fyi6q"]
script/source = "extends Node3D
var player_side: String
@onready var intro_camera = $Intro/CameraMount/IntroCamera
@onready var intro_view_port = $Intro/CameraMount/IntroCamera/SubViewportContainer/SubViewport
@onready var spawns = $Spawns
@onready var root = $'.'
@onready var players = $Players
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var char : Node3D = null
var red_spawn: Node3D = $Spawns/Blue/SpawnArea
var position := red_spawn.global_position
if multiplayer.is_server():
for i in GameServerManager.players:
char = ResourceLoader.load(\"res://scenes/characters/placeholder.tscn\").instantiate()
char.name = \"PlayerPlaceholder_\" + str(GameServerManager.players[i].name)
char.global_position = position
var my_random_number = RandomNumberGenerator.new().randf_range(0.0, 5.0)
char.global_position = position
char.global_position.x += my_random_number
char.global_position.y += 300 + my_random_number
char.global_position.z += my_random_number
$MultiplayerSpawner.spawn(char)
players.add_child(char)
var bullet_amount: int = 0
func spawn_bullet(starting_point: Node3D, speed: int, damage: int):
var node: Node3D = ResourceLoader.load(\"res://scenes/weapon/bullet.tscn\").instantiate()
node.position = starting_point.global_position
node.transform.basis = starting_point.global_transform.basis
node.name = str(bullet_amount)
node.speed = speed
node.damage = damage
bullet_amount += 1
#$BulletSpawner.spawn(node)
$Bullets.add_child(node)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
"
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1on1b"]
resource_name = "Orange_Playground_Base_Color"
cull_mode = 2
albedo_texture = ExtResource("2_o6seo")
albedo_texture = ExtResource("2_hsvct")
roughness = 0.6
[sub_resource type="ArrayMesh" id="ArrayMesh_q7wvg"]
@ -365,7 +409,7 @@ data = PackedVector3Array(-500, 400, 600, -500, 400, 0, 0, 400, 0, 0, 0, 0, -500
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_om6jd"]
resource_name = "Orange_Playground_Base_Color_1"
cull_mode = 2
albedo_texture = ExtResource("2_o6seo")
albedo_texture = ExtResource("2_hsvct")
roughness = 0.6
[sub_resource type="ArrayMesh" id="ArrayMesh_fmd3a"]
@ -651,7 +695,7 @@ data = PackedVector3Array(0, 400, -500, 0, 400, 200, -500, 400, 200, -500, 0, 20
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pvao0"]
resource_name = "Black_1"
cull_mode = 2
albedo_texture = ExtResource("3_7c4ej")
albedo_texture = ExtResource("3_1mmpv")
roughness = 0.6
[sub_resource type="ArrayMesh" id="ArrayMesh_ge1ay"]
@ -692,7 +736,7 @@ data = PackedVector3Array(100, 0, 100, 0, 100, 100, 100, 100, 100, 100, 0, 100,
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oplpo"]
resource_name = "Black_2"
cull_mode = 2
albedo_texture = ExtResource("4_03be1")
albedo_texture = ExtResource("4_r2n1c")
roughness = 0.6
[sub_resource type="ArrayMesh" id="ArrayMesh_lnk4o"]
@ -835,13 +879,41 @@ shadow_mesh = SubResource("ArrayMesh_s0g2b")
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_1uclv"]
data = PackedVector3Array(0, 0, 100, -100, 100, 100, 0, 100, 100, 0, 0, 100, -100, 0, 100, -100, 100, 100, -100, 0, 100, -100, 100, 0, -100, 100, 100, -100, 0, 100, -100, 0, 0, -100, 100, 0, -100, 0, 0, 0, 100, 0, -100, 100, 0, -100, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 100, 100, 0, 100, 0, 0, 0, 0, 0, 0, 100, 0, 100, 100, 0, 100, 100, -100, 100, 0, 0, 100, 0, 0, 100, 100, -100, 100, 100, -100, 100, 0, 0, 0, 0, -100, 0, 100, 0, 0, 100, 0, 0, 0, -100, 0, 0, -100, 0, 100)
[sub_resource type="Environment" id="Environment_ru18i"]
glow_enabled = true
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0rtro"]
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_vtlae"]
[sub_resource type="GDScript" id="GDScript_js4tj"]
script/source = "extends CSGBox3D
var health = 5
@export var color: Color = Color(0, 0, 0)
var colors = [Color(1.0, 0.0, 0.0, 1.0),
Color(0.0, 1.0, 0.0, 1.0),
Color(0.0, 0.0, 1.0, 0.0)]
func take_damage():
color = Color(randf(), randf(), randf())
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
material_override.albedo_color = color
if health < 1:
queue_free()
"
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_bhqft"]
properties/0/path = NodePath("CSGBox3D:color")
properties/0/spawn = true
properties/0/replication_mode = 1
[node name="ElTest" type="Node3D"]
script = ExtResource("1_d5e7i")
script = SubResource("GDScript_fyi6q")
[node name="Light" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.508004, 0.861354, 0, -0.861354, 0.508004, 0, 2.97783, 2.62213)
@ -1165,8 +1237,12 @@ shape = SubResource("ConcavePolygonShape3D_1uclv")
[node name="CSGBox3D" type="CSGBox3D" parent="Map" groups=["target"]]
transform = Transform3D(1, 0, 0, 0, 1.48122, 0, 0, 0, 1, 2.17806, 1.80141, 0)
material_override = SubResource("StandardMaterial3D_0rtro")
use_collision = true
script = ExtResource("5_3oqpw")
script = SubResource("GDScript_js4tj")
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="Map"]
replication_config = SubResource("SceneReplicationConfig_bhqft")
[node name="Spawns" type="Node3D" parent="."]
@ -1190,6 +1266,9 @@ spawn_limit = 4
[node name="Players" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.72051, 0)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_ru18i")
camera_attributes = SubResource("CameraAttributesPractical_vtlae")
[node name="Bullets" type="Node3D" parent="."]
[node name="Objects" type="Node3D" parent="."]
[node name="ObjectsSpawner" type="MultiplayerSpawner" parent="."]
spawn_path = NodePath("../Objects")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,76 +0,0 @@
[gd_scene load_steps=14 format=3 uid="uid://hivk5ek6u887"]
[ext_resource type="Texture2D" uid="uid://c5uytbu1wc1bq" path="res://addons/kenney_prototype_textures/orange/texture_09.png" id="1_llm1c"]
[ext_resource type="Texture2D" uid="uid://e4nd8b6f0tw7" path="res://addons/kenney_prototype_textures/dark/texture_04.png" id="2_k2arh"]
[ext_resource type="PackedScene" uid="uid://1j5ajc26w5xk" path="res://scenes/utils/character_bak.tscn" id="3_6anfg"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bcdcw"]
albedo_texture = ExtResource("1_lae2b")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p4psn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0jiki"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1pwnn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1yo6k"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_3aaun"]
[sub_resource type="Sky" id="Sky_xco2g"]
sky_material = SubResource("ProceduralSkyMaterial_3aaun")
[sub_resource type="Environment" id="Environment_5t2t5"]
background_mode = 2
sky = SubResource("Sky_xco2g")
sdfgi_enabled = true
fog_light_energy = 0.52
fog_density = 0.1387
volumetric_fog_enabled = true
volumetric_fog_density = 0.0
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_32hnm"]
[node name="TestMap" type="Node3D"]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 50, 0)
[node name="World" type="Node3D" parent="."]
[node name="Base" type="Node3D" parent="World"]
[node name="Floor" type="CSGBox3D" parent="World/Base"]
use_collision = true
size = Vector3(100, 1, 100)
[node name="Wall_1" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 50, 0, 0)
material_override = SubResource("StandardMaterial3D_p4psn")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_2" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -50, 0, 0)
material_override = SubResource("StandardMaterial3D_0jiki")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_3" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 50)
material_override = SubResource("StandardMaterial3D_1pwnn")
use_collision = true
size = Vector3(100, 20, 1)
[node name="Wall_4" type="CSGBox3D" parent="World/Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -50)
material_override = SubResource("StandardMaterial3D_1yo6k")
use_collision = true
size = Vector3(100, 20, 1)
[node name="Character" parent="World" instance=ExtResource("3_6anfg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 14.6432, 0)

View File

@ -0,0 +1,14 @@
class_name PlayerState extends Object
@export_category("PlayerState")
# -- Player's metadata
var name: String
var id: int
# -- Player's in-game data
var health: int
var current_weapon_slot: int
func init(id: int, name: String):
id = id
name = name

View File

@ -35,6 +35,21 @@ offset_right = 224.0
offset_bottom = 220.0
text = "Join"
[node name="TextEdit" type="TextEdit" parent="."]
layout_mode = 0
offset_left = 238.0
offset_top = 151.0
offset_right = 497.0
offset_bottom = 220.0
text = "192.168.0.28"
[node name="Maps" type="ItemList" parent="."]
layout_mode = 0
offset_left = 995.0
offset_top = 111.0
offset_right = 1595.0
offset_bottom = 624.0
[connection signal="player_connected" from="." to="." method="_on_player_connected"]
[connection signal="player_disconnected" from="." to="." method="_on_player_disconnected"]
[connection signal="server_disconnected" from="." to="." method="_on_server_disconnected"]

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bo8jemggniu3c"]
[ext_resource type="PackedScene" uid="uid://c1v6kb00y77ij" path="res://scenes/maps/el_test.tscn" id="1_25xw6"]
[ext_resource type="PackedScene" uid="uid://c1v6kb00y77ij" path="res://scenes/maps/maps/el_test.tscn" id="1_25xw6"]
[node name="ChooseTeam" type="Node3D"]

View File

@ -1,18 +1,11 @@
extends Node3D
const SPEED = 715
@onready var mesh = $Object_10
extends Control
@onready =
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, SPEED) * delta
func _on_timer_timeout():
queue_free()
func _process(delta: float) -> void:
pass

View File

@ -0,0 +1,55 @@
[gd_scene load_steps=5 format=3 uid="uid://c137wl6ls3knx"]
[ext_resource type="Script" path="res://scenes/utils/in_game_hud.gd" id="1_sttf0"]
[ext_resource type="Texture2D" uid="uid://oopj5mj1vdp0" path="res://assets/crosshairs/crosshair_default.png" id="2_fjr6q"]
[sub_resource type="LabelSettings" id="LabelSettings_ds4qb"]
font_size = 70
[sub_resource type="LabelSettings" id="LabelSettings_vhjwu"]
font_size = 100
font_color = Color(0.756874, 0, 0.223924, 1)
[node name="InGameHud" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_sttf0")
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -28.0
offset_top = -36.0
offset_right = 44.0
offset_bottom = 36.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_fjr6q")
[node name="HealthIndicator" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = -96.0
offset_right = 128.0
grow_vertical = 0
text = "100"
label_settings = SubResource("LabelSettings_ds4qb")
[node name="FPS" type="Label" parent="." groups=["player_placeholder"]]
layout_mode = 1
offset_left = 8.0
offset_right = 65.0
offset_bottom = 137.0
text = "0"
label_settings = SubResource("LabelSettings_vhjwu")

View File

@ -10,7 +10,7 @@ signal server_disconnected
const PORT = 7000
const DEFAULT_SERVER_IP = "127.0.0.1" # IPv4 localhost
const MAX_CONNECTIONS = 20
@onready var address_input: TextEdit = $TextEdit
var players = {}
var my_random_number = RandomNumberGenerator.new().randf_range(-2.0, 2.0)
var player_info = {"name": str(my_random_number)}
@ -24,9 +24,16 @@ func _ready() -> void:
multiplayer.connection_failed.connect(_on_connected_fail)
multiplayer.server_disconnected.connect(_on_server_disconnected)
var map_dir := DirAccess.open("res://scenes/maps/maps/")
if map_dir:
map_dir.list_dir_begin()
var file_name = map_dir.get_next()
while file_name != "":
$Maps.add_item(file_name)
file_name = map_dir.get_next()
func join_game(address = ""):
if address.is_empty():
address = DEFAULT_SERVER_IP
address = address_input.text
var peer = ENetMultiplayerPeer.new()
var error = peer.create_client(address, PORT)
if error:
@ -51,7 +58,12 @@ func remove_multiplayer_peer():
# do Lobby.load_game.rpc(filepath)
@rpc("call_local", "reliable")
func load_game():
get_tree().change_scene_to_file("res://scenes/maps/el_test.tscn")
var chosen_map_index = $Maps.get_selected_items()[0]
var chosen_map = $Maps.get_item_text(chosen_map_index)
print(chosen_map)
var path_tmpl := "res://scenes/maps/maps/%s"
var path := path_tmpl % chosen_map
get_tree().change_scene_to_file(path)
# Every peer will call this when they have loaded the game scene.
@rpc("any_peer", "call_local", "reliable")
@ -66,7 +78,7 @@ func player_loaded():
# When a peer connects, send them my player info.
# This allows transfer of all desired data for each player, not only the unique ID.
func _on_player_connected(id):
player_info = {"name": multiplayer.get_unique_id()}
player_info = {"name": multiplayer.get_unique_id(), "health": 100}
_register_player.rpc_id(1, multiplayer.get_unique_id(), player_info)
@rpc("any_peer", "reliable")
@ -104,7 +116,7 @@ func _on_server_disconnected():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _on_host_pressed() -> void:
player_info = {"name": str(1)}
player_info = {"name": str(1), "health": 100}
_register_player(1, player_info)
create_game()

View File

@ -0,0 +1,60 @@
extends Node
var player_manager: PlayerManager = PlayerManager.new()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var map_dir := DirAccess.open("res://scenes/maps/maps/")
if map_dir:
map_dir.list_dir_begin()
var file_name = map_dir.get_next()
while file_name != "":
$UI/CreateServer/Maps.add_item(file_name)
file_name = map_dir.get_next()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_create_server_pressed() -> void:
$UI/CreateServer.visible = true
func _on_join_server_pressed() -> void:
$UI/JoinServer.visible = true
func _on_create_button_pressed() -> void:
var chosen_map_index = $UI/CreateServer/Maps.get_selected_items()[0]
var chosen_map = $UI/CreateServer/Maps.get_item_text(chosen_map_index)
var path_tmpl := "res://scenes/maps/maps/%s"
var path := path_tmpl % chosen_map
GameServerManager.current_map = path
var err := GameServerManager.create_server(player_manager)
if err != OK:
print("couldn't create a server")
$UI.hide()
change_level.call_deferred(load(path))
# Call this function deferred and only on the main authority (server).
func change_level(scene: PackedScene):
# Remove old level if any.
var level = $LevelLoader/CurrentLevel
for c in level.get_children():
level.remove_child(c)
c.queue_free()
# Add new level.
level.add_child(scene.instantiate())
func _on_text_edit_text_changed() -> void:
player_manager.name = $UI/TextEdit.text
func _on_join_button_pressed() -> void:
$UI.hide()
GameServerManager.join_server(player_manager, $UI/JoinServer/IP.text, $UI/JoinServer/Port.text.to_int())

View File

@ -0,0 +1,145 @@
[gd_scene load_steps=2 format=3 uid="uid://s48rpcadnn47"]
[ext_resource type="Script" path="res://scenes/utils/menus/main/main_menu.gd" id="1_yi7ba"]
[node name="MainMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_yi7ba")
[node name="LevelLoader" type="Node3D" parent="."]
[node name="CurrentLevel" type="Node3D" parent="LevelLoader"]
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="LevelLoader"]
_spawnable_scenes = PackedStringArray("res://scenes/maps/maps/lowpoly_tdm_2.tscn")
spawn_path = NodePath("../CurrentLevel")
spawn_limit = 1
[node name="UI" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="MainButtons" type="Control" parent="UI"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
[node name="CreateServer" type="Button" parent="UI/MainButtons"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -4.0
offset_right = 4.0
offset_bottom = 8.0
grow_horizontal = 2
text = "Create Server"
[node name="JoinServer" type="Button" parent="UI/MainButtons"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = 90.0
offset_top = 3.0
offset_right = 203.0
offset_bottom = 34.0
grow_horizontal = 2
text = "Join Server"
[node name="CreateServer" type="Control" parent="UI"]
visible = false
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -512.0
grow_horizontal = 0
grow_vertical = 2
[node name="Maps" type="ItemList" parent="UI/CreateServer"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -214.0
offset_top = -905.0
offset_right = 234.0
offset_bottom = -386.0
grow_horizontal = 2
grow_vertical = 2
[node name="CreateButton" type="Button" parent="UI/CreateServer"]
layout_mode = 0
offset_left = 236.0
offset_top = 643.0
offset_right = 282.0
offset_bottom = 674.0
text = "Start"
[node name="JoinServer" type="Control" parent="UI"]
visible = false
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -567.0
grow_horizontal = 0
grow_vertical = 2
[node name="JoinButton" type="Button" parent="UI/JoinServer"]
layout_mode = 0
offset_left = 205.0
offset_top = 187.0
offset_right = 251.0
offset_bottom = 218.0
text = "Start"
[node name="IP" type="TextEdit" parent="UI/JoinServer"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -240.5
offset_right = 240.5
offset_bottom = 58.0
grow_horizontal = 2
text = "127.0.0.1"
[node name="Port" type="TextEdit" parent="UI/JoinServer"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -230.0
offset_top = 69.0
offset_right = 228.0
offset_bottom = 129.0
grow_horizontal = 2
text = "27015"
[node name="TextEdit" type="TextEdit" parent="UI"]
layout_mode = 1
offset_right = 481.0
offset_bottom = 58.0
text = "Player Name"
[connection signal="pressed" from="UI/MainButtons/CreateServer" to="." method="_on_create_server_pressed"]
[connection signal="pressed" from="UI/MainButtons/JoinServer" to="." method="_on_join_server_pressed"]
[connection signal="pressed" from="UI/CreateServer/CreateButton" to="." method="_on_create_button_pressed"]
[connection signal="pressed" from="UI/JoinServer/JoinButton" to="." method="_on_join_button_pressed"]
[connection signal="text_changed" from="UI/TextEdit" to="." method="_on_text_edit_text_changed"]

View File

@ -1,7 +1,7 @@
extends Node3D
const SPEED = 715
@export var speed: int = 0
@export var damage: int = 0
@onready var mesh = $RigidBody3D/MeshInstance3D
@onready var rigid_body_3d: RigidBody3D = $RigidBody3D
@onready var ray = $RigidBody3D/RayCast3D
@ -14,12 +14,19 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, SPEED) * delta
var time_per_frame: float = 1 / Engine.get_frames_per_second()
var distance: float = time_per_frame * speed * 1.5
ray.target_position.z = distance
position += transform.basis * Vector3(0, 0, speed) * delta
rigid_body_3d.set_use_continuous_collision_detection(true)
#ray.collision_mask = 1
#ray.enabled = 1
ray.target_position.z = SPEED / Engine.get_frames_per_second()
if ray.is_colliding():
var collider = ray.get_collider()
if collider != null and collider.is_in_group("target"):
ray.get_collider().take_damage()
if collider != null and collider.is_in_group("body"):
ray.get_collider().hit(damage)
rigid_body_3d.visible = false
particles.emitting = true
#if ray.get_collider().is_in_group("body"):

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://b0agqeg53tey5"]
[gd_scene load_steps=9 format=3 uid="uid://b0agqeg53tey5"]
[ext_resource type="Script" path="res://scenes/weapon/bullet.gd" id="1_th28m"]
@ -30,7 +30,16 @@ linear_accel_max = 6.67
[sub_resource type="BoxMesh" id="BoxMesh_mfkmi"]
size = Vector3(0.05, 0.05, 0.05)
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_b8q4c"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/replication_mode = 0
properties/1/path = NodePath(".:rotation")
properties/1/spawn = true
properties/1/replication_mode = 0
[node name="Bullet" type="Node3D"]
transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, 0, 0, 0)
script = ExtResource("1_th28m")
[node name="RigidBody3D" type="RigidBody3D" parent="."]
@ -62,11 +71,14 @@ shape = SubResource("CylinderShape3D_l3sdq")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.18476)
material_override = SubResource("StandardMaterial3D_ynv38")
emitting = false
amount = 10
amount = 100
lifetime = 6.29
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_58cgi")
draw_pass_1 = SubResource("BoxMesh_mfkmi")
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_b8q4c")
[connection signal="timeout" from="RigidBody3D/Timer" to="." method="_on_timer_timeout"]

View File

@ -0,0 +1,55 @@
class_name WeaponController extends Node3D
@export_category("WeaponController")
# ---------------------------------------------------------------------
# Main weapon params
# ---------------------------------------------------------------------
@export var damage: int = 0
# cooldown interval in seconds
@export var cooldown: float = 0
# bullet speed in m/s
@export var bullet_speed: int = 0
@export var bullet_spread_script: Resource
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if bullet_spread_script:
bullet_spread_script = bullet_spread_script.new()
bullet_spread_script.reset_spread()
@onready var bullet_trace_distance: Node3D = $BulletTraceDistance
@onready var bullet_trail_end: Node3D = $BulletTrailEnd
func shoot() -> Error:
var bullet_start_node: Node3D = bullet_trace_distance.find_child("Start")
var bullet_end_node: Node3D = bullet_trace_distance.find_child("End")
if bullet_start_node and bullet_end_node:
var direction: Vector3 = bullet_end_node.position
if bullet_spread_script:
var spread_offset: Vector3 = bullet_spread_script.get_spread_offset()
direction += spread_offset
direction = direction.normalized()
var path := "res://scenes/weapon/misc/bullet_trail_generic.tscn"
if not ResourceLoader.exists(path):
return ERR_DOES_NOT_EXIST
var scene: PackedScene = ResourceLoader.load(path)
if not scene.can_instantiate():
return ERR_CANT_OPEN
var bullet_distance: float = 100
var bullet_end_position: Vector3 = bullet_start_node.position + direction * bullet_distance
var node: MeshInstance3D = scene.instantiate()
node.init(bullet_start_node.position, bullet_end_position)
#var root := get_tree().get_root()
bullet_start_node.add_child(node)
return OK
else:
push_warning("Couldn't generate a bullet trace, no distance node found")
return ERR_BUG
# -- TODO: It should not be hardcoded
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func reset_spread() -> void:
if bullet_spread_script:
bullet_spread_script.reset_spread()

View File

@ -1,6 +1,4 @@
[gd_scene load_steps=5 format=4 uid="uid://dn6imke7vnimn"]
[ext_resource type="Script" path="res://scenes/weapon/guns/ak/bullet.gd" id="1_rbbkb"]
[gd_scene load_steps=4 format=4 uid="uid://dn6imke7vnimn"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ledbj"]
resource_name = "stell"
@ -45,7 +43,6 @@ shadow_mesh = SubResource("ArrayMesh_mgmay")
[node name="Bullet" type="Node3D"]
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
script = ExtResource("1_rbbkb")
[node name="Object_10" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)

View File

@ -0,0 +1,35 @@
class_name BulletSpread extends Resource
@export var max_spread: float = 5.0
@export var spread_increase_per_shot: float = 0.5
var current_spread: float = 0.0
var shot_count: int = 0
var spread_y : float = 0
var spread_x: float = 0
var last_y_spread: float = 0 # remember y cord for 9th shot
func reset_spread() -> void:
current_spread = 0.0
shot_count = 0
# To get offset for current shot
func get_spread_offset() -> Vector3:
# Increasing spread after each shot
current_spread = min(current_spread + spread_increase_per_shot, max_spread)
shot_count += 1
# If its a 1 shot
if shot_count == 1:
return Vector3.ZERO
if shot_count < 10:
spread_x = randf_range(-current_spread, current_spread) * (shot_count - 1)
spread_y = current_spread * (shot_count - 1)
if shot_count == 9: last_y_spread = spread_y
else:
spread_x = randf_range(-current_spread, current_spread) * 10
spread_y = randf_range(last_y_spread - 10, last_y_spread + 10)
return Vector3(spread_x, spread_y, 0)

View File

@ -1,10 +0,0 @@
extends MeshInstance3D
var trail_length = 2.0
var speed = 10.0
func _process(delta):
global_transform.origin += transform.basis.z * speed * delta
scale.x = max(scale.x - delta, 100)
scale.y = max(scale.y - delta, 100)
scale.z = max(scale.z - delta, 100)

View File

@ -6,7 +6,6 @@ func _ready() -> void:
pass # Replace with function body.
@onready var bullet_trace_distance: Node3D = $BulletTraceDistance
@onready var bullet_trail_end: Node3D = $BulletTrailEnd
func shoot() -> Error:
var bullet_start_node: Node3D = bullet_trace_distance.find_child("Start")
var bullet_end_node: Node3D = bullet_trace_distance.find_child("End")
@ -19,9 +18,9 @@ func shoot() -> Error:
return ERR_CANT_OPEN
var node: MeshInstance3D = scene.instantiate()
node.init(bullet_start_node.global_position, bullet_end_node.global_position)
var root := get_tree().get_root()
root.add_child(node)
node.init(bullet_start_node.position, bullet_end_node.position)
#var root := get_tree().get_root()
bullet_start_node.add_child(node)
return OK
else:
push_warning("Couldn't generate a bullet trace, no distance node found")

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=55 format=4 uid="uid://dtvo21mk1webd"]
[gd_scene load_steps=56 format=4 uid="uid://dtvo21mk1webd"]
[ext_resource type="Script" path="res://scenes/weapon/guns/ak/with_hands.gd" id="1_2iqts"]
[ext_resource type="PackedScene" uid="uid://dab7jttp7ywfh" path="res://scenes/weapon/guns/ak/gun.tscn" id="1_aaafm"]
[ext_resource type="Script" path="res://scenes/weapon/generic_weapon_controller.gd" id="1_h1xyo"]
[ext_resource type="Script" path="res://scenes/weapon/guns/ak/bullet_spread.gd" id="2_4o3my"]
[ext_resource type="PackedScene" uid="uid://bjyltbtx45cqs" path="res://scenes/weapon/misc/bullet_trace_distance.tscn" id="3_5ff4y"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tg27p"]
@ -553,7 +554,11 @@ blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_he3sr")
[node name="WithHands" type="Node3D"]
script = ExtResource("1_2iqts")
script = ExtResource("1_h1xyo")
damage = 50
cooldown = 0.1
bullet_speed = 200
bullet_spread_script = ExtResource("2_4o3my")
[node name="Gun" parent="." instance=ExtResource("1_aaafm")]

View File

@ -1,6 +1,7 @@
extends MeshInstance3D
func init(pos1, pos2):
var alpha = 1.0
func init(pos1: Vector3, pos2: Vector3):
var draw_mesh := ImmediateMesh.new()
mesh = draw_mesh
draw_mesh.surface_begin(Mesh.PRIMITIVE_LINES, material_override)
@ -10,12 +11,15 @@ func init(pos1, pos2):
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var dup_material = material_override.duplicate()
material_override = dup_material
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
alpha -= delta * 3.5
material_override.albedo_color.a = alpha
func _on_timer_timeout() -> void:

View File

@ -3,9 +3,12 @@
[ext_resource type="Script" path="res://scenes/weapon/misc/bullet_trail_generic.gd" id="1_k8eg1"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ybqvs"]
albedo_color = Color(0.934388, 0.967243, 0.955863, 1)
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 2.7
transparency = 1
albedo_color = Color(0.300204, 0.908317, 1.54018e-06, 0.458824)
emission_enabled = true
emission = Color(0.454139, 0.861507, 0, 1)
emission_energy_multiplier = 16.0
distance_fade_min_distance = 2.0
[node name="BulletTrailGeneric" type="MeshInstance3D"]
material_override = SubResource("StandardMaterial3D_ybqvs")

View File

@ -1,11 +1,76 @@
extends Node
var players = {}
var current_map: String = ""
var local_player_health = 0
var player_state_global: PlayerState = PlayerState.new()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@rpc("reliable", "call_local")
func get_player_health(id: int) -> int:
return players.get(id)["health"]
func _on_connected_ok():
var player_state := PlayerState.new()
register_player.rpc_id(1, multiplayer.get_unique_id(), player_state_global.name)
@rpc("any_peer", "reliable", "call_remote")
func register_player(id: int, name: String):
var player_state := PlayerState.new()
player_state.id = id
player_state.name = name
players[multiplayer.get_remote_sender_id()] = player_state
func _on_player_connected(id):
pass
#if multiplayer.is_server():
#GameServerManager.load_map.rpc_id(id, GameServerManager.current_map)
func _ready() -> void:
multiplayer.peer_connected.connect(_on_player_connected)
multiplayer.connected_to_server.connect(_on_connected_ok)
print("started")
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func set_map(name: String):
current_map = name
func create_server(player_data: PlayerManager) -> Error:
var peer = ENetMultiplayerPeer.new()
var err = peer.create_server(27015, 30)
if err:
return err
multiplayer.multiplayer_peer = peer
if DisplayServer.get_name() != "headless":
var player_state := PlayerState.new()
player_state.id = 1
player_state.name = player_data.name
players[1] = player_state
return OK
func join_server(player_data: PlayerManager, ip: String, port: int) -> Error:
var peer = ENetMultiplayerPeer.new()
var err = peer.create_client("127.0.0.1", 27015)
if err != OK:
return err
player_state_global.id = multiplayer.get_remote_sender_id()
player_state_global.name = player_data.name
multiplayer.multiplayer_peer = peer
register_player.rpc_id(1, player_state_global)
return OK
@rpc("authority", "call_remote")
func load_map(map: String):
get_tree().change_scene_to_file(map)
func request_data_from_client(id: int):
send_data_to_server.rpc_id(id)
@rpc("any_peer", "call_remote")
func send_data_to_server():
pass

View File

@ -3,7 +3,8 @@
# ---------------------------------------------------------------------
class_name PlayerInput extends CharacterBody3D
var health: int = 100
@export var health: int = 100
@export_category("PlayerInput")
@ -16,6 +17,7 @@ var mouse_captured: bool = false
@onready var first_view_camera_mount: Node3D = $FirstPersonCameraMount
@onready var first_view_camera: Camera3D = $FirstPersonCameraMount/Camera
@onready var model_mount: Node3D = $ModelMount
var model: Node3D = null
# -- This node is supposed to be spawned per player, and since each
# -- player has an id, it is used for giving a node a name. So we can
@ -38,38 +40,66 @@ func _ready() -> void:
var err := _add_first_view_model()
if err != OK:
print("Error occured: " + str(err))
_enable_camera()
else:
var err := _add_world_model()
err = _add_legs_to_first_view()
if err != OK:
print("Error occured: " + str(err))
var world_model := _add_world_model()
if world_model == null:
print("Error occured: " + "couldn't load the world model")
_enable_camera()
else:
var world_model := _add_world_model()
if world_model == null:
print("Error occured: " + "couldn't load the world model")
_hide_camera_mount()
_capture_mouse()
# -- Add a world model to the player, that should be seen by other players
# -- on the server
func _add_world_model() -> Error :
func _add_world_model() -> Node3D :
# -- TODO: It should not be hardcoded
var path := "res://scenes/characters/blue/dummy.tscn"
if not ResourceLoader.exists(path):
return ERR_DOES_NOT_EXIST
push_error(ERR_DOES_NOT_EXIST)
return null
var scene: PackedScene = ResourceLoader.load(path)
if not scene.can_instantiate():
return ERR_CANT_OPEN
push_error(ERR_CANT_OPEN)
return null
var node: Node3D = scene.instantiate()
model = node
model_mount.add_child(node)
return OK
if _is_current_player():
node.make_invisible()
first_view_camera.cull_mask &= ~(1 << 1)
return node
func _hide_camera_mount():
first_view_camera_mount.visible = 0
hud.visible = 0
func make_node_invisible_for_camera(node: Node3D, camera: Camera3D):
if node and camera:
# Set the node to Layer 2 (or any other layer you want)
node.visibility_layer = 1 << 1 # Assign the node to Layer 2
# Disable Layer 2 on the camera's culling mask (this makes it invisible to this camera)
camera.cull_mask &= ~(1 << 1) # Disable Layer 2 on this camera
var current_gun: String = "ak"
@onready var gun_mount: Node3D = $FirstPersonCameraMount/GunMount
@onready var gun_mount_anim: AnimationPlayer = $FirstPersonCameraMount/GunMount/AnimationPlayer
var gun_with_hands: Node3D = null
# -- Add the first person view to pthe player
func _add_first_view_model() -> Error :
# -- TODO: It should not be hardcoded
# Define a format string with placeholder '%s'
var path_tmpl := "res://scenes/weapon/guns/%s/with_hands.tscn"
var path := path_tmpl % current_gun
print(path)
if not ResourceLoader.exists(path):
return ERR_DOES_NOT_EXIST
var scene: PackedScene = ResourceLoader.load(path)
@ -78,10 +108,37 @@ func _add_first_view_model() -> Error :
var node: Node3D = scene.instantiate()
node.scale = Vector3(0.03,0.03,0.03)
node.position = Vector3(0.02, -0.03, -0.07)
current_weapon_bullet_speed = node.bullet_speed
current_weapon_cooldown_interwal = node.cooldown
current_weapon_damage = node.damage
gun_with_hands = node
gun_mount.add_child(node)
return OK
var first_view_legs_anim: AnimationPlayer = null
# -- Add a world model to the player, that should be seen by other players
# -- on the server
func _add_legs_to_first_view() -> Error :
# -- TODO: It should not be hardcoded
var path := "res://scenes/characters/blue/dummy.tscn"
if not ResourceLoader.exists(path):
return ERR_DOES_NOT_EXIST
var scene: PackedScene = ResourceLoader.load(path)
if not scene.can_instantiate():
return ERR_CANT_OPEN
var node: Node3D = scene.instantiate()
var skeleton: Skeleton3D = node.find_child("Skeleton3D")
var bone := skeleton.find_bone("mixamorig_Spine")
if bone != -1:
skeleton.set_bone_pose_scale(bone, Vector3(0, 0, 0))
model_mount.add_child(node)
var animation_node: AnimationPlayer = node.find_child("AnimationPlayer")
if animation_node != null:
first_view_legs_anim = animation_node
return OK
func _enable_camera():
first_view_camera.make_current()
@ -112,7 +169,7 @@ var jump_vel: Vector3 # Jumping velocity
@export_range(0.1, 3.0, 0.1) var jump_height: float = 1 # m
@export_range(0.1, 3.0, 0.1, "or_greater") var camera_sens: float = 1
var is_shooting: bool = false
func _unhandled_input(event: InputEvent) -> void:
if _is_current_player():
if event is InputEventMouseMotion:
@ -120,7 +177,10 @@ func _unhandled_input(event: InputEvent) -> void:
if mouse_captured: _rotate_camera()
#if Input.is_action_just_pressed("jump"): jumping = true
if Input.is_action_just_pressed("exit"): get_tree().quit()
if Input.is_action_pressed("shot"): _shoot()
if Input.is_action_pressed("shot"): is_shooting = true
if Input.is_action_just_released("shot"):
is_shooting = false
gun_with_hands.reset_spread()
#if str($"..".name).to_int() == multiplayer.get_unique_id():
#if Input.is_action_just_pressed("shot"): $UpperTorso/ViewModelCamera.shot()
#if Input.is_action_just_pressed("reload"): $Body/UpperTorso/CameraMount/Camera.reload()
@ -130,6 +190,25 @@ func _rotate_camera(sens_mod: float = 1.0) -> void:
rotation.y -= look_dir.x * camera_sens * sens_mod
first_view_camera_mount.rotation.x = clamp(first_view_camera_mount.rotation.x - look_dir.y * camera_sens * sens_mod, -1.5, 1.5)
@onready var hud = $FirstPersonCameraMount/HUD
@onready var health_indicator = $FirstPersonCameraMount/HUD/HealthIndicator
@onready var fps_indicator = $FirstPersonCameraMount/HUD/FPS
func _process(delta: float) -> void:
health_indicator.text = str(health)
fps_indicator.text = str(Engine.get_frames_per_second())
if health == 0:
alive = false
var world: Node3D = find_parent("Map")
var spawner: MultiplayerSpawner = world.find_child("ObjectSpawner").find_child("MultiplayerSpawner")
var objects_root: Node3D = world.find_child("ObjectSpawner").find_child("Objects")
spawner.spawn(model)
model.reparent(get_tree().get_root())
model.die()
queue_free()
if is_shooting == true:
_shoot()
func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
@ -148,29 +227,50 @@ func _physics_process(delta: float) -> void:
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
gun_mount_anim.play("move")
if first_view_legs_anim != null:
first_view_legs_anim.play("Run Forward")
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
else:
if gun_mount_anim.is_playing():
gun_mount_anim.stop()
if first_view_legs_anim != null and first_view_legs_anim.is_playing():
first_view_legs_anim.stop()
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()
if alive:
move_and_slide()
# -- TODO: It shouldn't be hardcoded
var bullet = load("res://scenes/weapon/bullet.tscn")
@onready var shooting_raycast: RayCast3D = $FirstPersonCameraMount/RayCast3D
@onready var bullet_starting_point: Node3D = $FirstPersonCameraMount/BulletStartingPoint
@onready var aim_ray: RayCast3D = $FirstPersonCameraMount/BulletStartingPoint/AimRay
var current_weapon_damage: int
var current_weapon_bullet_speed: int
var current_weapon_cooldown_interwal: float
# --find the gun node and exec shoot
var cant_shoot: bool = false
func _shoot():
if aim_ray.is_colliding():
var collider := aim_ray.get_collider()
if collider != null and collider.is_in_group("target"):
aim_ray.get_collider().take_damage()
var root := get_tree().get_root()
gun_with_hands.shoot()
if not cant_shoot:
_send_shot_to_server.rpc_id(1, aim_ray.global_position)
if aim_ray.is_colliding():
var collider := aim_ray.get_collider()
if collider != null and collider.is_in_group("target"):
aim_ray.get_collider().take_damage()
if collider != null and collider.is_in_group("body"):
collider.hit(50)
var root := get_tree().get_root()
gun_with_hands.shoot()
cant_shoot = true
await get_tree().create_timer(current_weapon_cooldown_interwal).timeout
cant_shoot = false
@rpc("any_peer", "call_local", "unreliable_ordered")
func _send_shot_to_server(start_position):
# -- TODO: Should not be hardcoded
var world: Node3D = find_parent("Map")
world.spawn_bullet(bullet_starting_point, current_weapon_bullet_speed, current_weapon_damage)
func _get_camera_collision():
var viewport = get_viewport().size
@ -198,3 +298,13 @@ func _hit_scan_collision(collision_point):
func _hit_scan_damage(Collider):
#if Collider.is_in_group("target") and Collider.has_method("take_damage"):
print("damaged")
func take_damage(dam: int):
var new_health = health - dam
set_health(new_health)
if multiplayer.is_server():
set_health.rpc(new_health)
@rpc("call_local", "reliable")
func set_health(val: int):
health = val

View File

@ -1,9 +1,7 @@
extends CSGBox3D
class_name PlayerManager extends Object
var health = 5
var name: String
func take_damage():
health -= 1
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@ -11,5 +9,4 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if health < 1:
queue_free()
pass