update Player to use template https://github.com/ywmaa/Advanced-Movement-System-Godot.git
55
PlayerB/3DObjects/Apple/Apple.tscn
Normal file
BIN
PlayerB/3DObjects/Apple/AppleTexture.png
Executable file
After Width: | Height: | Size: 4.5 MiB |
36
PlayerB/3DObjects/Apple/AppleTexture.png.import
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bf5lvgcg5k6jb"
|
||||||
|
path.s3tc="res://.godot/imported/AppleTexture.png-60c1dd279a73b1f52b97e24589b25c3c.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/AppleTexture.png-60c1dd279a73b1f52b97e24589b25c3c.etc2.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc", "etc2"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/3DObjects/Apple/AppleTexture.png"
|
||||||
|
dest_files=["res://.godot/imported/AppleTexture.png-60c1dd279a73b1f52b97e24589b25c3c.s3tc.ctex", "res://.godot/imported/AppleTexture.png-60c1dd279a73b1f52b97e24589b25c3c.etc2.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
BIN
PlayerB/Character/Animations/CrouchIdle.res
Normal file
BIN
PlayerB/Character/Animations/CrouchWalkingForward.res
Normal file
BIN
PlayerB/Character/Animations/Falling.res
Normal file
BIN
PlayerB/Character/Animations/FallingStart.res
Normal file
BIN
PlayerB/Character/Animations/FallingToRoll.res
Normal file
BIN
PlayerB/Character/Animations/HardFalling.res
Normal file
BIN
PlayerB/Character/Animations/Idle.res
Normal file
BIN
PlayerB/Character/Animations/Idle1.res
Normal file
BIN
PlayerB/Character/Animations/Idle2.res
Normal file
BIN
PlayerB/Character/Animations/JogForward.res
Normal file
BIN
PlayerB/Character/Animations/Jogbackward.res
Normal file
BIN
PlayerB/Character/Animations/Kick.res
Normal file
BIN
PlayerB/Character/Animations/Run.res
Normal file
BIN
PlayerB/Character/Animations/RunToStop.res
Normal file
BIN
PlayerB/Character/Animations/TPose.res
Normal file
BIN
PlayerB/Character/Animations/TurnLeft.res
Normal file
BIN
PlayerB/Character/Animations/TurnRight.res
Normal file
BIN
PlayerB/Character/Animations/Walk.res
Normal file
BIN
PlayerB/Character/Animations/WalkingBackward.res
Normal file
BIN
PlayerB/Character/Character.blend
Normal file
45
PlayerB/Character/Character.blend.import
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://dsclsf0ewv6xl"
|
||||||
|
path="res://.godot/imported/Character.blend-432fb2ceeaf5dd670b5993daa0cdd616.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/Character.blend"
|
||||||
|
dest_files=["res://.godot/imported/Character.blend-432fb2ceeaf5dd670b5993daa0cdd616.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type="Node3D"
|
||||||
|
nodes/root_name="Scene Root"
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=true
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=1
|
||||||
|
meshes/lightmap_texel_size=0.2
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=true
|
||||||
|
animation/fps=30
|
||||||
|
import_script/path=""
|
||||||
|
_subresources={}
|
||||||
|
blender/nodes/visible=0
|
||||||
|
blender/nodes/punctual_lights=true
|
||||||
|
blender/nodes/cameras=true
|
||||||
|
blender/nodes/custom_properties=true
|
||||||
|
blender/nodes/modifiers=1
|
||||||
|
blender/meshes/colors=false
|
||||||
|
blender/meshes/uvs=true
|
||||||
|
blender/meshes/normals=true
|
||||||
|
blender/meshes/tangents=true
|
||||||
|
blender/meshes/skins=2
|
||||||
|
blender/meshes/export_bones_deforming_mesh_only=false
|
||||||
|
blender/materials/unpack_enabled=true
|
||||||
|
blender/materials/export_materials=1
|
||||||
|
blender/animation/limit_playback=true
|
||||||
|
blender/animation/always_sample=true
|
||||||
|
blender/animation/group_tracks=true
|
BIN
PlayerB/Character/Character.glb
Normal file
34245
PlayerB/Character/Character.glb.import
Normal file
43
PlayerB/Character/IK/LookAtIK.tres
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
[gd_resource type="SkeletonModificationStack3D" load_steps=9 format=3 uid="uid://yvsq4x1ber8r"]
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DLookAt" id="SkeletonModification3DLookAt_a3lcm"]
|
||||||
|
bone_name = "Spine2"
|
||||||
|
bone_index = 3
|
||||||
|
target_nodepath = NodePath("../../LookAtObject")
|
||||||
|
additional_rotation = Vector3(90, 180, 0)
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_5lshw"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DLookAt_a3lcm")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_gp1fd"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_5lshw")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DLookAt" id="SkeletonModification3DLookAt_vsnnr"]
|
||||||
|
bone_name = "Head"
|
||||||
|
bone_index = 5
|
||||||
|
target_nodepath = NodePath("../../LookAtObject")
|
||||||
|
additional_rotation = Vector3(90, 180, 0)
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_ckejl"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DLookAt_vsnnr")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_3kai3"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_ckejl")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_nbt4i"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 2
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DStackHolder_gp1fd")
|
||||||
|
modifications/1 = SubResource("SkeletonModification3DStackHolder_3kai3")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_c7scx"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_nbt4i")
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DStackHolder_c7scx")
|
BIN
PlayerB/Character/Mesh/.res
Normal file
BIN
PlayerB/Character/Mesh/Alpha_Body_MAT.res
Normal file
BIN
PlayerB/Character/Mesh/Alpha_Joints_MAT.res
Normal file
BIN
PlayerB/Character/Mesh/Character_Alpha_Joints.res
Normal file
BIN
PlayerB/Character/Mesh/Character_Alpha_Surface.res
Normal file
BIN
PlayerB/Character/footstep_sound/footstep1.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep1.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cffn28kxpgkqi"
|
||||||
|
path="res://.godot/imported/footstep1.wav-e37db617f9c552ac3041f3bd7c3650ab.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep1.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep1.wav-e37db617f9c552ac3041f3bd7c3650ab.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep10.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep10.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://dk8ppwj1wgdjo"
|
||||||
|
path="res://.godot/imported/footstep10.wav-ef9e871df33d2f1b4d3a665420435ccc.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep10.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep10.wav-ef9e871df33d2f1b4d3a665420435ccc.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep2.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep2.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://bpnobn6wg8hxp"
|
||||||
|
path="res://.godot/imported/footstep2.wav-e8a81ad868b8fbb31558373fd5b82c6e.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep2.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep2.wav-e8a81ad868b8fbb31558373fd5b82c6e.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep3.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep3.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://dy0na0kjknlqw"
|
||||||
|
path="res://.godot/imported/footstep3.wav-6b4e6e09ad3440f5ffa2d547596a0609.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep3.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep3.wav-6b4e6e09ad3440f5ffa2d547596a0609.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep4.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep4.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://dstan1vc4w7xy"
|
||||||
|
path="res://.godot/imported/footstep4.wav-02ec007a452cbfea5f9207a684c67612.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep4.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep4.wav-02ec007a452cbfea5f9207a684c67612.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep5.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep5.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://bnmj1hycr7gpt"
|
||||||
|
path="res://.godot/imported/footstep5.wav-f4a01153bd5d7ec9d54138360ed1b061.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep5.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep5.wav-f4a01153bd5d7ec9d54138360ed1b061.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep6.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep6.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cgko5gxdkrsmp"
|
||||||
|
path="res://.godot/imported/footstep6.wav-112ee648772be89144fccc825c1bfee7.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep6.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep6.wav-112ee648772be89144fccc825c1bfee7.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep7.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep7.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://3f6a8dp4r7ax"
|
||||||
|
path="res://.godot/imported/footstep7.wav-14c07bf04cfbe61de3e6bfc977c0545c.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep7.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep7.wav-14c07bf04cfbe61de3e6bfc977c0545c.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep8.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep8.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://rt6uhd3xqtdr"
|
||||||
|
path="res://.godot/imported/footstep8.wav-557d5198a7f4e43123b428ea3cf396e0.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep8.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep8.wav-557d5198a7f4e43123b428ea3cf396e0.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Character/footstep_sound/footstep9.wav
Executable file
24
PlayerB/Character/footstep_sound/footstep9.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://7x8t5eg1vvp3"
|
||||||
|
path="res://.godot/imported/footstep9.wav-18b861d7041a431584acfe356c1d8697.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Character/footstep_sound/footstep9.wav"
|
||||||
|
dest_files=["res://.godot/imported/footstep9.wav-18b861d7041a431584acfe356c1d8697.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
1046
PlayerB/Character/mixamo_character.tscn
Normal file
BIN
PlayerB/Lut.JPG
Normal file
After Width: | Height: | Size: 1.5 KiB |
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bli3t3o0odrn0"
|
uid="uid://dcd3eiacliu6f"
|
||||||
path="res://.godot/imported/DevScene.png-ef8845163812bf06c89566f218646cad.ctex"
|
path="res://.godot/imported/Lut.JPG-318d194d6d44601efea44da49c968641.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://player/DevScene.png"
|
source_file="res://PlayerB/Lut.JPG"
|
||||||
dest_files=["res://.godot/imported/DevScene.png-ef8845163812bf06c89566f218646cad.ctex"]
|
dest_files=["res://.godot/imported/Lut.JPG-318d194d6d44601efea44da49c968641.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
BIN
PlayerB/Maps/Grid.png
Executable file
After Width: | Height: | Size: 9.4 KiB |
36
PlayerB/Maps/Grid.png.import
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c0cjfbiwbr1eh"
|
||||||
|
path.s3tc="res://.godot/imported/Grid.png-6675700916ca1cf289742428f575fd87.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/Grid.png-6675700916ca1cf289742428f575fd87.etc2.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc", "etc2"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Maps/Grid.png"
|
||||||
|
dest_files=["res://.godot/imported/Grid.png-6675700916ca1cf289742428f575fd87.s3tc.ctex", "res://.godot/imported/Grid.png-6675700916ca1cf289742428f575fd87.etc2.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
9
PlayerB/Maps/GridMat.tres
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[gd_resource type="StandardMaterial3D" load_steps=2 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c0cjfbiwbr1eh" path="res://PlayerB/Maps/Grid.png" id="1_bneee"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
albedo_texture = ExtResource("1_bneee")
|
||||||
|
metallic_specular = 0.0
|
||||||
|
uv1_triplanar = true
|
||||||
|
uv1_world_triplanar = true
|
386
PlayerB/Maps/MovementTestMap.tscn
Normal file
|
@ -0,0 +1,386 @@
|
||||||
|
[gd_scene load_steps=13 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Environment" path="res://PlayerB/Maps/default_env.tres" id="1_7h7du"]
|
||||||
|
[ext_resource type="Script" path="res://PlayerB/Maps/main.gd" id="1_rvsng"]
|
||||||
|
[ext_resource type="Material" path="res://PlayerB/Maps/GridMat.tres" id="3_27oba"]
|
||||||
|
[ext_resource type="Script" path="res://addons/AMSG/Interactable/Light/InteractableLight.gd" id="4_kyyln"]
|
||||||
|
[ext_resource type="PackedScene" path="res://PlayerB/3DObjects/Apple/Apple.tscn" id="6_aiuj0"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_2afi4"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_n4eeh"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cpp0l"]
|
||||||
|
albedo_color = Color(1, 0.0235294, 0, 1)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_jwhxk"]
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_5twjj"]
|
||||||
|
points = PackedVector3Array(1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1)
|
||||||
|
|
||||||
|
[sub_resource type="SphereMesh" id="SphereMesh_frhet"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tx2qg"]
|
||||||
|
albedo_color = Color(1, 0.223529, 0.278431, 1)
|
||||||
|
|
||||||
|
[node name="Node" type="Node"]
|
||||||
|
script = ExtResource("1_rvsng")
|
||||||
|
|
||||||
|
[node name="ListenServer" type="Button" parent="."]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -144.0
|
||||||
|
offset_top = -23.0
|
||||||
|
offset_right = -4.0
|
||||||
|
offset_bottom = 24.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Listen Server
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="DServer" type="Button" parent="."]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -144.0
|
||||||
|
offset_top = 29.0
|
||||||
|
offset_right = -4.0
|
||||||
|
offset_bottom = 76.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Dedicated Server
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="Client" type="Button" parent="."]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = 8.0
|
||||||
|
offset_top = -23.0
|
||||||
|
offset_right = 151.0
|
||||||
|
offset_bottom = 24.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Client
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="IP_address" type="TextEdit" parent="Client"]
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 144.0
|
||||||
|
offset_bottom = 100.0
|
||||||
|
placeholder_text = "localhost"
|
||||||
|
metadata/_edit_layout_mode = 0
|
||||||
|
metadata/_edit_use_custom_anchors = false
|
||||||
|
|
||||||
|
[node name="Singleplayer" type="Button" parent="."]
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -68.0
|
||||||
|
offset_top = -85.0
|
||||||
|
offset_right = 75.0
|
||||||
|
offset_bottom = -38.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Singleplayer
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="MainMenu" type="Button" parent="."]
|
||||||
|
anchors_preset = 3
|
||||||
|
anchor_left = 1.0
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = -143.0
|
||||||
|
offset_top = -47.0
|
||||||
|
grow_horizontal = 0
|
||||||
|
grow_vertical = 0
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Main Menu"
|
||||||
|
|
||||||
|
[node name="PlayerSpawnLocation" type="Node3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.91311, 7.03314, 0)
|
||||||
|
|
||||||
|
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
|
||||||
|
_spawnable_scenes = PackedStringArray("res://AMSG_Examples/Player/Player.tscn")
|
||||||
|
spawn_path = NodePath("../PlayerSpawnLocation")
|
||||||
|
|
||||||
|
[node name="light" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.84419, 1.95787, 16.7421)
|
||||||
|
collision_layer = 2
|
||||||
|
script = ExtResource("4_kyyln")
|
||||||
|
light = NodePath("../SpotLight3D")
|
||||||
|
on = false
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="light"]
|
||||||
|
shape = SubResource("BoxShape3D_2afi4")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="light/CollisionShape3D"]
|
||||||
|
layers = 2
|
||||||
|
mesh = SubResource("BoxMesh_n4eeh")
|
||||||
|
skeleton = NodePath("../../..")
|
||||||
|
surface_material_override/0 = SubResource("StandardMaterial3D_cpp0l")
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.21105, 0.573563, 2.89924)
|
||||||
|
material_override = ExtResource("3_27oba")
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(50, 2, 50)
|
||||||
|
|
||||||
|
[node name="CSGBox3D1" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31349, 2.97282, -22.5958)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(49.873, 3, 1)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D2" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31349, 2.97282, 28.4035)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(49.873, 3, 1)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D3" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(-0.00308923, 0, 0.999995, 0, 1, 0, -0.999995, 0, -0.00308923, 25.873, 2.97282, 2.67917)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(55, 3, 1)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D4" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(-0.00308923, 0, 0.999995, 0, 1, 0, -0.999995, 0, -0.00308923, -23.5016, 2.97282, 2.67917)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(55, 3, 1)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D5" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(-0.843984, -0.536342, -0.0052146, -0.536332, 0.844001, -0.00331375, 0.00617843, -3.16889e-10, -0.99998, 10.3494, 1.99632, 1.41695)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4.60107, 0.502591, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D7" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(0.849607, 0.527317, -0.0102242, -0.527376, 0.849622, -0.004133, 0.00650729, 0.00890342, 0.999939, 18.6499, 2.07674, 1.42846)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4.60107, 0.502591, 14.0192)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D6" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, 14.4541, 3.1768, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(4.60107, 0.502591, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||||
|
transform = Transform3D(0.998819, 0.0194639, 0.0445193, -0.0467522, 0.634491, 0.771515, -0.0132304, -0.772685, 0.634652, -0.531392, 8.38026, -2.80088)
|
||||||
|
layers = 0
|
||||||
|
shadow_enabled = true
|
||||||
|
|
||||||
|
[node name="SpotLight3D" type="SpotLight3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, -0.996865, 0.0791203, 0, -0.0791203, -0.996865, 0.789293, 2.01648, 14.7671)
|
||||||
|
|
||||||
|
[node name="Stairs" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="CSGBox3D8" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -1.42272, 1.61775, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D9" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -1.80449, 1.74329, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D10" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.17758, 1.87023, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D10@19582" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.55936, 1.99577, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D11" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.8971, 2.11789, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D11@20746" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -3.27887, 2.24343, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D11@20747" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -3.65196, 2.37037, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D1019582" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.03373, 2.49591, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D12" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.41911, 2.62279, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D12@21676" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.80088, 2.74833, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D12@21677" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.17397, 2.87527, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D1019583" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.55574, 3.00081, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D12@21678" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.89349, 3.12293, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D1120746" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -6.27526, 3.24847, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="CSGBox3D1120747" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -6.64835, 3.37541, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="@CSGBox3D1019583@21679" type="CSGBox3D" parent="Stairs"]
|
||||||
|
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -7.03012, 3.50095, 1.38929)
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(0.392448, 0.135761, 14.107)
|
||||||
|
material = ExtResource("3_27oba")
|
||||||
|
|
||||||
|
[node name="RigidDynamicBody3D" type="RigidBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.92094, 2.54135, 14.9625)
|
||||||
|
gravity_scale = -0.07
|
||||||
|
lock_rotation = true
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D"]
|
||||||
|
gi_mode = 2
|
||||||
|
mesh = SubResource("BoxMesh_jwhxk")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D"]
|
||||||
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||||
|
shape = SubResource("ConvexPolygonShape3D_5twjj")
|
||||||
|
|
||||||
|
[node name="RigidDynamicBody3D2" type="RigidBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.11323, 5.04718, 13.5922)
|
||||||
|
mass = 0.01
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D2"]
|
||||||
|
gi_mode = 2
|
||||||
|
mesh = SubResource("BoxMesh_jwhxk")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D2"]
|
||||||
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||||
|
shape = SubResource("ConvexPolygonShape3D_5twjj")
|
||||||
|
|
||||||
|
[node name="RigidDynamicBody3D3" type="RigidBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.89079, 5.04718, 13.7933)
|
||||||
|
mass = 0.01
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D3"]
|
||||||
|
gi_mode = 2
|
||||||
|
mesh = SubResource("BoxMesh_jwhxk")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D3"]
|
||||||
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||||
|
shape = SubResource("ConvexPolygonShape3D_5twjj")
|
||||||
|
|
||||||
|
[node name="RigidDynamicBody3D4" type="RigidBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.51824, 6.10535, 13.6351)
|
||||||
|
mass = 0.01
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D4"]
|
||||||
|
gi_mode = 2
|
||||||
|
mesh = SubResource("BoxMesh_jwhxk")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D4"]
|
||||||
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||||
|
shape = SubResource("ConvexPolygonShape3D_5twjj")
|
||||||
|
|
||||||
|
[node name="RigidDynamicBody3D5" type="RigidBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.85594, 6.10535, 13.6351)
|
||||||
|
mass = 0.01
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D5"]
|
||||||
|
gi_mode = 2
|
||||||
|
mesh = SubResource("BoxMesh_jwhxk")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D5"]
|
||||||
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||||
|
shape = SubResource("ConvexPolygonShape3D_5twjj")
|
||||||
|
|
||||||
|
[node name="Apple" parent="." instance=ExtResource("6_aiuj0")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.07152, 4.14037, 7.15481)
|
||||||
|
|
||||||
|
[node name="@Apple@40298" parent="." instance=ExtResource("6_aiuj0")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5983, 4.14037, 7.57517)
|
||||||
|
|
||||||
|
[node name="@Apple@40303" parent="." instance=ExtResource("6_aiuj0")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.64226, 4.14037, 7.48438)
|
||||||
|
|
||||||
|
[node name="@Apple@40308" parent="." instance=ExtResource("6_aiuj0")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.31481, 4.14037, 7.25267)
|
||||||
|
|
||||||
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
|
environment = ExtResource("1_7h7du")
|
||||||
|
|
||||||
|
[node name="FogVolume" type="FogVolume" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.4926, 1.50598, 1.53421)
|
||||||
|
extents = Vector3(4.02019, 1.40863, 7.04964)
|
||||||
|
|
||||||
|
[node name="StopLocation" type="MeshInstance3D" parent="."]
|
||||||
|
transform = Transform3D(0.309258, 0, 0, 0, 0.309258, 0, 0, 0, 0.309258, 0, 2.47683, 0)
|
||||||
|
mesh = SubResource("SphereMesh_frhet")
|
||||||
|
surface_material_override/0 = SubResource("StandardMaterial3D_tx2qg")
|
||||||
|
|
||||||
|
[connection signal="pressed" from="ListenServer" to="." method="_on_server_pressed"]
|
||||||
|
[connection signal="pressed" from="DServer" to="." method="_on_d_server_pressed"]
|
||||||
|
[connection signal="pressed" from="Client" to="." method="_on_client_pressed"]
|
||||||
|
[connection signal="text_changed" from="Client/IP_address" to="." method="_on_ip_address_text_changed"]
|
||||||
|
[connection signal="pressed" from="Singleplayer" to="." method="_on_singleplayer_pressed"]
|
||||||
|
[connection signal="pressed" from="MainMenu" to="." method="_on_main_menu_pressed"]
|
27
PlayerB/Maps/default_env.tres
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
[gd_resource type="Environment" load_steps=4 format=3 uid="uid://cuc5d2r48m747"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dcd3eiacliu6f" path="res://PlayerB/Lut.JPG" id="1_5tnx1"]
|
||||||
|
|
||||||
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_8pwhp"]
|
||||||
|
sky_top_color = Color(0.576471, 0.690196, 0.733333, 1)
|
||||||
|
sun_angle_max = 120.35
|
||||||
|
|
||||||
|
[sub_resource type="Sky" id="1"]
|
||||||
|
sky_material = SubResource("ProceduralSkyMaterial_8pwhp")
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
background_mode = 2
|
||||||
|
sky = SubResource("1")
|
||||||
|
tonemap_mode = 3
|
||||||
|
sdfgi_use_occlusion = true
|
||||||
|
glow_levels/3 = 16.0
|
||||||
|
glow_levels/5 = 16.0
|
||||||
|
glow_normalized = true
|
||||||
|
glow_blend_mode = 0
|
||||||
|
glow_hdr_threshold = 0.5
|
||||||
|
glow_map = ExtResource("1_5tnx1")
|
||||||
|
fog_enabled = true
|
||||||
|
fog_light_color = Color(0.27451, 0.423529, 0.607843, 1)
|
||||||
|
fog_density = 0.004
|
||||||
|
volumetric_fog_enabled = true
|
||||||
|
volumetric_fog_density = 0.007
|
124
PlayerB/Maps/main.gd
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
extends Node
|
||||||
|
@export var port := 8313
|
||||||
|
@export var ip_address_to_connect := "localhost"
|
||||||
|
var singleplayer := false
|
||||||
|
@export var PlayerCharacter = preload("res://PlayerB/Player/Player.tscn")
|
||||||
|
var is_the_server_a_player := true #if it is peer to peer the server will also have a playable character
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _enter_tree():
|
||||||
|
# Start the server if Godot passed the "--server" argument,
|
||||||
|
# and start the client if Godot passed the "--client" argument.
|
||||||
|
if "--listen_server" in OS.get_cmdline_args():
|
||||||
|
_on_server_pressed()
|
||||||
|
elif "--client" in OS.get_cmdline_args():
|
||||||
|
_on_client_pressed()
|
||||||
|
elif "--server" in OS.get_cmdline_args():
|
||||||
|
_on_d_server_pressed()
|
||||||
|
func single_player():
|
||||||
|
singleplayer = true
|
||||||
|
$ListenServer.visible = false
|
||||||
|
$DServer.visible = false
|
||||||
|
$Client.visible = false
|
||||||
|
$Singleplayer.visible = false
|
||||||
|
var p = PlayerCharacter.instantiate()
|
||||||
|
$PlayerSpawnLocation.add_child(p)
|
||||||
|
|
||||||
|
func start_network(server:bool) -> void:
|
||||||
|
singleplayer = false
|
||||||
|
$ListenServer.visible = false
|
||||||
|
$DServer.visible = false
|
||||||
|
$Client.visible = false
|
||||||
|
$Singleplayer.visible = false
|
||||||
|
var peer = ENetMultiplayerPeer.new()
|
||||||
|
#on server disconnected
|
||||||
|
multiplayer.server_disconnected.connect(self.server_disconnected)
|
||||||
|
#on connection failed
|
||||||
|
multiplayer.connection_failed.connect(self.connection_failed)
|
||||||
|
if server:
|
||||||
|
|
||||||
|
#listen to peer connections, and create new player for them
|
||||||
|
multiplayer.peer_connected.connect(self.player_joined)
|
||||||
|
#listen to peer disconnections, and destroy their players
|
||||||
|
multiplayer.peer_disconnected.connect(self.player_disconnected)
|
||||||
|
|
||||||
|
peer.create_server(port)
|
||||||
|
multiplayer.set_multiplayer_peer(peer)
|
||||||
|
if is_the_server_a_player:
|
||||||
|
create_player(1)
|
||||||
|
print("server listening on %s" %IP.get_local_addresses()[0])
|
||||||
|
else:
|
||||||
|
peer.create_client(ip_address_to_connect,port)
|
||||||
|
multiplayer.set_multiplayer_peer(peer)
|
||||||
|
|
||||||
|
|
||||||
|
func player_joined(id:int):
|
||||||
|
create_player(id)
|
||||||
|
func player_disconnected(id:int):
|
||||||
|
destroy_player(id)
|
||||||
|
func server_disconnected():
|
||||||
|
_on_main_menu_pressed()
|
||||||
|
func connection_failed():
|
||||||
|
print("connection failed")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func create_player(id: int) -> void:
|
||||||
|
var p = PlayerCharacter.instantiate()
|
||||||
|
p.set_name(str(id))
|
||||||
|
$PlayerSpawnLocation.add_child(p)
|
||||||
|
# p.top_level = true
|
||||||
|
|
||||||
|
func destroy_player(id: int) -> void:
|
||||||
|
$PlayerSpawnLocation.get_node(str(id)).queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _on_server_pressed():
|
||||||
|
is_the_server_a_player = true
|
||||||
|
start_network(true)
|
||||||
|
|
||||||
|
func _on_d_server_pressed():
|
||||||
|
is_the_server_a_player = false
|
||||||
|
start_network(true)
|
||||||
|
|
||||||
|
func _on_client_pressed():
|
||||||
|
start_network(false)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_singleplayer_pressed():
|
||||||
|
single_player()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _on_main_menu_pressed():
|
||||||
|
$ListenServer.visible = true
|
||||||
|
$DServer.visible = true
|
||||||
|
$Client.visible = true
|
||||||
|
$Singleplayer.visible = true
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
if singleplayer:
|
||||||
|
for i in $PlayerSpawnLocation.get_child_count():
|
||||||
|
$PlayerSpawnLocation.get_child(i).queue_free()
|
||||||
|
else:
|
||||||
|
if multiplayer.is_server():
|
||||||
|
for p in multiplayer.get_peers():
|
||||||
|
destroy_player(p)
|
||||||
|
if is_the_server_a_player:
|
||||||
|
destroy_player(1)
|
||||||
|
multiplayer.set_multiplayer_peer(null)
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if Input.is_action_just_pressed("ui_menu"):
|
||||||
|
_on_main_menu_pressed()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_ip_address_text_changed():
|
||||||
|
if $Client/IP_address.text == "":
|
||||||
|
ip_address_to_connect = "localhost"
|
||||||
|
else:
|
||||||
|
ip_address_to_connect = $Client/IP_address.text
|
||||||
|
|
||||||
|
|
||||||
|
|
489
PlayerB/Player/Player.tscn
Normal file
|
@ -0,0 +1,489 @@
|
||||||
|
[gd_scene load_steps=68 format=3 uid="uid://dc6663xbsik21"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" path="res://PlayerB/Character/mixamo_character.tscn" id="1_ihvpu"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bfkejs88xm680" path="res://addons/PoseWarping/MotionWarping.tscn" id="2_0jifq"]
|
||||||
|
[ext_resource type="Script" path="res://addons/AMSG/Components/PlayerGameplayComponent.gd" id="3_jj2if"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cegbfvlakd2rw" path="res://addons/AMSG/Components/Networking.tscn" id="4_8jv5v"]
|
||||||
|
[ext_resource type="PackedScene" path="res://PlayerB/Player/flashlight/Flashlight.tscn" id="5_euvsl"]
|
||||||
|
[ext_resource type="Script" path="res://PlayerB/Player/Status.gd" id="6_8h4hk"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dpkisrpco54qj" path="res://PlayerB/Player/UI/Debug/circle.png" id="7_n2d8i"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ijv6wr22hov8" path="res://PlayerB/Player/UI/Debug/direction.png" id="8_t071y"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ck5riwbh478s4" path="res://PlayerB/Player/UI/Debug/velocity.png" id="9_464xm"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_twcy5"]
|
||||||
|
animation = &"TurnLeft"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a2hmg"]
|
||||||
|
animation = &"TurnRight"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_1l4w4"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vp77s"]
|
||||||
|
animation = &"Falling"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_r0ju1"]
|
||||||
|
animation = &"FallingStart"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ideig"]
|
||||||
|
switch_mode = 1
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_iqu7g"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_gg4yn"]
|
||||||
|
states/Falling/node = SubResource("AnimationNodeAnimation_vp77s")
|
||||||
|
states/Falling/position = Vector2(864, 268)
|
||||||
|
states/FallingStart/node = SubResource("AnimationNodeAnimation_r0ju1")
|
||||||
|
states/FallingStart/position = Vector2(600, 268)
|
||||||
|
states/Start/position = Vector2(404, 268)
|
||||||
|
transitions = ["FallingStart", "Falling", SubResource("AnimationNodeStateMachineTransition_ideig"), "Start", "FallingStart", SubResource("AnimationNodeStateMachineTransition_iqu7g")]
|
||||||
|
graph_offset = Vector2(116, 80)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_rgrah"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nh7d2"]
|
||||||
|
filter_enabled = true
|
||||||
|
filters = ["Armature/Skeleton3D:Hips", "Armature/Skeleton3D:LeftFoot", "Armature/Skeleton3D:LeftLeg", "Armature/Skeleton3D:LeftToeBase", "Armature/Skeleton3D:LeftUpLeg", "Armature/Skeleton3D:RightFoot", "Armature/Skeleton3D:RightLeg", "Armature/Skeleton3D:RightToeBase", "Armature/Skeleton3D:RightUpLeg"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_ap4r3"]
|
||||||
|
sync = true
|
||||||
|
enabled_inputs = 2
|
||||||
|
xfade_time = 0.3
|
||||||
|
input_0/name = "stand"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "crouch"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_154hg"]
|
||||||
|
animation = &"CrouchIdle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0bv1y"]
|
||||||
|
animation = &"CrouchWalkingForward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_urt4k"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6juuf"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_611fp"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_w0g24"]
|
||||||
|
states/CrouchIdle/node = SubResource("AnimationNodeAnimation_154hg")
|
||||||
|
states/CrouchIdle/position = Vector2(321, 100)
|
||||||
|
states/CrouchWalkingForward/node = SubResource("AnimationNodeAnimation_0bv1y")
|
||||||
|
states/CrouchWalkingForward/position = Vector2(560, 100)
|
||||||
|
states/Start/position = Vector2(157, 100)
|
||||||
|
transitions = ["Start", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_urt4k"), "CrouchIdle", "CrouchWalkingForward", SubResource("AnimationNodeStateMachineTransition_6juuf"), "CrouchWalkingForward", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_611fp")]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5ouea"]
|
||||||
|
animation = &"Idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_q0w1d"]
|
||||||
|
animation = &"Jogbackward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_5puiv"]
|
||||||
|
enabled_inputs = 2
|
||||||
|
input_0/name = "Forward"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "Backward"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2fd4a"]
|
||||||
|
animation = &"JogForward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_fipxh"]
|
||||||
|
graph_offset = Vector2(-467, 62.6111)
|
||||||
|
nodes/Backward/node = SubResource("AnimationNodeAnimation_q0w1d")
|
||||||
|
nodes/Backward/position = Vector2(-100, 220)
|
||||||
|
nodes/FB/node = SubResource("AnimationNodeTransition_5puiv")
|
||||||
|
nodes/FB/position = Vector2(140, 140)
|
||||||
|
nodes/Forward/node = SubResource("AnimationNodeAnimation_2fd4a")
|
||||||
|
nodes/Forward/position = Vector2(-100, 100)
|
||||||
|
node_connections = [&"output", 0, &"FB", &"FB", 0, &"Forward", &"FB", 1, &"Backward"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j4dou"]
|
||||||
|
animation = &"Run"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o6ga8"]
|
||||||
|
animation = &"RunToStop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTimeSeek" id="AnimationNodeTimeSeek_mnurx"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_rd7gb"]
|
||||||
|
graph_offset = Vector2(-348.252, 95.8945)
|
||||||
|
nodes/StopAnim/node = SubResource("AnimationNodeAnimation_o6ga8")
|
||||||
|
nodes/StopAnim/position = Vector2(-260, 180)
|
||||||
|
nodes/StopSeek/node = SubResource("AnimationNodeTimeSeek_mnurx")
|
||||||
|
nodes/StopSeek/position = Vector2(-60, 160)
|
||||||
|
node_connections = [&"output", 0, &"StopSeek", &"StopSeek", 0, &"StopAnim"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fgiyf"]
|
||||||
|
animation = &"WalkingBackward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_s7sc4"]
|
||||||
|
enabled_inputs = 2
|
||||||
|
input_0/name = "Forward"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "Backward"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_msank"]
|
||||||
|
animation = &"Walk"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_8bvke"]
|
||||||
|
graph_offset = Vector2(-440, 10)
|
||||||
|
nodes/Backward/node = SubResource("AnimationNodeAnimation_fgiyf")
|
||||||
|
nodes/Backward/position = Vector2(-100, 180)
|
||||||
|
nodes/FB/node = SubResource("AnimationNodeTransition_s7sc4")
|
||||||
|
nodes/FB/position = Vector2(140, 100)
|
||||||
|
nodes/Forward/node = SubResource("AnimationNodeAnimation_msank")
|
||||||
|
nodes/Forward/position = Vector2(-60, 60)
|
||||||
|
node_connections = [&"output", 0, &"FB", &"FB", 0, &"Forward", &"FB", 1, &"Backward"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wnbtw"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 2
|
||||||
|
advance_condition = &"idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rvsaa"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_s0egl"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"sprinting"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xf5i1"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nbs2g"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rs3n0"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6gab4"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6m5a2"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hy2h2"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2tyel"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"sprinting"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7h1qf"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4twgu"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_5xtv7"]
|
||||||
|
states/Idle/node = SubResource("AnimationNodeAnimation_5ouea")
|
||||||
|
states/Idle/position = Vector2(137, 278)
|
||||||
|
states/Jog/node = SubResource("AnimationNodeBlendTree_fipxh")
|
||||||
|
states/Jog/position = Vector2(687.227, 134)
|
||||||
|
states/Run/node = SubResource("AnimationNodeAnimation_j4dou")
|
||||||
|
states/Run/position = Vector2(881, 296)
|
||||||
|
states/Start/position = Vector2(22, 278)
|
||||||
|
states/Stopping/node = SubResource("AnimationNodeBlendTree_rd7gb")
|
||||||
|
states/Stopping/position = Vector2(505, 327)
|
||||||
|
states/Walk/node = SubResource("AnimationNodeBlendTree_8bvke")
|
||||||
|
states/Walk/position = Vector2(216.227, 134)
|
||||||
|
transitions = ["Stopping", "Idle", SubResource("AnimationNodeStateMachineTransition_wnbtw"), "Run", "Stopping", SubResource("AnimationNodeStateMachineTransition_rvsaa"), "Idle", "Run", SubResource("AnimationNodeStateMachineTransition_s0egl"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_xf5i1"), "Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_nbs2g"), "Walk", "Stopping", SubResource("AnimationNodeStateMachineTransition_rs3n0"), "Walk", "Jog", SubResource("AnimationNodeStateMachineTransition_6gab4"), "Jog", "Walk", SubResource("AnimationNodeStateMachineTransition_6m5a2"), "Run", "Jog", SubResource("AnimationNodeStateMachineTransition_hy2h2"), "Jog", "Run", SubResource("AnimationNodeStateMachineTransition_2tyel"), "Jog", "Stopping", SubResource("AnimationNodeStateMachineTransition_7h1qf"), "Idle", "Jog", SubResource("AnimationNodeStateMachineTransition_4twgu")]
|
||||||
|
graph_offset = Vector2(-13.773, 102)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_512i8"]
|
||||||
|
graph_offset = Vector2(-482.415, 81.5292)
|
||||||
|
nodes/crouch/node = SubResource("AnimationNodeTransition_ap4r3")
|
||||||
|
nodes/crouch/position = Vector2(100, 180)
|
||||||
|
nodes/crouching/node = SubResource("AnimationNodeStateMachine_w0g24")
|
||||||
|
nodes/crouching/position = Vector2(-120, 300)
|
||||||
|
nodes/standing/node = SubResource("AnimationNodeStateMachine_5xtv7")
|
||||||
|
nodes/standing/position = Vector2(-120, 40)
|
||||||
|
node_connections = [&"output", 0, &"crouch", &"crouch", 0, &"standing", &"crouch", 1, &"crouching"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_j336j"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
graph_offset = Vector2(341, 1376)
|
||||||
|
nodes/AnimTurnLeft/node = SubResource("AnimationNodeAnimation_twcy5")
|
||||||
|
nodes/AnimTurnLeft/position = Vector2(500, 1540)
|
||||||
|
nodes/AnimTurnRight/node = SubResource("AnimationNodeAnimation_a2hmg")
|
||||||
|
nodes/AnimTurnRight/position = Vector2(500, 1660)
|
||||||
|
nodes/InAir/node = SubResource("AnimationNodeBlend2_1l4w4")
|
||||||
|
nodes/InAir/position = Vector2(1280, 1380)
|
||||||
|
nodes/InAirState/node = SubResource("AnimationNodeStateMachine_gg4yn")
|
||||||
|
nodes/InAirState/position = Vector2(1020, 1680)
|
||||||
|
nodes/RightOrLeft/node = SubResource("AnimationNodeBlend2_rgrah")
|
||||||
|
nodes/RightOrLeft/position = Vector2(720, 1560)
|
||||||
|
nodes/Turn/node = SubResource("AnimationNodeBlend2_nh7d2")
|
||||||
|
nodes/Turn/position = Vector2(980, 1400)
|
||||||
|
nodes/VelocityDirection/node = SubResource("AnimationNodeBlendTree_512i8")
|
||||||
|
nodes/VelocityDirection/position = Vector2(680, 1400)
|
||||||
|
nodes/output/position = Vector2(1540, 1400)
|
||||||
|
node_connections = [&"output", 0, &"InAir", &"InAir", 0, &"Turn", &"InAir", 1, &"InAirState", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_nfm7u"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_tgni3"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_44upy"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ied37"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
radius = 0.375
|
||||||
|
height = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DLookAt" id="SkeletonModification3DLookAt_a3lcm"]
|
||||||
|
bone_name = "Spine2"
|
||||||
|
bone_index = 3
|
||||||
|
target_nodepath = NodePath("../../LookAtObject")
|
||||||
|
additional_rotation = Vector3(90, 180, 0)
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_5lshw"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DLookAt_a3lcm")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_gp1fd"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_5lshw")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DLookAt" id="SkeletonModification3DLookAt_vsnnr"]
|
||||||
|
bone_name = "Head"
|
||||||
|
bone_index = 5
|
||||||
|
target_nodepath = NodePath("../../LookAtObject")
|
||||||
|
additional_rotation = Vector3(90, 180, 0)
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_ckejl"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DLookAt_vsnnr")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_3kai3"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_ckejl")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_nbt4i"]
|
||||||
|
enabled = true
|
||||||
|
modification_count = 2
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DStackHolder_gp1fd")
|
||||||
|
modifications/1 = SubResource("SkeletonModification3DStackHolder_3kai3")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModification3DStackHolder" id="SkeletonModification3DStackHolder_c7scx"]
|
||||||
|
held_modification_stack = SubResource("SkeletonModificationStack3D_nbt4i")
|
||||||
|
|
||||||
|
[sub_resource type="SkeletonModificationStack3D" id="SkeletonModificationStack3D_gatbk"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
modification_count = 1
|
||||||
|
modifications/0 = SubResource("SkeletonModification3DStackHolder_c7scx")
|
||||||
|
|
||||||
|
[node name="Character" instance=ExtResource("1_ihvpu")]
|
||||||
|
|
||||||
|
[node name="MotionWarping" parent="." index="0" instance=ExtResource("2_0jifq")]
|
||||||
|
|
||||||
|
[node name="CharacterMovementComponent" parent="." index="1"]
|
||||||
|
script = ExtResource("3_jj2if")
|
||||||
|
networking_path = NodePath("../Networking")
|
||||||
|
OnePressJump = true
|
||||||
|
UsingSprintToggle = false
|
||||||
|
UsingCrouchToggle = true
|
||||||
|
|
||||||
|
[node name="CameraComponent" parent="." index="2"]
|
||||||
|
networking_path = NodePath("../Networking")
|
||||||
|
|
||||||
|
[node name="Networking" parent="." index="3" instance=ExtResource("4_8jv5v")]
|
||||||
|
character_movement_component = NodePath("../CharacterMovementComponent")
|
||||||
|
|
||||||
|
[node name="AnimationTree" parent="." index="4"]
|
||||||
|
tree_root = SubResource("AnimationNodeBlendTree_j336j")
|
||||||
|
parameters/InAirState/playback = SubResource("AnimationNodeStateMachinePlayback_nfm7u")
|
||||||
|
parameters/VelocityDirection/crouching/playback = SubResource("AnimationNodeStateMachinePlayback_tgni3")
|
||||||
|
parameters/VelocityDirection/standing/playback = SubResource("AnimationNodeStateMachinePlayback_44upy")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" parent="." index="5"]
|
||||||
|
shape = SubResource("CapsuleShape3D_ied37")
|
||||||
|
|
||||||
|
[node name="Skeleton3D" parent="Armature" index="0"]
|
||||||
|
bones/0/position = Vector3(0.0038598, 0.929093, -0.00259958)
|
||||||
|
bones/0/rotation = Quaternion(-0.0406943, -0.369463, -0.0158722, 0.928219)
|
||||||
|
bones/1/rotation = Quaternion(-0.0117565, 0.040528, -0.00576336, 0.999093)
|
||||||
|
bones/2/rotation = Quaternion(0.097935, 0.0823717, -0.00797611, 0.991746)
|
||||||
|
bones/3/rotation = Quaternion(0.157589, 0.0817538, -0.0129492, 0.98403)
|
||||||
|
bones/4/rotation = Quaternion(0.120002, -0.00998888, 0.00477149, 0.992712)
|
||||||
|
bones/5/rotation = Quaternion(-0.0412958, 0.168286, -0.0627462, 0.982872)
|
||||||
|
bones/9/rotation = Quaternion(-0.485001, -0.525074, 0.572014, -0.402333)
|
||||||
|
bones/10/rotation = Quaternion(0.526264, -0.0801061, 0.14617, 0.833825)
|
||||||
|
bones/11/rotation = Quaternion(-0.0106293, 0.095177, 0.445357, 0.890217)
|
||||||
|
bones/12/rotation = Quaternion(-0.156941, 0.124202, -0.00605504, 0.979748)
|
||||||
|
bones/13/rotation = Quaternion(0.130908, 0.00446447, -0.0774478, 0.988355)
|
||||||
|
bones/14/rotation = Quaternion(0.196481, -0.00135914, 0.0150852, 0.980391)
|
||||||
|
bones/15/rotation = Quaternion(5.537e-09, -1.56462e-07, 7.97777e-06, 1)
|
||||||
|
bones/17/rotation = Quaternion(0.284786, 0.1138, 0.186841, 0.933294)
|
||||||
|
bones/18/rotation = Quaternion(-0.00754157, 0.000748705, -0.000678603, 0.999971)
|
||||||
|
bones/19/rotation = Quaternion(-6.10948e-07, -5.22193e-06, -9.81533e-06, 1)
|
||||||
|
bones/21/rotation = Quaternion(0.0369005, -0.00557745, 0.0617714, 0.997392)
|
||||||
|
bones/22/rotation = Quaternion(0.147487, -0.000835881, -0.00629187, 0.989044)
|
||||||
|
bones/23/rotation = Quaternion(1.95422e-06, -1.9595e-06, -1.66125e-07, 1)
|
||||||
|
bones/25/rotation = Quaternion(0.271087, -0.0164011, -0.122549, 0.954581)
|
||||||
|
bones/26/rotation = Quaternion(0.282116, 0.00173259, 0.0247648, 0.959059)
|
||||||
|
bones/27/rotation = Quaternion(1.28457e-08, -1.11759e-07, 3.06248e-06, 1)
|
||||||
|
bones/29/rotation = Quaternion(0.297158, -0.0175622, -0.155999, 0.941835)
|
||||||
|
bones/30/rotation = Quaternion(0.342705, 0.0115073, 0.0499665, 0.938043)
|
||||||
|
bones/31/rotation = Quaternion(2.01584e-06, -2.01911e-06, 9.92743e-06, 1)
|
||||||
|
bones/33/rotation = Quaternion(0.539708, -0.482651, 0.54025, 0.428828)
|
||||||
|
bones/34/rotation = Quaternion(0.510216, 0.088921, 0.0786442, 0.851814)
|
||||||
|
bones/35/rotation = Quaternion(0.05519, -0.0521666, -0.429558, 0.899841)
|
||||||
|
bones/36/rotation = Quaternion(0.109864, -0.0160576, -0.0629027, 0.991824)
|
||||||
|
bones/37/rotation = Quaternion(0.111079, 0.00854033, 0.0245669, 0.993471)
|
||||||
|
bones/38/rotation = Quaternion(0.289374, 0.00155879, -0.0194257, 0.957018)
|
||||||
|
bones/39/rotation = Quaternion(1.6691e-08, 3.72529e-08, -7.53335e-06, 1)
|
||||||
|
bones/41/rotation = Quaternion(0.202562, 0.0248875, -0.228056, 0.952019)
|
||||||
|
bones/42/rotation = Quaternion(0.00486392, 0.0016431, 0.181315, 0.983412)
|
||||||
|
bones/43/rotation = Quaternion(1.69501e-06, 4.45172e-06, 1.02064e-05, 1)
|
||||||
|
bones/45/rotation = Quaternion(0.039051, 0.00981938, 0.0103365, 0.999136)
|
||||||
|
bones/46/rotation = Quaternion(0.147237, 0.000200287, 0.00967344, 0.989054)
|
||||||
|
bones/47/rotation = Quaternion(-2.49988e-07, -1.93715e-07, 2.5981e-07, 1)
|
||||||
|
bones/49/rotation = Quaternion(0.200349, -0.00738569, 0.0658368, 0.977482)
|
||||||
|
bones/50/rotation = Quaternion(0.333167, -0.00244052, -0.0352797, 0.942204)
|
||||||
|
bones/51/rotation = Quaternion(-3.47811e-06, -3.27826e-06, -3.25148e-06, 1)
|
||||||
|
bones/53/rotation = Quaternion(0.207046, -0.0111292, 0.0918823, 0.973943)
|
||||||
|
bones/54/rotation = Quaternion(0.361855, -0.0127658, -0.0698832, 0.929524)
|
||||||
|
bones/55/rotation = Quaternion(2.05328e-08, 0, -1.09167e-05, 1)
|
||||||
|
bones/57/rotation = Quaternion(-0.124954, 0.0145409, 0.983445, 0.130425)
|
||||||
|
bones/58/rotation = Quaternion(-0.297803, 0.0705927, -0.0190339, 0.951823)
|
||||||
|
bones/59/rotation = Quaternion(0.595542, 0.0617392, 0.114074, 0.792783)
|
||||||
|
bones/60/rotation = Quaternion(0.353789, 0.0204575, 0.00399042, 0.935093)
|
||||||
|
bones/62/rotation = Quaternion(0.0783266, 0.211744, 0.968515, -0.104921)
|
||||||
|
bones/63/rotation = Quaternion(-0.314069, 0.119462, -0.0379855, 0.941088)
|
||||||
|
bones/64/rotation = Quaternion(0.490283, -0.0214487, -0.0387526, 0.870437)
|
||||||
|
bones/65/rotation = Quaternion(0.358932, 0.000747801, -0.0291213, 0.932909)
|
||||||
|
modification_stack = SubResource("SkeletonModificationStack3D_gatbk")
|
||||||
|
|
||||||
|
[node name="flashlight" parent="Armature" index="1" instance=ExtResource("5_euvsl")]
|
||||||
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1.12407, 0.156779)
|
||||||
|
light_energy = 10.0
|
||||||
|
|
||||||
|
[node name="Status" type="Control" parent="." index="11"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("6_8h4hk")
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="Status" index="0"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_left = 192.847
|
||||||
|
offset_top = 162.692
|
||||||
|
offset_right = 232.847
|
||||||
|
offset_bottom = 202.692
|
||||||
|
|
||||||
|
[node name="Circle" type="Sprite2D" parent="Status/Control" index="0"]
|
||||||
|
scale = Vector2(0.287, 0.287)
|
||||||
|
texture = ExtResource("7_n2d8i")
|
||||||
|
|
||||||
|
[node name="mesh" type="Sprite2D" parent="Status/Control" index="1"]
|
||||||
|
modulate = Color(1, 0.345098, 0.345098, 1)
|
||||||
|
scale = Vector2(0.287, 0.287)
|
||||||
|
texture = ExtResource("8_t071y")
|
||||||
|
offset = Vector2(112, 0)
|
||||||
|
|
||||||
|
[node name="Velocity" type="Sprite2D" parent="Status/Control" index="2"]
|
||||||
|
scale = Vector2(0.287, 0.287)
|
||||||
|
texture = ExtResource("9_464xm")
|
||||||
|
|
||||||
|
[node name="Direction" type="Sprite2D" parent="Status/Control" index="3"]
|
||||||
|
scale = Vector2(0.287, 0.287)
|
||||||
|
texture = ExtResource("8_t071y")
|
||||||
|
offset = Vector2(112, 0)
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Status" index="1"]
|
||||||
|
offset_left = 500.618
|
||||||
|
offset_top = 234.989
|
||||||
|
offset_right = 540.618
|
||||||
|
offset_bottom = 248.989
|
||||||
|
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="Label2" type="Label" parent="Status" index="2"]
|
||||||
|
offset_left = 500.618
|
||||||
|
offset_top = 263.497
|
||||||
|
offset_right = 540.618
|
||||||
|
offset_bottom = 277.497
|
||||||
|
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="Label3" type="Label" parent="Status" index="3"]
|
||||||
|
offset_left = 500.618
|
||||||
|
offset_top = 291.052
|
||||||
|
offset_right = 540.618
|
||||||
|
offset_bottom = 305.052
|
||||||
|
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="Label4" type="Label" parent="Status" index="4"]
|
||||||
|
offset_left = 500.618
|
||||||
|
offset_top = 319.561
|
||||||
|
offset_right = 540.618
|
||||||
|
offset_bottom = 333.561
|
||||||
|
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="InteractionLabel" type="Label" parent="Status" index="5"]
|
||||||
|
anchors_preset = 12
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -55.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 0
|
||||||
|
theme_override_font_sizes/font_size = 16
|
||||||
|
text = "Press E to interact"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="RichTextLabel" type="RichTextLabel" parent="Status" index="6"]
|
||||||
|
visible = false
|
||||||
|
offset_left = 29.0
|
||||||
|
offset_top = 354.0
|
||||||
|
offset_right = 400.0
|
||||||
|
offset_bottom = 803.0
|
||||||
|
text = " Controls
|
||||||
|
(W,A,S,D) Move In The Four Directions
|
||||||
|
|
||||||
|
(Shift) Sprint
|
||||||
|
|
||||||
|
(C) Long Press : Switch First/Third Person View
|
||||||
|
|
||||||
|
(C) One Press : Switch Camera Angle (Right Shoulder,Left Shoulder,Head(Center) )
|
||||||
|
|
||||||
|
(Space) Jump
|
||||||
|
|
||||||
|
(CTRL) Crouch/UnCrouch
|
||||||
|
|
||||||
|
(Q) Run (Temporarily)
|
||||||
|
|
||||||
|
(F) Interaction
|
||||||
|
|
||||||
|
(L) Flashlight"
|
15
PlayerB/Player/Status.gd
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
@onready var player = get_parent()
|
||||||
|
@onready var direction = $Control/Direction
|
||||||
|
@onready var velocity = $Control/Velocity
|
||||||
|
@onready var mesh = $Control/mesh
|
||||||
|
|
||||||
|
func _physics_process(_delta):
|
||||||
|
|
||||||
|
var h_rot = get_parent().get_node("SpringArm3D").transform.basis.get_euler().y
|
||||||
|
|
||||||
|
$Control.set_rotation(h_rot)
|
||||||
|
# direction.rotation = atan2(player.direction.z, player.direction.x)
|
||||||
|
velocity.position = Vector2(player.velocity.x, player.velocity.z) * 10
|
||||||
|
mesh.rotation = 90-get_node("../Armature").rotation.y - player.rotation.y - .5
|
BIN
PlayerB/Player/UI/Debug/circle.png
Executable file
After Width: | Height: | Size: 65 KiB |
34
PlayerB/Player/UI/Debug/circle.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dpkisrpco54qj"
|
||||||
|
path="res://.godot/imported/circle.png-1389a13664e1742b334999390b1a9a14.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Player/UI/Debug/circle.png"
|
||||||
|
dest_files=["res://.godot/imported/circle.png-1389a13664e1742b334999390b1a9a14.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=1
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
PlayerB/Player/UI/Debug/direction.png
Executable file
After Width: | Height: | Size: 490 B |
34
PlayerB/Player/UI/Debug/direction.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ijv6wr22hov8"
|
||||||
|
path="res://.godot/imported/direction.png-6e04c7a9b69ddfb4068b96b600c9ba39.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Player/UI/Debug/direction.png"
|
||||||
|
dest_files=["res://.godot/imported/direction.png-6e04c7a9b69ddfb4068b96b600c9ba39.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=1
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
PlayerB/Player/UI/Debug/velocity.png
Executable file
After Width: | Height: | Size: 641 B |
34
PlayerB/Player/UI/Debug/velocity.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ck5riwbh478s4"
|
||||||
|
path="res://.godot/imported/velocity.png-4ed451d778b966c167af37c20ac4f374.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Player/UI/Debug/velocity.png"
|
||||||
|
dest_files=["res://.godot/imported/velocity.png-4ed451d778b966c167af37c20ac4f374.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=1
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
32
PlayerB/Player/flashlight/Flashlight.gd
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
extends SpotLight3D
|
||||||
|
|
||||||
|
|
||||||
|
var light_on_sound = preload("res://PlayerB/Player/flashlight/light_on.wav")
|
||||||
|
var light_off_sound = preload("res://PlayerB/Player/flashlight/light_off.wav")
|
||||||
|
var can_use = true
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
hide()
|
||||||
|
|
||||||
|
func _input(_event):
|
||||||
|
if Input.is_action_pressed("INPUT_ACTION_FLASHLIGHT"):
|
||||||
|
if can_use:
|
||||||
|
can_use = false
|
||||||
|
visible = !visible
|
||||||
|
if visible:
|
||||||
|
play_sound(light_on_sound, -10)
|
||||||
|
else:
|
||||||
|
play_sound(light_off_sound, -10)
|
||||||
|
else:
|
||||||
|
can_use = true
|
||||||
|
|
||||||
|
|
||||||
|
func play_sound(sound, volume):
|
||||||
|
var audio_node = AudioStreamPlayer.new()
|
||||||
|
add_child(audio_node)
|
||||||
|
audio_node.stream = sound
|
||||||
|
audio_node.volume_db = volume
|
||||||
|
audio_node.pitch_scale = randf_range(0.95, 1.05)
|
||||||
|
audio_node.play()
|
||||||
|
await get_tree().create_timer(2.0).timeout
|
||||||
|
audio_node.queue_free()
|
6
PlayerB/Player/flashlight/Flashlight.tscn
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://PlayerB/Player/flashlight/Flashlight.gd" id="1_2fd76"]
|
||||||
|
|
||||||
|
[node name="Flashlight" type="SpotLight3D"]
|
||||||
|
script = ExtResource( "1_2fd76" )
|
BIN
PlayerB/Player/flashlight/light_off.wav
Executable file
24
PlayerB/Player/flashlight/light_off.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cucrwfqvn2cx3"
|
||||||
|
path="res://.godot/imported/light_off.wav-dc81a71f7228da27c16df5183c9027ea.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Player/flashlight/light_off.wav"
|
||||||
|
dest_files=["res://.godot/imported/light_off.wav-dc81a71f7228da27c16df5183c9027ea.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/Player/flashlight/light_on.wav
Executable file
24
PlayerB/Player/flashlight/light_on.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cvr02ya5qaegd"
|
||||||
|
path="res://.godot/imported/light_on.wav-c3fab9fdd27fb31ee40c17ace903fc53.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/Player/flashlight/light_on.wav"
|
||||||
|
dest_files=["res://.godot/imported/light_on.wav-c3fab9fdd27fb31ee40c17ace903fc53.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
PlayerB/icon.png
Executable file
After Width: | Height: | Size: 573 KiB |
34
PlayerB/icon.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dkclvfkl080vn"
|
||||||
|
path="res://.godot/imported/icon.png-18865aeef078d62f4044ee4e8fcdd65f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://PlayerB/icon.png"
|
||||||
|
dest_files=["res://.godot/imported/icon.png-18865aeef078d62f4044ee4e8fcdd65f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
35
addons/AMSG/AI/AI_Base.gd
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
extends CharacterMovementComponent
|
||||||
|
class_name AI
|
||||||
|
|
||||||
|
|
||||||
|
var h_rotation :float
|
||||||
|
var v_rotation :float
|
||||||
|
|
||||||
|
var direction := Vector3.FORWARD
|
||||||
|
|
||||||
|
var Previousrotation_mode
|
||||||
|
func _ready():
|
||||||
|
super._ready()
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
super._physics_process(delta)
|
||||||
|
|
||||||
|
|
||||||
|
#------------------ Input Movement ------------------#
|
||||||
|
h_rotation = $CameraRoot.HObject.transform.basis.get_euler().y
|
||||||
|
v_rotation = $CameraRoot.VObject.transform.basis.get_euler().x
|
||||||
|
|
||||||
|
|
||||||
|
add_movement_input(Vector3(0.0,0.0,1.0), current_movement_data.walk_speed,current_movement_data.walk_acceleration)
|
||||||
|
|
||||||
|
#------------------ Look At ------------------#
|
||||||
|
match rotation_mode:
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
if input_is_moving:
|
||||||
|
ik_look_at(actual_velocity + Vector3(0.0,1.0,0.0))
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
|
||||||
|
|
12
addons/AMSG/AMSG.gd
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
@tool
|
||||||
|
extends EditorPlugin
|
||||||
|
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
# Initialization of the plugin goes here.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _exit_tree():
|
||||||
|
# Clean-up of the plugin goes here.
|
||||||
|
pass
|
62
addons/AMSG/Components/AnimationBlend.gd
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
extends AnimationTree
|
||||||
|
class_name AnimBlend
|
||||||
|
@export var movement_script_path : NodePath
|
||||||
|
@onready var movement_script := get_node(movement_script_path) # I use this to get variables from main movement script
|
||||||
|
|
||||||
|
func _physics_process(_delta):
|
||||||
|
|
||||||
|
if movement_script:
|
||||||
|
#Set Animation State
|
||||||
|
match movement_script.movement_state:
|
||||||
|
Global.movement_state.none:
|
||||||
|
pass
|
||||||
|
Global.movement_state.grounded:
|
||||||
|
set("parameters/InAir/blend_amount" , 0)
|
||||||
|
Global.movement_state.in_air:
|
||||||
|
set("parameters/InAir/blend_amount" , 1)
|
||||||
|
Global.movement_state.mantling:
|
||||||
|
pass
|
||||||
|
Global.movement_state.ragdoll:
|
||||||
|
pass
|
||||||
|
#Couch/stand switch
|
||||||
|
match movement_script.stance:
|
||||||
|
Global.stance.standing:
|
||||||
|
set("parameters/VelocityDirection/crouch/current" ,0)
|
||||||
|
Global.stance.crouching:
|
||||||
|
set("parameters/VelocityDirection/crouch/current" ,1)
|
||||||
|
|
||||||
|
#standing
|
||||||
|
set("parameters/VelocityOrLooking/blend_amount" ,0)
|
||||||
|
set("parameters/VelocityDirection/standing/conditions/idle",!movement_script.input_is_moving)
|
||||||
|
set("parameters/VelocityDirection/standing/conditions/walking",movement_script.gait == Global.gait.walking and movement_script.input_is_moving)
|
||||||
|
set("parameters/VelocityDirection/standing/conditions/running",movement_script.gait == Global.gait.running and movement_script.input_is_moving)
|
||||||
|
set("parameters/VelocityDirection/standing/conditions/sprinting",movement_script.gait == Global.gait.sprinting and movement_script.input_is_moving)
|
||||||
|
|
||||||
|
|
||||||
|
if movement_script.rotation_mode == Global.rotation_mode.looking_direction or movement_script.rotation_mode == Global.rotation_mode.aiming:
|
||||||
|
if movement_script.animation_is_moving_backward_relative_to_camera == false:
|
||||||
|
set("parameters/VelocityDirection/standing/Walk/FB/current",0)
|
||||||
|
set("parameters/VelocityDirection/standing/Jog/FB/current",0)
|
||||||
|
else:
|
||||||
|
set("parameters/VelocityDirection/standing/Walk/FB/current",1)
|
||||||
|
set("parameters/VelocityDirection/standing/Jog/FB/current",1)
|
||||||
|
else:
|
||||||
|
set("parameters/VelocityDirection/standing/Walk/FB/current",0)
|
||||||
|
set("parameters/VelocityDirection/standing/Jog/FB/current",0)
|
||||||
|
# Crouching
|
||||||
|
set("parameters/VelocityDirection/crouching/conditions/idle",!movement_script.input_is_moving)
|
||||||
|
set("parameters/VelocityDirection/crouching/conditions/walking",movement_script.gait == Global.gait.walking and movement_script.input_is_moving)
|
||||||
|
#On Stopped
|
||||||
|
if !(Input.is_action_pressed("INPUT_ACTION_FORWARD") || Input.is_action_pressed("INPUT_ACTION_BACK") || Input.is_action_pressed("INPUT_ACTION_RIGHT") || Input.is_action_pressed("INPUT_ACTION_LEFT")) and (Input.is_action_just_released("INPUT_ACTION_RIGHT") || Input.is_action_just_released("INPUT_ACTION_BACK") || Input.is_action_just_released("INPUT_ACTION_LEFT") || Input.is_action_just_released("INPUT_ACTION_FORWARD")):
|
||||||
|
|
||||||
|
var seek_time = get_node(anim_player).get_animation(tree_root.get_node("VelocityDirection").get_node("standing").get_node("Stopping").get_node("StopAnim").animation).length - movement_script.pose_warping_instance.CalculateStopTime((movement_script.actual_velocity * Vector3(1.0,0.0,1.0)),movement_script.deacceleration * movement_script.direction)
|
||||||
|
set("parameters/VelocityDirection/standing/Stopping/StopSeek/seek_position",seek_time)
|
||||||
|
set("parameters/VelocityDirection/standing/conditions/stop",!movement_script.input_is_moving)
|
||||||
|
|
||||||
|
#Rotate In Place
|
||||||
|
set("parameters/Turn/blend_amount" , 1 if movement_script.is_rotating_in_place else 0)
|
||||||
|
set("parameters/RightOrLeft/blend_amount" ,0 if movement_script.rotation_difference_camera_mesh > 0 else 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
268
addons/AMSG/Components/AnimationTreeComponent.tscn
Normal file
|
@ -0,0 +1,268 @@
|
||||||
|
[gd_scene load_steps=50 format=3 uid="uid://dsdvjuk7muqkf"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/AMSG/Components/AnimationBlend.gd" id="1_iikhh"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_twcy5"]
|
||||||
|
animation = &"TurnLeft"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a2hmg"]
|
||||||
|
animation = &"TurnRight"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_1l4w4"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vp77s"]
|
||||||
|
animation = &"Falling"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_r0ju1"]
|
||||||
|
animation = &"FallingStart"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ideig"]
|
||||||
|
switch_mode = 1
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_iqu7g"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_gg4yn"]
|
||||||
|
states/Falling/node = SubResource("AnimationNodeAnimation_vp77s")
|
||||||
|
states/Falling/position = Vector2(864, 268)
|
||||||
|
states/FallingStart/node = SubResource("AnimationNodeAnimation_r0ju1")
|
||||||
|
states/FallingStart/position = Vector2(600, 268)
|
||||||
|
states/Start/position = Vector2(404, 268)
|
||||||
|
transitions = ["FallingStart", "Falling", SubResource("AnimationNodeStateMachineTransition_ideig"), "Start", "FallingStart", SubResource("AnimationNodeStateMachineTransition_iqu7g")]
|
||||||
|
graph_offset = Vector2(116, 80)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_rgrah"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nh7d2"]
|
||||||
|
filter_enabled = true
|
||||||
|
filters = ["Armature/Skeleton3D:Hips", "Armature/Skeleton3D:LeftFoot", "Armature/Skeleton3D:LeftLeg", "Armature/Skeleton3D:LeftToeBase", "Armature/Skeleton3D:LeftUpLeg", "Armature/Skeleton3D:RightFoot", "Armature/Skeleton3D:RightLeg", "Armature/Skeleton3D:RightToeBase", "Armature/Skeleton3D:RightUpLeg"]
|
||||||
|
sync = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_ap4r3"]
|
||||||
|
sync = true
|
||||||
|
enabled_inputs = 2
|
||||||
|
xfade_time = 0.3
|
||||||
|
input_0/name = "stand"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "crouch"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_154hg"]
|
||||||
|
animation = &"CrouchIdle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0bv1y"]
|
||||||
|
animation = &"CrouchWalkingForward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_urt4k"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6juuf"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_611fp"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_w0g24"]
|
||||||
|
states/CrouchIdle/node = SubResource("AnimationNodeAnimation_154hg")
|
||||||
|
states/CrouchIdle/position = Vector2(321, 100)
|
||||||
|
states/CrouchWalkingForward/node = SubResource("AnimationNodeAnimation_0bv1y")
|
||||||
|
states/CrouchWalkingForward/position = Vector2(560, 100)
|
||||||
|
states/Start/position = Vector2(157, 100)
|
||||||
|
transitions = ["Start", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_urt4k"), "CrouchIdle", "CrouchWalkingForward", SubResource("AnimationNodeStateMachineTransition_6juuf"), "CrouchWalkingForward", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_611fp")]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5ouea"]
|
||||||
|
animation = &"Idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_q0w1d"]
|
||||||
|
animation = &"Jogbackward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_5puiv"]
|
||||||
|
enabled_inputs = 2
|
||||||
|
input_0/name = "Forward"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "Backward"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2fd4a"]
|
||||||
|
animation = &"JogForward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_fipxh"]
|
||||||
|
graph_offset = Vector2(-467, 62.6111)
|
||||||
|
nodes/Backward/node = SubResource("AnimationNodeAnimation_q0w1d")
|
||||||
|
nodes/Backward/position = Vector2(-100, 220)
|
||||||
|
nodes/FB/node = SubResource("AnimationNodeTransition_5puiv")
|
||||||
|
nodes/FB/position = Vector2(140, 140)
|
||||||
|
nodes/Forward/node = SubResource("AnimationNodeAnimation_2fd4a")
|
||||||
|
nodes/Forward/position = Vector2(-100, 100)
|
||||||
|
node_connections = [&"output", 0, &"FB", &"FB", 0, &"Forward", &"FB", 1, &"Backward"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j4dou"]
|
||||||
|
animation = &"Run"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o6ga8"]
|
||||||
|
animation = &"RunToStop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTimeSeek" id="AnimationNodeTimeSeek_mnurx"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_rd7gb"]
|
||||||
|
graph_offset = Vector2(-348.252, 95.8945)
|
||||||
|
nodes/StopAnim/node = SubResource("AnimationNodeAnimation_o6ga8")
|
||||||
|
nodes/StopAnim/position = Vector2(-260, 180)
|
||||||
|
nodes/StopSeek/node = SubResource("AnimationNodeTimeSeek_mnurx")
|
||||||
|
nodes/StopSeek/position = Vector2(-60, 160)
|
||||||
|
node_connections = [&"output", 0, &"StopSeek", &"StopSeek", 0, &"StopAnim"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fgiyf"]
|
||||||
|
animation = &"WalkingBackward"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_s7sc4"]
|
||||||
|
enabled_inputs = 2
|
||||||
|
input_0/name = "Forward"
|
||||||
|
input_0/auto_advance = false
|
||||||
|
input_1/name = "Backward"
|
||||||
|
input_1/auto_advance = false
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_msank"]
|
||||||
|
animation = &"Walk"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_8bvke"]
|
||||||
|
graph_offset = Vector2(-440, 10)
|
||||||
|
nodes/Backward/node = SubResource("AnimationNodeAnimation_fgiyf")
|
||||||
|
nodes/Backward/position = Vector2(-100, 180)
|
||||||
|
nodes/FB/node = SubResource("AnimationNodeTransition_s7sc4")
|
||||||
|
nodes/FB/position = Vector2(140, 100)
|
||||||
|
nodes/Forward/node = SubResource("AnimationNodeAnimation_msank")
|
||||||
|
nodes/Forward/position = Vector2(-60, 60)
|
||||||
|
node_connections = [&"output", 0, &"FB", &"FB", 0, &"Forward", &"FB", 1, &"Backward"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wnbtw"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 2
|
||||||
|
advance_condition = &"idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rvsaa"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_s0egl"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"sprinting"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xf5i1"]
|
||||||
|
auto_advance = true
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nbs2g"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rs3n0"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6gab4"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6m5a2"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"walking"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hy2h2"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2tyel"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"sprinting"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7h1qf"]
|
||||||
|
advance_condition = &"stop"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4twgu"]
|
||||||
|
xfade_time = 0.2
|
||||||
|
switch_mode = 1
|
||||||
|
advance_condition = &"running"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_5xtv7"]
|
||||||
|
states/Idle/node = SubResource("AnimationNodeAnimation_5ouea")
|
||||||
|
states/Idle/position = Vector2(137, 278)
|
||||||
|
states/Jog/node = SubResource("AnimationNodeBlendTree_fipxh")
|
||||||
|
states/Jog/position = Vector2(687.227, 134)
|
||||||
|
states/Run/node = SubResource("AnimationNodeAnimation_j4dou")
|
||||||
|
states/Run/position = Vector2(881, 296)
|
||||||
|
states/Start/position = Vector2(22, 278)
|
||||||
|
states/Stopping/node = SubResource("AnimationNodeBlendTree_rd7gb")
|
||||||
|
states/Stopping/position = Vector2(505, 327)
|
||||||
|
states/Walk/node = SubResource("AnimationNodeBlendTree_8bvke")
|
||||||
|
states/Walk/position = Vector2(216.227, 134)
|
||||||
|
transitions = ["Stopping", "Idle", SubResource("AnimationNodeStateMachineTransition_wnbtw"), "Run", "Stopping", SubResource("AnimationNodeStateMachineTransition_rvsaa"), "Idle", "Run", SubResource("AnimationNodeStateMachineTransition_s0egl"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_xf5i1"), "Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_nbs2g"), "Walk", "Stopping", SubResource("AnimationNodeStateMachineTransition_rs3n0"), "Walk", "Jog", SubResource("AnimationNodeStateMachineTransition_6gab4"), "Jog", "Walk", SubResource("AnimationNodeStateMachineTransition_6m5a2"), "Run", "Jog", SubResource("AnimationNodeStateMachineTransition_hy2h2"), "Jog", "Run", SubResource("AnimationNodeStateMachineTransition_2tyel"), "Jog", "Stopping", SubResource("AnimationNodeStateMachineTransition_7h1qf"), "Idle", "Jog", SubResource("AnimationNodeStateMachineTransition_4twgu")]
|
||||||
|
graph_offset = Vector2(-13.773, 102)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_512i8"]
|
||||||
|
graph_offset = Vector2(-482.415, 81.5292)
|
||||||
|
nodes/crouch/node = SubResource("AnimationNodeTransition_ap4r3")
|
||||||
|
nodes/crouch/position = Vector2(100, 180)
|
||||||
|
nodes/crouching/node = SubResource("AnimationNodeStateMachine_w0g24")
|
||||||
|
nodes/crouching/position = Vector2(-120, 300)
|
||||||
|
nodes/standing/node = SubResource("AnimationNodeStateMachine_5xtv7")
|
||||||
|
nodes/standing/position = Vector2(-120, 40)
|
||||||
|
node_connections = [&"output", 0, &"crouch", &"crouch", 0, &"standing", &"crouch", 1, &"crouching"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nh6tc"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
graph_offset = Vector2(164.583, 955.611)
|
||||||
|
nodes/AnimTurnLeft/node = SubResource("AnimationNodeAnimation_twcy5")
|
||||||
|
nodes/AnimTurnLeft/position = Vector2(500, 1540)
|
||||||
|
nodes/AnimTurnRight/node = SubResource("AnimationNodeAnimation_a2hmg")
|
||||||
|
nodes/AnimTurnRight/position = Vector2(500, 1660)
|
||||||
|
nodes/InAir/node = SubResource("AnimationNodeBlend2_1l4w4")
|
||||||
|
nodes/InAir/position = Vector2(1280, 1380)
|
||||||
|
nodes/InAirState/node = SubResource("AnimationNodeStateMachine_gg4yn")
|
||||||
|
nodes/InAirState/position = Vector2(1020, 1680)
|
||||||
|
nodes/RightOrLeft/node = SubResource("AnimationNodeBlend2_rgrah")
|
||||||
|
nodes/RightOrLeft/position = Vector2(720, 1560)
|
||||||
|
nodes/Turn/node = SubResource("AnimationNodeBlend2_nh7d2")
|
||||||
|
nodes/Turn/position = Vector2(980, 1400)
|
||||||
|
nodes/VelocityDirection/node = SubResource("AnimationNodeBlendTree_512i8")
|
||||||
|
nodes/VelocityDirection/position = Vector2(680, 1400)
|
||||||
|
nodes/output/position = Vector2(1540, 1400)
|
||||||
|
node_connections = [&"output", 0, &"InAir", &"InAir", 0, &"Turn", &"InAir", 1, &"InAirState", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_fbdts"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_wc2uc"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_2vj45"]
|
||||||
|
|
||||||
|
[node name="AnimationTree" type="AnimationTree"]
|
||||||
|
tree_root = SubResource("AnimationNodeBlendTree_nh6tc")
|
||||||
|
anim_player = NodePath("../Character/AnimationPlayer")
|
||||||
|
parameters/InAir/blend_amount = 0.0
|
||||||
|
parameters/InAirState/playback = SubResource("AnimationNodeStateMachinePlayback_fbdts")
|
||||||
|
parameters/RightOrLeft/blend_amount = 0.0
|
||||||
|
parameters/Turn/blend_amount = 0.0
|
||||||
|
parameters/VelocityDirection/crouch/current = 0
|
||||||
|
parameters/VelocityDirection/crouching/playback = SubResource("AnimationNodeStateMachinePlayback_wc2uc")
|
||||||
|
parameters/VelocityDirection/crouching/conditions/idle = false
|
||||||
|
parameters/VelocityDirection/crouching/conditions/walking = false
|
||||||
|
parameters/VelocityDirection/standing/playback = SubResource("AnimationNodeStateMachinePlayback_2vj45")
|
||||||
|
parameters/VelocityDirection/standing/conditions/idle = true
|
||||||
|
parameters/VelocityDirection/standing/conditions/running = false
|
||||||
|
parameters/VelocityDirection/standing/conditions/sprinting = false
|
||||||
|
parameters/VelocityDirection/standing/conditions/stop = false
|
||||||
|
parameters/VelocityDirection/standing/conditions/walking = false
|
||||||
|
parameters/VelocityDirection/standing/Jog/FB/current = 0
|
||||||
|
parameters/VelocityDirection/standing/Stopping/StopSeek/seek_position = -1.0
|
||||||
|
parameters/VelocityDirection/standing/Walk/FB/current = 0
|
||||||
|
script = ExtResource("1_iikhh")
|
103
addons/AMSG/Components/CameraComponent.gd
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
extends Node
|
||||||
|
class_name CameraComponent
|
||||||
|
|
||||||
|
|
||||||
|
@export var networking_path : NodePath
|
||||||
|
@onready var networking = get_node(networking_path)
|
||||||
|
#####################################
|
||||||
|
#Refrences
|
||||||
|
@export var character_movement_component : NodePath
|
||||||
|
@export var camera_path : NodePath
|
||||||
|
@export var spring_arm_path : NodePath
|
||||||
|
|
||||||
|
@onready var SpringArm = get_node(spring_arm_path)
|
||||||
|
@onready var Camera = get_node(camera_path)
|
||||||
|
@onready var PlayerRef = get_node(character_movement_component)
|
||||||
|
@onready var HObject = SpringArm
|
||||||
|
@onready var VObject = SpringArm
|
||||||
|
#####################################
|
||||||
|
var CameraHOffset := 0.0
|
||||||
|
@export var view_angle : Global.view_angle = Global.view_angle.right_shoulder:
|
||||||
|
get: return view_angle
|
||||||
|
set(Newview_angle):
|
||||||
|
# if view_mode == Global.view_mode.first_person:
|
||||||
|
# return
|
||||||
|
view_angle = Newview_angle
|
||||||
|
if Camera:
|
||||||
|
match Newview_angle:
|
||||||
|
Global.view_angle.right_shoulder:
|
||||||
|
CameraHOffset = 0.45
|
||||||
|
update_camera_offset()
|
||||||
|
Global.view_angle.left_shoulder:
|
||||||
|
CameraHOffset = -0.45
|
||||||
|
update_camera_offset()
|
||||||
|
Global.view_angle.head:
|
||||||
|
CameraHOffset = 0.0
|
||||||
|
update_camera_offset()
|
||||||
|
|
||||||
|
|
||||||
|
@export var view_mode = Global.view_mode :
|
||||||
|
get: return view_mode
|
||||||
|
set(Newview_mode):
|
||||||
|
view_mode = Newview_mode
|
||||||
|
if VObject:
|
||||||
|
VObject.rotation.x = 0.0
|
||||||
|
if SpringArm:
|
||||||
|
match view_mode:
|
||||||
|
Global.view_mode.first_person:
|
||||||
|
view_angle = Global.view_angle.head
|
||||||
|
PlayerRef.rotation_mode = Global.rotation_mode.looking_direction
|
||||||
|
SpringArm.spring_length = -0.4
|
||||||
|
VObject = Camera
|
||||||
|
Global.view_mode.third_person:
|
||||||
|
SpringArm.spring_length = 1.75
|
||||||
|
VObject = SpringArm
|
||||||
|
|
||||||
|
|
||||||
|
@export var mouse_sensitvity : float = 0.01
|
||||||
|
var camera_h : float = 0
|
||||||
|
var camera_v : float = 0
|
||||||
|
@export var camera_vertical_min = -90
|
||||||
|
@export var camera_vertical_max =90
|
||||||
|
var acceleration_h = 10
|
||||||
|
var acceleration_v = 10
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
# Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
|
Camera.current = networking.is_local_authority()
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if event is InputEventMouseMotion:
|
||||||
|
camera_h += -event.relative.x * mouse_sensitvity
|
||||||
|
camera_v += -event.relative.y * mouse_sensitvity
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
camera_v = clamp(camera_v,deg_to_rad(camera_vertical_min),deg_to_rad(camera_vertical_max))
|
||||||
|
HObject.rotation.y = lerp(HObject.rotation.y,camera_h,delta * acceleration_h)
|
||||||
|
VObject.rotation.x = lerp(VObject.rotation.x,camera_v,delta * acceleration_v)
|
||||||
|
|
||||||
|
match PlayerRef.rotation_mode:
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
if PlayerRef.gait == Global.gait.sprinting: # character can't sprint while aiming
|
||||||
|
PlayerRef.gait = Global.gait.running
|
||||||
|
smooth_fov(60.0)
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
smooth_fov(90.0)
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
smooth_fov(90.0)
|
||||||
|
|
||||||
|
|
||||||
|
func update_camera_offset():
|
||||||
|
var tween := create_tween()
|
||||||
|
tween.tween_property(Camera,"h_offset",CameraHOffset,0.5).set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_EXPO)
|
||||||
|
|
||||||
|
var changing_view := false
|
||||||
|
func smooth_fov(current_fov:float):
|
||||||
|
if changing_view:
|
||||||
|
return
|
||||||
|
changing_view=true
|
||||||
|
var tween := create_tween()
|
||||||
|
tween.tween_property(Camera,"fov",current_fov,0.1)
|
||||||
|
tween.tween_callback(func(): changing_view=false)
|
640
addons/AMSG/Components/CharacterMovementComponent.gd
Normal file
|
@ -0,0 +1,640 @@
|
||||||
|
extends Node
|
||||||
|
class_name CharacterMovementComponent
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
@export_category("Refrences")
|
||||||
|
@export var character_path : NodePath
|
||||||
|
@export var mesh_path : NodePath
|
||||||
|
@export var skeleton_path : NodePath
|
||||||
|
@export var anim_tree_path : NodePath
|
||||||
|
@export var camera_component : NodePath
|
||||||
|
@export var collision_shape_path : NodePath
|
||||||
|
#Refrences
|
||||||
|
@onready var mesh_ref = get_node(mesh_path)
|
||||||
|
@onready var anim_ref : AnimBlend = get_node(anim_tree_path)
|
||||||
|
@onready var skeleton_ref : Skeleton3D = get_node(skeleton_path)
|
||||||
|
@onready var collision_shape_ref = get_node(collision_shape_path)
|
||||||
|
#@onready var bonker = $CollisionShape3D/HeadBonker
|
||||||
|
@onready var camera_root : CameraComponent = get_node(camera_component)
|
||||||
|
@onready var character_node : CharacterBody3D = get_node(character_path)
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
#Movement Settings
|
||||||
|
@export_category("Movement Data")
|
||||||
|
@export var AI := false
|
||||||
|
|
||||||
|
@export var is_flying := false
|
||||||
|
@export var gravity := 9.8
|
||||||
|
|
||||||
|
@export var tilt := false
|
||||||
|
@export var tilt_power := 1.0
|
||||||
|
|
||||||
|
@export var ragdoll := false :
|
||||||
|
get: return ragdoll
|
||||||
|
set(Newragdoll):
|
||||||
|
ragdoll = Newragdoll
|
||||||
|
if ragdoll == true:
|
||||||
|
if skeleton_ref:
|
||||||
|
skeleton_ref.physical_bones_start_simulation()
|
||||||
|
else:
|
||||||
|
if skeleton_ref:
|
||||||
|
skeleton_ref.physical_bones_stop_simulation()
|
||||||
|
|
||||||
|
|
||||||
|
@export var jump_magnitude := 5.0
|
||||||
|
@export var max_stair_climb_height : float = 0.5
|
||||||
|
@export var max_close_stair_distance : float = 0.75
|
||||||
|
@export var roll_magnitude := 17.0
|
||||||
|
|
||||||
|
var default_height := 2.0
|
||||||
|
var crouch_height := 1.0
|
||||||
|
|
||||||
|
@export var crouch_switch_speed := 5.0
|
||||||
|
|
||||||
|
@export var rotation_in_place_min_angle := 90.0
|
||||||
|
|
||||||
|
#Movement Values Settings
|
||||||
|
#you could play with the values to achieve different movement settings
|
||||||
|
var deacceleration := 8.0
|
||||||
|
var acceleration_reducer := 4.0
|
||||||
|
var movement_data = {
|
||||||
|
normal = {
|
||||||
|
looking_direction = {
|
||||||
|
standing = {
|
||||||
|
walk_speed = 1.75,
|
||||||
|
run_speed = 3.75,
|
||||||
|
sprint_speed = 6.5,
|
||||||
|
|
||||||
|
walk_acceleration = 20.0/acceleration_reducer,
|
||||||
|
run_acceleration = 20.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 7.5/acceleration_reducer,
|
||||||
|
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
},
|
||||||
|
|
||||||
|
crouching = {
|
||||||
|
walk_speed = 1.5,
|
||||||
|
run_speed = 2,
|
||||||
|
sprint_speed = 3,
|
||||||
|
|
||||||
|
walk_acceleration = 25.0/acceleration_reducer,
|
||||||
|
run_acceleration = 25.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 5.0/acceleration_reducer,
|
||||||
|
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
velocity_direction = {
|
||||||
|
standing = {
|
||||||
|
walk_speed = 1.75,
|
||||||
|
run_speed = 3.75,
|
||||||
|
sprint_speed = 6.5,
|
||||||
|
|
||||||
|
#Nomral Acceleration
|
||||||
|
walk_acceleration = 20.0/acceleration_reducer,
|
||||||
|
run_acceleration = 20.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 7.5/acceleration_reducer,
|
||||||
|
|
||||||
|
#Responsive Rotation
|
||||||
|
idle_rotation_rate = 5.0,
|
||||||
|
walk_rotation_rate = 8.0,
|
||||||
|
run_rotation_rate = 12.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
},
|
||||||
|
|
||||||
|
crouching = {
|
||||||
|
walk_speed = 1.5,
|
||||||
|
run_speed = 2,
|
||||||
|
sprint_speed = 3,
|
||||||
|
|
||||||
|
#Responsive Acceleration
|
||||||
|
walk_acceleration = 25.0/acceleration_reducer,
|
||||||
|
run_acceleration = 25.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 5.0/acceleration_reducer,
|
||||||
|
|
||||||
|
#Nomral Rotation
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
aiming = {
|
||||||
|
standing = {
|
||||||
|
walk_speed = 1.65,
|
||||||
|
run_speed = 3.75,
|
||||||
|
sprint_speed = 6.5,
|
||||||
|
|
||||||
|
walk_acceleration = 20.0/acceleration_reducer,
|
||||||
|
run_acceleration = 20.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 7.5/acceleration_reducer,
|
||||||
|
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
},
|
||||||
|
|
||||||
|
crouching = {
|
||||||
|
walk_speed = 1.5,
|
||||||
|
run_speed = 2,
|
||||||
|
sprint_speed = 3,
|
||||||
|
|
||||||
|
walk_acceleration = 25.0/acceleration_reducer,
|
||||||
|
run_acceleration = 25.0/acceleration_reducer,
|
||||||
|
sprint_acceleration = 5.0/acceleration_reducer,
|
||||||
|
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
#for logic #it is better not to change it if you don't want to break the system / only change it if you want to redesign the system
|
||||||
|
var actual_acceleration :Vector3
|
||||||
|
var input_acceleration :Vector3
|
||||||
|
|
||||||
|
var vertical_velocity :Vector3
|
||||||
|
|
||||||
|
var actual_velocity :Vector3
|
||||||
|
var input_velocity :Vector3
|
||||||
|
var movement_direction
|
||||||
|
|
||||||
|
var tiltVector : Vector3
|
||||||
|
|
||||||
|
var is_moving := false
|
||||||
|
var input_is_moving := false
|
||||||
|
|
||||||
|
var head_bonked := false
|
||||||
|
|
||||||
|
var is_rotating_in_place := false
|
||||||
|
var rotation_difference_camera_mesh : float
|
||||||
|
|
||||||
|
var aim_rate_h :float
|
||||||
|
|
||||||
|
var is_moving_on_stair :bool
|
||||||
|
|
||||||
|
|
||||||
|
var current_movement_data = {
|
||||||
|
walk_speed = 1.75,
|
||||||
|
run_speed = 3.75,
|
||||||
|
sprint_speed = 6.5,
|
||||||
|
|
||||||
|
walk_acceleration = 20.0,
|
||||||
|
run_acceleration = 20.0,
|
||||||
|
sprint_acceleration = 7.5,
|
||||||
|
|
||||||
|
idle_rotation_rate = 0.5,
|
||||||
|
walk_rotation_rate = 4.0,
|
||||||
|
run_rotation_rate = 5.0,
|
||||||
|
sprint_rotation_rate = 20.0,
|
||||||
|
}
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
#animation
|
||||||
|
var animation_is_moving_backward_relative_to_camera : bool
|
||||||
|
var animation_velocity : Vector3
|
||||||
|
|
||||||
|
#status
|
||||||
|
var movement_state = Global.movement_state.grounded
|
||||||
|
var movement_action = Global.movement_action.none
|
||||||
|
@export_category("States")
|
||||||
|
@export var rotation_mode : Global.rotation_mode = Global.rotation_mode.velocity_direction :
|
||||||
|
get: return rotation_mode
|
||||||
|
set(Newrotation_mode):
|
||||||
|
rotation_mode = Newrotation_mode
|
||||||
|
update_character_movement()
|
||||||
|
|
||||||
|
|
||||||
|
@export var gait : Global.gait = Global.gait.walking :
|
||||||
|
get: return gait
|
||||||
|
set(Newgait):
|
||||||
|
gait = Newgait
|
||||||
|
update_character_movement()
|
||||||
|
@export var stance : Global.stance = Global.stance.standing :
|
||||||
|
set(Newstance):
|
||||||
|
stance = Newstance
|
||||||
|
update_character_movement()
|
||||||
|
@export var overlay_state = Global.overlay_state
|
||||||
|
|
||||||
|
@export_category("Animations")
|
||||||
|
@export var TurnLeftAnim : String = "TurnLeft":
|
||||||
|
set(value):
|
||||||
|
TurnLeftAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var TurnRightAnim : String = "TurnRight":
|
||||||
|
set(value):
|
||||||
|
TurnRightAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var FallingStartAnim : String = "FallingStart":
|
||||||
|
set(value):
|
||||||
|
FallingStartAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var FallingAnim : String = "Falling":
|
||||||
|
set(value):
|
||||||
|
FallingAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var IdleAnim : String = "Idle":
|
||||||
|
set(value):
|
||||||
|
IdleAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var WalkForwardAnim : String = "Walk":
|
||||||
|
set(value):
|
||||||
|
WalkForwardAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var WalkBackwardAnim : String = "WalkingBackward":
|
||||||
|
set(value):
|
||||||
|
WalkBackwardAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var JogForwardAnim : String = "JogForward":
|
||||||
|
set(value):
|
||||||
|
JogForwardAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var JogBackwardAnim : String = "Jogbackward":
|
||||||
|
set(value):
|
||||||
|
JogBackwardAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var RunAnim : String = "Run":
|
||||||
|
set(value):
|
||||||
|
RunAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var StopAnim : String = "RunToStop":
|
||||||
|
set(value):
|
||||||
|
StopAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var CrouchIdleAnim : String = "CrouchIdle":
|
||||||
|
set(value):
|
||||||
|
CrouchIdleAnim = value
|
||||||
|
update_animations()
|
||||||
|
@export var CrouchWalkAnim : String = "CrouchWalkingForward":
|
||||||
|
set(value):
|
||||||
|
CrouchWalkAnim = value
|
||||||
|
update_animations()
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
|
||||||
|
func update_animations():
|
||||||
|
if !anim_ref:
|
||||||
|
return
|
||||||
|
anim_ref.tree_root.get_node("AnimTurnLeft").animation = TurnLeftAnim
|
||||||
|
anim_ref.tree_root.get_node("AnimTurnRight").animation = TurnRightAnim
|
||||||
|
anim_ref.tree_root.get_node("InAirState").get_node("FallingStart").animation = FallingStartAnim
|
||||||
|
anim_ref.tree_root.get_node("InAirState").get_node("Falling").animation = FallingAnim
|
||||||
|
var velocity_direction : AnimationNodeBlendTree = anim_ref.tree_root.get_node("VelocityDirection")
|
||||||
|
var standing_states = velocity_direction.get_node("standing")
|
||||||
|
standing_states.get_node("Idle").animation = IdleAnim
|
||||||
|
standing_states.get_node("Walk").get_node("Forward").animation = WalkForwardAnim
|
||||||
|
standing_states.get_node("Walk").get_node("Backward").animation = WalkBackwardAnim
|
||||||
|
standing_states.get_node("Jog").get_node("Forward").animation = JogForwardAnim
|
||||||
|
standing_states.get_node("Jog").get_node("Backward").animation = JogBackwardAnim
|
||||||
|
standing_states.get_node("Run").animation = RunAnim
|
||||||
|
standing_states.get_node("Stopping").get_node("StopAnim").animation = StopAnim
|
||||||
|
velocity_direction.get_node("crouching").get_node("CrouchIdle").animation = CrouchIdleAnim
|
||||||
|
velocity_direction.get_node("crouching").get_node("CrouchWalkingForward").animation = CrouchWalkAnim
|
||||||
|
func update_character_movement():
|
||||||
|
match rotation_mode:
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
if skeleton_ref:
|
||||||
|
skeleton_ref.modification_stack.enabled = false
|
||||||
|
tilt = false
|
||||||
|
match stance:
|
||||||
|
Global.stance.standing:
|
||||||
|
current_movement_data = movement_data.normal.velocity_direction.standing
|
||||||
|
Global.stance.crouching:
|
||||||
|
current_movement_data = movement_data.normal.velocity_direction.crouching
|
||||||
|
|
||||||
|
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
if skeleton_ref:
|
||||||
|
skeleton_ref.modification_stack.enabled = false #Change to true when Godot fixes the bug.
|
||||||
|
tilt = true
|
||||||
|
match stance:
|
||||||
|
Global.stance.standing:
|
||||||
|
current_movement_data = movement_data.normal.looking_direction.standing
|
||||||
|
Global.stance.crouching:
|
||||||
|
current_movement_data = movement_data.normal.looking_direction.crouching
|
||||||
|
|
||||||
|
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
match stance:
|
||||||
|
Global.stance.standing:
|
||||||
|
current_movement_data = movement_data.normal.aiming.standing
|
||||||
|
Global.stance.crouching:
|
||||||
|
current_movement_data = movement_data.normal.aiming.crouching
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
var previous_aim_rate_h :float
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
update_animations()
|
||||||
|
update_character_movement()
|
||||||
|
var pose_warping_instance = pose_warping.new()
|
||||||
|
func _process(delta):
|
||||||
|
calc_animation_data()
|
||||||
|
var orientation_warping_condition = rotation_mode != Global.rotation_mode.velocity_direction and movement_state == Global.movement_state.grounded and movement_action == Global.movement_action.none and gait != Global.gait.sprinting and input_is_moving
|
||||||
|
pose_warping_instance.orientation_warping( orientation_warping_condition,camera_root.HObject,animation_velocity,skeleton_ref,"Hips",["Spine","Spine1","Spine2"],0.0,delta)
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
#Debug()
|
||||||
|
#
|
||||||
|
aim_rate_h = abs((camera_root.HObject.rotation.y - previous_aim_rate_h) / delta)
|
||||||
|
previous_aim_rate_h = camera_root.HObject.rotation.y
|
||||||
|
#
|
||||||
|
# animation_stride_warping()
|
||||||
|
|
||||||
|
match movement_state:
|
||||||
|
Global.movement_state.none:
|
||||||
|
pass
|
||||||
|
Global.movement_state.grounded:
|
||||||
|
#------------------ Rotate Character Mesh ------------------#
|
||||||
|
match movement_action:
|
||||||
|
Global.movement_action.none:
|
||||||
|
match rotation_mode:
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
if (is_moving and input_is_moving) or (actual_velocity * Vector3(1.0,0.0,1.0)).length() > 0.5:
|
||||||
|
smooth_character_rotation(actual_velocity,calc_grounded_rotation_rate(),delta)
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
if (is_moving and input_is_moving) or (actual_velocity * Vector3(1.0,0.0,1.0)).length() > 0.5:
|
||||||
|
smooth_character_rotation(-camera_root.HObject.transform.basis.z if gait != Global.gait.sprinting else actual_velocity,calc_grounded_rotation_rate(),delta)
|
||||||
|
rotate_in_place_check()
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
if (is_moving and input_is_moving) or (actual_velocity * Vector3(1.0,0.0,1.0)).length() > 0.5:
|
||||||
|
smooth_character_rotation(-camera_root.HObject.transform.basis.z,calc_grounded_rotation_rate(),delta)
|
||||||
|
rotate_in_place_check()
|
||||||
|
Global.movement_action.rolling:
|
||||||
|
if input_is_moving == true:
|
||||||
|
smooth_character_rotation(input_acceleration ,2.0,delta)
|
||||||
|
|
||||||
|
Global.movement_state.in_air:
|
||||||
|
#------------------ Rotate Character Mesh In Air ------------------#
|
||||||
|
match rotation_mode:
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
smooth_character_rotation(actual_velocity if (actual_velocity * Vector3(1.0,0.0,1.0)).length() > 1.0 else -camera_root.HObject.transform.basis.z,5.0,delta)
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
smooth_character_rotation(actual_velocity if (actual_velocity * Vector3(1.0,0.0,1.0)).length() > 1.0 else -camera_root.HObject.transform.basis.z,5.0,delta)
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
smooth_character_rotation(-camera_root.HObject.transform.basis.z ,15.0,delta)
|
||||||
|
#------------------ Mantle Check ------------------#
|
||||||
|
if input_is_moving == true:
|
||||||
|
mantle_check()
|
||||||
|
Global.movement_state.mantling:
|
||||||
|
pass
|
||||||
|
Global.movement_state.ragdoll:
|
||||||
|
pass
|
||||||
|
|
||||||
|
#------------------ Crouch ------------------#
|
||||||
|
crouch_update(delta)
|
||||||
|
|
||||||
|
#------------------ Gravity ------------------#
|
||||||
|
if is_flying == false:
|
||||||
|
character_node.velocity.y = lerp(character_node.velocity.y,vertical_velocity.y - character_node.get_floor_normal().y,delta * gravity)
|
||||||
|
character_node.move_and_slide()
|
||||||
|
if character_node.is_on_floor() and is_flying == false:
|
||||||
|
movement_state = Global.movement_state.grounded
|
||||||
|
vertical_velocity = -character_node.get_floor_normal() * 10
|
||||||
|
else:
|
||||||
|
await get_tree().create_timer(0.1).timeout #wait a moment to see if the character lands fast (this means that the character didn't fall, but stepped down a bit.)
|
||||||
|
movement_state = Global.movement_state.in_air
|
||||||
|
vertical_velocity += Vector3.DOWN * gravity * delta
|
||||||
|
if character_node.is_on_ceiling():
|
||||||
|
vertical_velocity.y = 0
|
||||||
|
#------------------ Stair climb ------------------#
|
||||||
|
#stair movement must happen after gravity so it can override in air status
|
||||||
|
stair_move()
|
||||||
|
|
||||||
|
func crouch_update(delta):
|
||||||
|
var direct_state = character_node.get_world_3d().direct_space_state
|
||||||
|
var ray_info : PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.new()
|
||||||
|
ray_info.exclude = [collision_shape_ref]
|
||||||
|
ray_info.from = collision_shape_ref.global_transform.origin + Vector3(0,collision_shape_ref.shape.height/2,0)
|
||||||
|
ray_info.to = ray_info.from + Vector3(0, 0.2, 0)
|
||||||
|
var collision = direct_state.intersect_ray(ray_info)
|
||||||
|
if collision:
|
||||||
|
head_bonked = true
|
||||||
|
else:
|
||||||
|
head_bonked = false
|
||||||
|
|
||||||
|
if stance == Global.stance.crouching:
|
||||||
|
collision_shape_ref.shape.height -= crouch_switch_speed * delta /2
|
||||||
|
mesh_ref.transform.origin.y += crouch_switch_speed * delta /1.5
|
||||||
|
elif stance == Global.stance.standing and not head_bonked:
|
||||||
|
collision_shape_ref.shape.height += crouch_switch_speed * delta /2
|
||||||
|
mesh_ref.transform.origin.y -= crouch_switch_speed * delta /1.5
|
||||||
|
elif head_bonked:
|
||||||
|
pass
|
||||||
|
mesh_ref.transform.origin.y = clamp(mesh_ref.transform.origin.y,0.0,0.5)
|
||||||
|
collision_shape_ref.shape.height = clamp(collision_shape_ref.shape.height,crouch_height,default_height)
|
||||||
|
|
||||||
|
|
||||||
|
func stair_move():
|
||||||
|
var direct_state = character_node.get_world_3d().direct_space_state
|
||||||
|
var obs_ray_info : PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.new()
|
||||||
|
obs_ray_info.exclude = [character_node]
|
||||||
|
obs_ray_info.from = mesh_ref.global_transform.origin
|
||||||
|
obs_ray_info.to = obs_ray_info.from + Vector3(0, 0, max_close_stair_distance).rotated(Vector3.UP,movement_direction)
|
||||||
|
|
||||||
|
#this is used to know if there is obstacle
|
||||||
|
var first_collision = direct_state.intersect_ray(obs_ray_info)
|
||||||
|
if first_collision and input_is_moving:
|
||||||
|
var climb_ray_info : PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.new()
|
||||||
|
climb_ray_info.exclude = [character_node]
|
||||||
|
climb_ray_info.from = first_collision.collider.global_position + Vector3(0, max_stair_climb_height, 0)
|
||||||
|
climb_ray_info.to = first_collision.collider.global_position
|
||||||
|
var stair_top_collision = direct_state.intersect_ray(climb_ray_info)
|
||||||
|
if stair_top_collision:
|
||||||
|
if stair_top_collision.position.y - character_node.global_position.y > 0 and stair_top_collision.position.y - character_node.global_position.y < 0.15:
|
||||||
|
movement_state = Global.movement_state.grounded
|
||||||
|
is_moving_on_stair = true
|
||||||
|
character_node.position.y += stair_top_collision.position.y - character_node.global_position.y
|
||||||
|
character_node.global_position += Vector3(0, 0, 0.01).rotated(Vector3.UP,movement_direction)
|
||||||
|
else:
|
||||||
|
await get_tree().create_timer(0.4).timeout
|
||||||
|
is_moving_on_stair = false
|
||||||
|
else:
|
||||||
|
await get_tree().create_timer(0.4).timeout
|
||||||
|
is_moving_on_stair = false
|
||||||
|
else:
|
||||||
|
await get_tree().create_timer(0.4).timeout
|
||||||
|
is_moving_on_stair = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func smooth_character_rotation(Target:Vector3,nodelerpspeed,delta):
|
||||||
|
mesh_ref.rotation.y = lerp_angle(mesh_ref.rotation.y, atan2(Target.x,Target.z) , delta * nodelerpspeed)
|
||||||
|
|
||||||
|
|
||||||
|
func set_bone_x_rotation(skeleton,bone_name, x_rot,CharacterRootNode):
|
||||||
|
var bone = skeleton.find_bone(bone_name)
|
||||||
|
var bone_transform : Transform3D = skeleton.global_pose_to_local_pose(bone,skeleton.get_bone_global_pose_no_override(bone))
|
||||||
|
var rotate_amount = x_rot
|
||||||
|
bone_transform = bone_transform.rotated(Vector3(1,0,0), rotate_amount)
|
||||||
|
skeleton.set_bone_local_pose_override(bone, bone_transform,1.0,true)
|
||||||
|
|
||||||
|
|
||||||
|
var prev :Transform3D
|
||||||
|
var current :Transform3D
|
||||||
|
var anim_speed
|
||||||
|
func animation_stride_warping(): #this is currently being worked on and tested, so I don't reccomend using it.
|
||||||
|
|
||||||
|
|
||||||
|
skeleton_ref.clear_bones_local_pose_override()
|
||||||
|
var distance_in_each_frame = (character_node.get_real_velocity()*Vector3(1,0,1)).rotated(Vector3.UP,mesh_ref.transform.basis.get_euler().y).length()
|
||||||
|
var hips = skeleton_ref.find_bone("Hips")
|
||||||
|
var hips_transform = skeleton_ref.get_bone_pose(hips)
|
||||||
|
var Feet : Array = ["RightFoot","LeftFoot"]
|
||||||
|
var Thighs : Array = ["RightUpLeg","LeftUpLeg"]
|
||||||
|
|
||||||
|
var hips_distance_to_ground
|
||||||
|
var stride_scale : float = 1.0
|
||||||
|
for Foot in Feet:
|
||||||
|
#Get Bones
|
||||||
|
var bone = skeleton_ref.find_bone(Foot)
|
||||||
|
var bone_transform = skeleton_ref.get_bone_global_pose_no_override(bone)
|
||||||
|
|
||||||
|
var thigh_bone = skeleton_ref.find_bone(Thighs[Feet.find(Foot)])
|
||||||
|
var thigh_transform = skeleton_ref.get_bone_global_pose_no_override(thigh_bone)
|
||||||
|
var thigh_angle = thigh_transform.basis.get_euler().x
|
||||||
|
|
||||||
|
#Calculate
|
||||||
|
var stride_direction : Vector3 = Vector3.FORWARD
|
||||||
|
var stride_warping_plane_origin = Plane(character_node.get_floor_normal(),bone_transform.origin).intersects_ray(thigh_transform.origin,Vector3.DOWN)
|
||||||
|
|
||||||
|
if stride_warping_plane_origin == null:
|
||||||
|
return #Failed to get a plane origin/ we are probably in air
|
||||||
|
var scale_origin = Plane(stride_direction,stride_warping_plane_origin).project(bone_transform.origin)
|
||||||
|
var anim_speed = pow(hips_transform.origin.distance_to(bone_transform.origin),2) - pow(hips_transform.origin.y,2)
|
||||||
|
anim_speed = sqrt(abs(anim_speed))
|
||||||
|
stride_scale = clampf(distance_in_each_frame/anim_speed,0.0,2.0)
|
||||||
|
# print(stride_scale)
|
||||||
|
var foot_warped_location : Vector3 = scale_origin + (bone_transform.origin - scale_origin) * stride_scale
|
||||||
|
|
||||||
|
|
||||||
|
# Apply
|
||||||
|
|
||||||
|
#test
|
||||||
|
# bone_transform.origin = foot_warped_location
|
||||||
|
# skeleton_ref.set_bone_local_pose_override(bone, bone_transform,1.0,true)
|
||||||
|
|
||||||
|
|
||||||
|
func calc_grounded_rotation_rate():
|
||||||
|
|
||||||
|
if input_is_moving == true:
|
||||||
|
match gait:
|
||||||
|
Global.gait.walking:
|
||||||
|
return lerp(current_movement_data.idle_rotation_rate,current_movement_data.walk_rotation_rate, Global.map_range_clamped((actual_velocity * Vector3(1.0,0.0,1.0)).length(),0.0,current_movement_data.walk_speed,0.0,1.0)) * clamp(aim_rate_h,1.0,3.0)
|
||||||
|
Global.gait.running:
|
||||||
|
return lerp(current_movement_data.walk_rotation_rate,current_movement_data.run_rotation_rate, Global.map_range_clamped((actual_velocity * Vector3(1.0,0.0,1.0)).length(),current_movement_data.walk_speed,current_movement_data.run_speed,1.0,2.0)) * clamp(aim_rate_h,1.0,3.0)
|
||||||
|
Global.gait.sprinting:
|
||||||
|
return lerp(current_movement_data.run_rotation_rate,current_movement_data.sprint_rotation_rate, Global.map_range_clamped((actual_velocity * Vector3(1.0,0.0,1.0)).length(),current_movement_data.run_speed,current_movement_data.sprint_speed,2.0,3.0)) * clamp(aim_rate_h,1.0,2.5)
|
||||||
|
else:
|
||||||
|
return current_movement_data.idle_rotation_rate * clamp(aim_rate_h,1.0,3.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func rotate_in_place_check():
|
||||||
|
is_rotating_in_place = false
|
||||||
|
if !input_is_moving:
|
||||||
|
var CameraAngle = Quaternion(Vector3(0,camera_root.HObject.rotation.y,0))
|
||||||
|
var MeshAngle = Quaternion(Vector3(0,mesh_ref.rotation.y,0))
|
||||||
|
|
||||||
|
rotation_difference_camera_mesh = rad_to_deg(MeshAngle.angle_to(CameraAngle) - PI)
|
||||||
|
if (CameraAngle.dot(MeshAngle)) > 0:
|
||||||
|
rotation_difference_camera_mesh *= -1
|
||||||
|
if floor(abs(rotation_difference_camera_mesh)) > rotation_in_place_min_angle:
|
||||||
|
is_rotating_in_place = true
|
||||||
|
smooth_character_rotation(-camera_root.HObject.transform.basis.z,calc_grounded_rotation_rate(),get_physics_process_delta_time())
|
||||||
|
|
||||||
|
|
||||||
|
func ik_look_at(position: Vector3):
|
||||||
|
var lookatobject = mesh_ref.get_node("LookAtObject")
|
||||||
|
if lookatobject:
|
||||||
|
lookatobject.position = position
|
||||||
|
|
||||||
|
|
||||||
|
var PrevVelocity :Vector3
|
||||||
|
func add_movement_input(direction: Vector3, Speed: float , Acceleration: float) -> void:
|
||||||
|
if is_flying == false:
|
||||||
|
character_node.velocity.x = lerp(character_node.velocity.x, direction.x * Speed, Acceleration * get_physics_process_delta_time())
|
||||||
|
character_node.velocity.z = lerp(character_node.velocity.z, direction.z * Speed, Acceleration * get_physics_process_delta_time())
|
||||||
|
else:
|
||||||
|
character_node.set_velocity(character_node.get_velocity().lerp(direction * Speed, Acceleration * get_physics_process_delta_time()))
|
||||||
|
character_node.move_and_slide()
|
||||||
|
input_velocity = Speed * direction
|
||||||
|
movement_direction = atan2(input_velocity.x,input_velocity.z)
|
||||||
|
input_is_moving = Speed > 0.0
|
||||||
|
input_acceleration = Acceleration * direction
|
||||||
|
#
|
||||||
|
actual_acceleration = (character_node.velocity - PrevVelocity) / (Acceleration * get_physics_process_delta_time())
|
||||||
|
PrevVelocity = character_node.velocity
|
||||||
|
#
|
||||||
|
actual_velocity = character_node.velocity
|
||||||
|
#tiltCharacterMesh
|
||||||
|
if tilt == true:
|
||||||
|
var MovementDirectionRelativeToCamera = input_velocity.normalized().rotated(Vector3.UP,-camera_root.HObject.transform.basis.get_euler().y)
|
||||||
|
var IsMovingBackwardRelativeToCamera = false if input_velocity.rotated(Vector3.UP,-camera_root.HObject.transform.basis.get_euler().y).z >= -0.1 else true
|
||||||
|
if IsMovingBackwardRelativeToCamera:
|
||||||
|
MovementDirectionRelativeToCamera.x = MovementDirectionRelativeToCamera.x * -1
|
||||||
|
|
||||||
|
tiltVector = (MovementDirectionRelativeToCamera).rotated(Vector3.UP,-PI/2) / (8.0/tilt_power)
|
||||||
|
mesh_ref.rotation.x = lerp(mesh_ref.rotation.x,tiltVector.x,Acceleration * get_physics_process_delta_time())
|
||||||
|
mesh_ref.rotation.z = lerp(mesh_ref.rotation.z,tiltVector.z,Acceleration * get_physics_process_delta_time())
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
func calc_animation_data(): # it is used to modify the animation data to get the wanted animation result
|
||||||
|
animation_is_moving_backward_relative_to_camera = false if -actual_velocity.rotated(Vector3.UP,-camera_root.HObject.transform.basis.get_euler().y).z >= -0.1 else true
|
||||||
|
animation_velocity = actual_velocity
|
||||||
|
# a method to make the character' anim walk backward when moving left
|
||||||
|
# if is_equal_approx(input_velocity.normalized().rotated(Vector3.UP,-$CameraRoot.HObject.transform.basis.get_euler().y).x,-1.0):
|
||||||
|
# animation_velocity = velocity * -1
|
||||||
|
# animation_is_moving_backward_relative_to_camera = true
|
||||||
|
|
||||||
|
|
||||||
|
func mantle_check():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func jump() -> void:
|
||||||
|
if character_node.is_on_floor() and not head_bonked:
|
||||||
|
vertical_velocity = Vector3.UP * jump_magnitude
|
||||||
|
|
||||||
|
|
||||||
|
|
36
addons/AMSG/Components/Interaction.gd
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
extends RayCast3D
|
||||||
|
|
||||||
|
var current_collider
|
||||||
|
|
||||||
|
@onready var interaction_label = get_node("../../../Status/InteractionLabel")
|
||||||
|
var collider = get_collider()
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if interaction_label:
|
||||||
|
interaction_label.set_text("")
|
||||||
|
|
||||||
|
func _process(_delta):
|
||||||
|
collider = get_collider()
|
||||||
|
if is_colliding() and collider is Interactable:
|
||||||
|
if current_collider != collider:
|
||||||
|
set_interaction_text(collider.get_interaction_text())
|
||||||
|
current_collider = collider
|
||||||
|
|
||||||
|
elif current_collider:
|
||||||
|
current_collider = null
|
||||||
|
set_interaction_text("")
|
||||||
|
|
||||||
|
func Interact():
|
||||||
|
if is_colliding() and collider is Interactable:
|
||||||
|
collider.interact()
|
||||||
|
set_interaction_text(collider.get_interaction_text())
|
||||||
|
|
||||||
|
func set_interaction_text(text):
|
||||||
|
if interaction_label:
|
||||||
|
if text == "":
|
||||||
|
interaction_label.set_text("")
|
||||||
|
interaction_label.set_visible(false)
|
||||||
|
else:
|
||||||
|
var interaction_key = OS.get_keycode_string(InputMap.action_get_events("interaction")[0].keycode)
|
||||||
|
interaction_label.set_text("Press %s to %s" % [interaction_key , text])
|
||||||
|
interaction_label.set_visible(true)
|
53
addons/AMSG/Components/Networking.tscn
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cegbfvlakd2rw"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/AMSG/Components/PlayerNetworkingComponent.gd" id="1_88p3o"]
|
||||||
|
|
||||||
|
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rxj2q"]
|
||||||
|
properties/0/path = NodePath(":sync_camera_h_transform")
|
||||||
|
properties/0/spawn = true
|
||||||
|
properties/0/sync = true
|
||||||
|
properties/1/path = NodePath(":sync_camera_v_transform")
|
||||||
|
properties/1/spawn = true
|
||||||
|
properties/1/sync = true
|
||||||
|
properties/2/path = NodePath(":sync_view_mode")
|
||||||
|
properties/2/spawn = true
|
||||||
|
properties/2/sync = true
|
||||||
|
properties/3/path = NodePath(":sync_CameraHOffset")
|
||||||
|
properties/3/spawn = true
|
||||||
|
properties/3/sync = true
|
||||||
|
properties/4/path = NodePath(":sync_position")
|
||||||
|
properties/4/spawn = true
|
||||||
|
properties/4/sync = true
|
||||||
|
properties/5/path = NodePath(":sync_mesh_rotation")
|
||||||
|
properties/5/spawn = true
|
||||||
|
properties/5/sync = true
|
||||||
|
properties/6/path = NodePath(":sync_direction")
|
||||||
|
properties/6/spawn = true
|
||||||
|
properties/6/sync = true
|
||||||
|
properties/7/path = NodePath(":sync_input_is_moving")
|
||||||
|
properties/7/spawn = true
|
||||||
|
properties/7/sync = true
|
||||||
|
properties/8/path = NodePath(":sync_gait")
|
||||||
|
properties/8/spawn = true
|
||||||
|
properties/8/sync = true
|
||||||
|
properties/9/path = NodePath(":sync_rotation_mode")
|
||||||
|
properties/9/spawn = true
|
||||||
|
properties/9/sync = true
|
||||||
|
properties/10/path = NodePath(":sync_stance")
|
||||||
|
properties/10/spawn = true
|
||||||
|
properties/10/sync = true
|
||||||
|
properties/11/path = NodePath(":sync_movement_state")
|
||||||
|
properties/11/spawn = true
|
||||||
|
properties/11/sync = true
|
||||||
|
properties/12/path = NodePath(":sync_movement_action")
|
||||||
|
properties/12/spawn = true
|
||||||
|
properties/12/sync = true
|
||||||
|
properties/13/path = NodePath(":sync_velocity")
|
||||||
|
properties/13/spawn = true
|
||||||
|
properties/13/sync = true
|
||||||
|
|
||||||
|
[node name="Networking" type="Node"]
|
||||||
|
script = ExtResource("1_88p3o")
|
||||||
|
|
||||||
|
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||||
|
replication_config = SubResource("SceneReplicationConfig_rxj2q")
|
172
addons/AMSG/Components/PlayerGameplayComponent.gd
Normal file
|
@ -0,0 +1,172 @@
|
||||||
|
extends CharacterMovementComponent
|
||||||
|
|
||||||
|
@export var networking_path : NodePath
|
||||||
|
@onready var networking = get_node(networking_path)
|
||||||
|
#####################################
|
||||||
|
#Controls Settings
|
||||||
|
@export var OnePressJump := false
|
||||||
|
@export var UsingSprintToggle := false
|
||||||
|
@export var UsingCrouchToggle := false
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
var h_rotation :float
|
||||||
|
#var v_rotation :float
|
||||||
|
|
||||||
|
var direction := Vector3.FORWARD
|
||||||
|
|
||||||
|
var previous_rotation_mode
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
super._physics_process(delta)
|
||||||
|
# Debug()
|
||||||
|
if !networking.is_local_authority():
|
||||||
|
if input_is_moving:
|
||||||
|
if gait == Global.gait.sprinting:
|
||||||
|
add_movement_input(direction, current_movement_data.sprint_speed,current_movement_data.sprint_acceleration)
|
||||||
|
elif gait == Global.gait.running:
|
||||||
|
add_movement_input(direction, current_movement_data.run_speed,current_movement_data.run_acceleration)
|
||||||
|
else:
|
||||||
|
add_movement_input(direction, current_movement_data.walk_speed,current_movement_data.walk_acceleration)
|
||||||
|
else:
|
||||||
|
add_movement_input(direction,0,deacceleration)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
#------------------ Input Movement ------------------#
|
||||||
|
h_rotation = camera_root.HObject.transform.basis.get_euler().y
|
||||||
|
# v_rotation = camera_root.VObject.transform.basis.get_euler().x
|
||||||
|
|
||||||
|
if Input.is_action_pressed("INPUT_ACTION_FORWARD") || Input.is_action_pressed("INPUT_ACTION_BACK") || Input.is_action_pressed("INPUT_ACTION_RIGHT") || Input.is_action_pressed("INPUT_ACTION_LEFT") :
|
||||||
|
direction = Vector3(Input.get_action_strength("INPUT_ACTION_RIGHT") - Input.get_action_strength("INPUT_ACTION_LEFT"),
|
||||||
|
0.0 if is_flying == true else 0.0,
|
||||||
|
Input.get_action_strength("INPUT_ACTION_BACK") - Input.get_action_strength("INPUT_ACTION_FORWARD"))
|
||||||
|
direction = direction.rotated(Vector3.UP,h_rotation).normalized()
|
||||||
|
if gait == Global.gait.sprinting :
|
||||||
|
add_movement_input(direction, current_movement_data.sprint_speed,current_movement_data.sprint_acceleration)
|
||||||
|
elif gait == Global.gait.running:
|
||||||
|
add_movement_input(direction, current_movement_data.run_speed,current_movement_data.run_acceleration)
|
||||||
|
else:
|
||||||
|
add_movement_input(direction, current_movement_data.walk_speed,current_movement_data.walk_acceleration)
|
||||||
|
else:
|
||||||
|
add_movement_input(direction,0,deacceleration)
|
||||||
|
|
||||||
|
|
||||||
|
#------------------ Input Crouch ------------------#
|
||||||
|
if UsingCrouchToggle == false:
|
||||||
|
if Input.is_action_pressed("INPUT_ACTION_CROUCH"):
|
||||||
|
if stance != Global.stance.crouching:
|
||||||
|
stance = Global.stance.crouching
|
||||||
|
else:
|
||||||
|
if stance != Global.stance.standing:
|
||||||
|
stance = Global.stance.standing
|
||||||
|
else:
|
||||||
|
if Input.is_action_just_pressed("INPUT_ACTION_CROUCH"):
|
||||||
|
stance = Global.stance.standing if stance == Global.stance.crouching else Global.stance.crouching
|
||||||
|
#------------------ Sprint ------------------#
|
||||||
|
if UsingSprintToggle:
|
||||||
|
if Input.is_action_just_pressed("INPUT_ACTION_RUN"):
|
||||||
|
if gait == Global.gait.walking:
|
||||||
|
gait = Global.gait.running
|
||||||
|
elif gait == Global.gait.running:
|
||||||
|
gait = Global.gait.sprinting
|
||||||
|
elif gait == Global.gait.sprinting:
|
||||||
|
gait = Global.gait.walking
|
||||||
|
else:
|
||||||
|
if Input.is_action_just_pressed("INPUT_ACTION_RUN"):
|
||||||
|
if gait == Global.gait.walking:
|
||||||
|
gait = Global.gait.running
|
||||||
|
elif gait == Global.gait.running:
|
||||||
|
gait = Global.gait.sprinting
|
||||||
|
if Input.is_action_just_released("INPUT_ACTION_RUN"):
|
||||||
|
if gait == Global.gait.sprinting or gait == Global.gait.walking:
|
||||||
|
gait = Global.gait.walking
|
||||||
|
elif gait == Global.gait.running:
|
||||||
|
await get_tree().create_timer(0.4).timeout
|
||||||
|
if gait == Global.gait.running:
|
||||||
|
gait = Global.gait.walking
|
||||||
|
#------------------ Input Aim ------------------#
|
||||||
|
if Input.is_action_pressed("INPUT_ACTION_AIM"):
|
||||||
|
if rotation_mode != Global.rotation_mode.aiming:
|
||||||
|
previous_rotation_mode = rotation_mode
|
||||||
|
rotation_mode = Global.rotation_mode.aiming
|
||||||
|
else:
|
||||||
|
if rotation_mode == Global.rotation_mode.aiming:
|
||||||
|
rotation_mode = previous_rotation_mode
|
||||||
|
#------------------ Jump ------------------#=
|
||||||
|
if OnePressJump == true:
|
||||||
|
if Input.is_action_just_pressed("INPUT_ACTION_JUMP"):
|
||||||
|
if stance != Global.stance.standing:
|
||||||
|
stance = Global.stance.standing
|
||||||
|
else:
|
||||||
|
jump()
|
||||||
|
else:
|
||||||
|
if Input.is_action_pressed("INPUT_ACTION_JUMP"):
|
||||||
|
if stance != Global.stance.standing:
|
||||||
|
stance = Global.stance.standing
|
||||||
|
else:
|
||||||
|
jump()
|
||||||
|
#------------------ Look At ------------------#
|
||||||
|
match rotation_mode:
|
||||||
|
Global.rotation_mode.velocity_direction:
|
||||||
|
if input_is_moving:
|
||||||
|
ik_look_at(actual_velocity + Vector3(0.0,1.0,0.0))
|
||||||
|
Global.rotation_mode.looking_direction:
|
||||||
|
ik_look_at(camera_root.SpringArm.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
|
||||||
|
Global.rotation_mode.aiming:
|
||||||
|
ik_look_at(camera_root.SpringArm.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
|
||||||
|
#------------------ Interaction ------------------#
|
||||||
|
if Input.is_action_just_pressed("INPUT_ACTION_INTERACTION"):
|
||||||
|
camera_root.Camera.get_node("InteractionRaycast").Interact()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var view_changed_recently = false
|
||||||
|
func _input(event):
|
||||||
|
#------------------ Motion Warping test------------------#
|
||||||
|
if event.is_action_pressed("INPUT_ACTION_FIRE"):
|
||||||
|
anim_ref.active = false
|
||||||
|
get_node("../MotionWarping").add_sync_position(Vector3(4.762,1.574,-1.709),Vector3(0,PI,0),"kick_target",self,mesh_ref)
|
||||||
|
get_node("../AnimationPlayer").play("Kick")
|
||||||
|
await get_tree().create_timer(2.6).timeout
|
||||||
|
anim_ref.active = true
|
||||||
|
|
||||||
|
#------------------ Change Camera View ------------------#
|
||||||
|
if Input.is_action_just_released("INPUT_VIEW_SWITCH_CAMERA"):
|
||||||
|
if view_changed_recently == false:
|
||||||
|
view_changed_recently = true
|
||||||
|
camera_root.view_angle = camera_root.view_angle + 1 if camera_root.view_angle < 2 else 0
|
||||||
|
await get_tree().create_timer(0.3).timeout
|
||||||
|
view_changed_recently = false
|
||||||
|
else:
|
||||||
|
view_changed_recently = false
|
||||||
|
if Input.is_action_just_pressed("INPUT_VIEW_SWITCH_CAMERA"):
|
||||||
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
if view_changed_recently == false:
|
||||||
|
camera_root.view_mode = camera_root.view_mode + 1 if camera_root.view_mode < 1 else 0
|
||||||
|
if camera_root.view_mode == Global.view_mode.first_person and networking.is_local_authority():
|
||||||
|
mesh_ref.visible = false
|
||||||
|
else:
|
||||||
|
mesh_ref.visible = true
|
||||||
|
view_changed_recently = true
|
||||||
|
if networking.is_local_authority():
|
||||||
|
if event.is_action_pressed("INPUT_DISPLAY_ENABLE_SDFGI"):
|
||||||
|
var postprocess = preload("res://PlayerB/Maps/default_env.tres")
|
||||||
|
postprocess.sdfgi_enabled = not postprocess.sdfgi_enabled
|
||||||
|
postprocess.ssil_enabled = not postprocess.ssil_enabled
|
||||||
|
postprocess.ssao_enabled = not postprocess.ssao_enabled
|
||||||
|
postprocess.ssr_enabled = not postprocess.ssr_enabled
|
||||||
|
postprocess.glow_enabled = not postprocess.glow_enabled
|
||||||
|
if event.is_action_pressed("INPUT_ACTION_RAGDOLL"):
|
||||||
|
ragdoll = true
|
||||||
|
|
||||||
|
|
||||||
|
if rotation_mode == Global.rotation_mode.velocity_direction:
|
||||||
|
if camera_root != null:
|
||||||
|
if camera_root.view_mode == Global.view_mode.first_person:
|
||||||
|
camera_root.view_mode = Global.view_mode.third_person
|
||||||
|
|
||||||
|
|
||||||
|
#func Debug():
|
||||||
|
# $Status/Label.text = "InputSpeed : %s" % input_velocity.length()
|
||||||
|
# $Status/Label2.text = "ActualSpeed : %s" % get_velocity().length()
|
70
addons/AMSG/Components/PlayerNetworkingComponent.gd
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
extends Node
|
||||||
|
class_name PlayerNetworkingComponent
|
||||||
|
@export var character_movement_component : NodePath
|
||||||
|
@onready var PlayerRef = get_node(character_movement_component)
|
||||||
|
|
||||||
|
|
||||||
|
var sync_camera_h_transform : Transform3D
|
||||||
|
var sync_camera_v_transform : Transform3D
|
||||||
|
var sync_view_mode : Global.view_mode
|
||||||
|
var sync_CameraHOffset : float
|
||||||
|
var sync_position : Vector3:
|
||||||
|
set(value):
|
||||||
|
sync_position = value
|
||||||
|
processed_position = false
|
||||||
|
var sync_mesh_rotation : Vector3
|
||||||
|
var sync_direction : Vector3
|
||||||
|
var sync_input_is_moving : bool
|
||||||
|
var sync_gait : Global.gait = Global.gait.walking
|
||||||
|
var sync_rotation_mode : Global.rotation_mode = Global.rotation_mode.velocity_direction
|
||||||
|
var sync_stance : Global.stance = Global.stance.standing
|
||||||
|
var sync_movement_state : Global.movement_state = Global.movement_state.grounded
|
||||||
|
var sync_movement_action : Global.movement_action = Global.movement_action.none
|
||||||
|
var sync_velocity : Vector3
|
||||||
|
var processed_position : bool
|
||||||
|
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
$MultiplayerSynchronizer.set_multiplayer_authority(str(get_parent().name).to_int())
|
||||||
|
|
||||||
|
|
||||||
|
func is_local_authority() -> bool:
|
||||||
|
if !multiplayer.has_multiplayer_peer():
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return str(get_parent().name).to_int() == multiplayer.get_unique_id()
|
||||||
|
|
||||||
|
#sync player on clients
|
||||||
|
func _physics_process(_delta):
|
||||||
|
if !is_local_authority():
|
||||||
|
if not processed_position:
|
||||||
|
PlayerRef.character_node.position = sync_position
|
||||||
|
processed_position = true
|
||||||
|
PlayerRef.mesh_ref.rotation = sync_mesh_rotation
|
||||||
|
PlayerRef.direction = sync_direction
|
||||||
|
PlayerRef.gait = sync_gait
|
||||||
|
PlayerRef.stance = sync_stance
|
||||||
|
PlayerRef.rotation_mode = sync_rotation_mode
|
||||||
|
PlayerRef.camera_root.VObject.transform = sync_camera_v_transform
|
||||||
|
PlayerRef.camera_root.HObject.transform = sync_camera_h_transform
|
||||||
|
PlayerRef.camera_root.view_mode = sync_CameraHOffset
|
||||||
|
PlayerRef.camera_root.CameraHOffset = sync_CameraHOffset
|
||||||
|
PlayerRef.movement_state = sync_movement_state
|
||||||
|
PlayerRef.movement_action = sync_movement_action
|
||||||
|
# PlayerRef.velocity = sync_velocity
|
||||||
|
PlayerRef.input_is_moving = sync_input_is_moving
|
||||||
|
return
|
||||||
|
|
||||||
|
sync_position = PlayerRef.character_node.position
|
||||||
|
sync_mesh_rotation = PlayerRef.mesh_ref.rotation
|
||||||
|
sync_direction = PlayerRef.direction
|
||||||
|
sync_gait = PlayerRef.gait
|
||||||
|
sync_stance = PlayerRef.stance
|
||||||
|
sync_rotation_mode = PlayerRef.rotation_mode
|
||||||
|
sync_camera_h_transform = PlayerRef.camera_root.HObject.transform
|
||||||
|
sync_camera_v_transform = PlayerRef.camera_root.VObject.transform
|
||||||
|
sync_movement_state = PlayerRef.movement_state
|
||||||
|
sync_movement_action = PlayerRef.movement_action
|
||||||
|
sync_input_is_moving = PlayerRef.input_is_moving
|
||||||
|
sync_view_mode = PlayerRef.camera_root.view_mode
|
||||||
|
sync_CameraHOffset = PlayerRef.camera_root.CameraHOffset
|
20
addons/AMSG/Global.gd
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
#------------------ Player Enums ------------------#
|
||||||
|
enum gait {walking , running , sprinting}
|
||||||
|
enum movement_state {none , grounded , in_air , mantling, ragdoll}
|
||||||
|
enum movement_action {none ,low_mantle , high_mantle , rolling , getting_up}
|
||||||
|
enum overlay_state {default , rifle , pistol}
|
||||||
|
enum rotation_mode {velocity_direction , looking_direction , aiming}
|
||||||
|
enum stance {standing , crouching}
|
||||||
|
enum view_mode {third_person , first_person}
|
||||||
|
enum view_angle {right_shoulder , left_shoulder , head}
|
||||||
|
enum mantle_type {high_mantle , low_mantle, falling_catch}
|
||||||
|
enum movement_direction {forward , right, left, backward}
|
||||||
|
|
||||||
|
|
||||||
|
func map_range_clamped(value,InputMin,InputMax,OutputMin,OutputMax):
|
||||||
|
value = clamp(value,InputMin,InputMax)
|
||||||
|
return ((value - InputMin) / (InputMax - InputMin) * (OutputMax - OutputMin) + OutputMin)
|
||||||
|
|
||||||
|
|
10
addons/AMSG/Interactable/Interactable.gd
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
extends Node
|
||||||
|
class_name Interactable
|
||||||
|
|
||||||
|
func get_interaction_text():
|
||||||
|
return "Interact"
|
||||||
|
|
||||||
|
|
||||||
|
func interact():
|
||||||
|
print("Interacted with %s" % name)
|
||||||
|
|
24
addons/AMSG/Interactable/Light/InteractableLight.gd
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
extends Interactable
|
||||||
|
|
||||||
|
@export var light : NodePath
|
||||||
|
@onready var light_node = get_node(light)
|
||||||
|
@export var on : bool :
|
||||||
|
get: return on
|
||||||
|
set(state):
|
||||||
|
on = state
|
||||||
|
if light_node != null:
|
||||||
|
set_light_energy()
|
||||||
|
@export var energy_when_on = 1
|
||||||
|
@export var energy_when_off = 0
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
on = on #just initialize
|
||||||
|
|
||||||
|
func interact():
|
||||||
|
on = !on
|
||||||
|
|
||||||
|
func get_interaction_text():
|
||||||
|
return "Switch Light Off" if on else "Switch Light On"
|
||||||
|
|
||||||
|
func set_light_energy():
|
||||||
|
light_node.set_param(Light3D.PARAM_ENERGY,energy_when_on if on else energy_when_off)
|
7
addons/AMSG/plugin.cfg
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[plugin]
|
||||||
|
|
||||||
|
name="AMSG"
|
||||||
|
description=""
|
||||||
|
author="ywmaa"
|
||||||
|
version="0.9"
|
||||||
|
script="AMSG.gd"
|
44
addons/PoseWarping/MotionWarping.gd
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
extends Node
|
||||||
|
class_name MotionWarping
|
||||||
|
|
||||||
|
var position_objects_array : Array = []
|
||||||
|
var rotation_objects_array : Array = []
|
||||||
|
var positions_array : Array = []
|
||||||
|
var rotations_array : Array = []
|
||||||
|
var names_array : Array = []
|
||||||
|
|
||||||
|
#We should add the position before starting the animation,
|
||||||
|
#for example the position of the door that we are interacting with.
|
||||||
|
#we give it a name to use the same name in the AnimationPlayer
|
||||||
|
func add_sync_position(position:Vector3, rotation:Vector3, sync_name:String, position_object,rotation_object):
|
||||||
|
positions_array.append(position)
|
||||||
|
rotations_array.append(rotation)
|
||||||
|
position_objects_array.append(position_object)
|
||||||
|
rotation_objects_array.append(rotation_object)
|
||||||
|
names_array.append(sync_name)
|
||||||
|
|
||||||
|
|
||||||
|
#remove the position after it is done
|
||||||
|
func remove_sync_position(sync_name:String):
|
||||||
|
var sync_index = names_array.find(sync_name)
|
||||||
|
positions_array.remove_at(sync_index)
|
||||||
|
rotations_array.remove_at(sync_index)
|
||||||
|
position_objects_array.remove_at(sync_index)
|
||||||
|
rotation_objects_array.remove_at(sync_index)
|
||||||
|
names_array.remove_at(sync_index)
|
||||||
|
|
||||||
|
#this should be called as a method in the animation player, and set the name
|
||||||
|
#using the name we assigned to the sync position we will tween it,
|
||||||
|
#also in the animation player we should specify the time to tween to this required position
|
||||||
|
func motion_warping(sync_name:String, sync_time:float):
|
||||||
|
|
||||||
|
var sync_index = names_array.find(sync_name)
|
||||||
|
var position = positions_array[sync_index]
|
||||||
|
var rotation = rotations_array[sync_index]
|
||||||
|
var position_object = position_objects_array[sync_index]
|
||||||
|
var rotation_object = rotation_objects_array[sync_index]
|
||||||
|
var tween := create_tween()
|
||||||
|
var rotation_tween := create_tween()
|
||||||
|
tween.tween_property(position_object, "transform:origin", position, sync_time)
|
||||||
|
rotation_tween.tween_property(rotation_object, "rotation", rotation, sync_time)
|
||||||
|
tween.tween_callback(remove_sync_position.bind(sync_name))
|
6
addons/PoseWarping/MotionWarping.tscn
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://bfkejs88xm680"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/PoseWarping/MotionWarping.gd" id="1_if8ak"]
|
||||||
|
|
||||||
|
[node name="MotionWarping" type="Node"]
|
||||||
|
script = ExtResource("1_if8ak")
|
13
addons/PoseWarping/PoseWarping.gd
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
@tool
|
||||||
|
extends EditorPlugin
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
# Initialization of the plugin goes here.
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _exit_tree():
|
||||||
|
# Clean-up of the plugin goes here.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
55
addons/PoseWarping/PoseWarpingFunctions.gd
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
extends Node
|
||||||
|
class_name pose_warping
|
||||||
|
#For Predicting Stop Location
|
||||||
|
func CalculateStopLocation(CurrentCharacterLocation:Vector3,Velocity:Vector3,deacceleration:Vector3,delta):
|
||||||
|
return CurrentCharacterLocation + (Velocity * CalculateStopTime(Velocity,deacceleration) * delta * 8)
|
||||||
|
|
||||||
|
func CalculateStopTime(Velocity:Vector3,deacceleration:Vector3):
|
||||||
|
var time = Velocity.length() / deacceleration.length()
|
||||||
|
return time
|
||||||
|
|
||||||
|
|
||||||
|
var previous_direction : float
|
||||||
|
var orientation_direction : float
|
||||||
|
func orientation_warping(enabled:bool,CameraObject, Velocity:Vector3, skeleton_ref, Hip = "Hips", Spines := ["Spine","Spine1","Spine2"], Offset := 0.0, delta = 1.0, turn_rate = 10.0):
|
||||||
|
|
||||||
|
skeleton_ref.clear_bones_global_pose_override()
|
||||||
|
if is_equal_approx(Velocity.length(),0.0) or !enabled:
|
||||||
|
return
|
||||||
|
var CameraAngle = Quaternion(Vector3(0,atan2(-CameraObject.transform.basis.z.z, -CameraObject.transform.basis.z.x),0))
|
||||||
|
var VelocityAngle = Quaternion(Vector3(0,atan2(Velocity.z, Velocity.x),0))
|
||||||
|
var IsMovingBackwardRelativeToCamera = false if -Velocity.rotated(Vector3.UP,-CameraObject.transform.basis.get_euler().y).z >= -0.1 else true
|
||||||
|
var IsMovingLeftRelativeToCamera = false if -Velocity.rotated(Vector3.UP,-CameraObject.transform.basis.get_euler().y).x >= -0.1 else true
|
||||||
|
var rotation_difference_camera_velocity = CameraAngle.angle_to(VelocityAngle)
|
||||||
|
previous_direction = orientation_direction
|
||||||
|
orientation_direction = rotation_difference_camera_velocity
|
||||||
|
if IsMovingBackwardRelativeToCamera:
|
||||||
|
# Make the legs face forward just like the forward walking
|
||||||
|
orientation_direction *= -1
|
||||||
|
orientation_direction = orientation_direction + PI
|
||||||
|
|
||||||
|
|
||||||
|
# Set Left or Right
|
||||||
|
if IsMovingLeftRelativeToCamera:
|
||||||
|
orientation_direction *= -1
|
||||||
|
|
||||||
|
if IsMovingBackwardRelativeToCamera:
|
||||||
|
# since we rotated the legs to face forward, then the right and left will be reversed
|
||||||
|
# so we need to reverse it back again after getting the right and left values
|
||||||
|
orientation_direction *= -1
|
||||||
|
|
||||||
|
orientation_direction = clampf(lerp_angle(previous_direction,orientation_direction,delta*turn_rate),-PI/2, PI/2)
|
||||||
|
#Orient bones to face the forward direction
|
||||||
|
set_bone_y_rotation(skeleton_ref,Hip,orientation_direction)
|
||||||
|
for bone in Spines:
|
||||||
|
set_bone_y_rotation(skeleton_ref,bone,-orientation_direction/(Spines.size()+Offset))
|
||||||
|
|
||||||
|
func set_bone_y_rotation(skeleton,bone_name, y_rot):
|
||||||
|
var bone = skeleton.find_bone(bone_name)
|
||||||
|
var bone_transform : Transform3D = skeleton.get_bone_global_pose_no_override(bone)
|
||||||
|
var rotate_amount = y_rot
|
||||||
|
bone_transform = bone_transform.rotated(Vector3(0,1,0), rotate_amount)
|
||||||
|
skeleton.set_bone_global_pose_override(bone, bone_transform,1.0,true)
|
||||||
|
|
||||||
|
|
||||||
|
|
7
addons/PoseWarping/plugin.cfg
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[plugin]
|
||||||
|
|
||||||
|
name="Pose Warping"
|
||||||
|
description="An addon that has most of distance matching functions to be used in creating advanced 3D movement for games."
|
||||||
|
author="ywmaa"
|
||||||
|
version="0.8"
|
||||||
|
script="PoseWarping.gd"
|
|
@ -116,11 +116,11 @@ msgstr "Please select your button mouse"
|
||||||
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
|
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
|
||||||
msgstr "Please select your button joypad"
|
msgstr "Please select your button joypad"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_UP"
|
msgid "INPUT_ACTION_FORWARD"
|
||||||
msgstr "Up"
|
msgstr "Forward"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_DOWN"
|
msgid "INPUT_ACTION_BACK"
|
||||||
msgstr "Down"
|
msgstr "Back"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_LEFT"
|
msgid "INPUT_ACTION_LEFT"
|
||||||
msgstr "Left"
|
msgstr "Left"
|
||||||
|
@ -146,6 +146,9 @@ msgstr "Sit down"
|
||||||
msgid "INPUT_ACTION_FLY"
|
msgid "INPUT_ACTION_FLY"
|
||||||
msgstr "Fly"
|
msgstr "Fly"
|
||||||
|
|
||||||
|
msgid "INPUT_ACTION_AIM"
|
||||||
|
msgstr "Back"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_ENTER_VEHICLE"
|
msgid "INPUT_ACTION_ENTER_VEHICLE"
|
||||||
msgstr "Enter in vehicle"
|
msgstr "Enter in vehicle"
|
||||||
|
|
||||||
|
@ -321,7 +324,28 @@ msgid "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
|
||||||
msgstr "Move Right (Joypad)"
|
msgstr "Move Right (Joypad)"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
|
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
|
||||||
msgstr "Move Up (Joypad)"
|
msgstr "Move forward (Joypad)"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
|
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
|
||||||
msgstr "Move Down (Joypad)"
|
msgstr "Move back (Joypad)"
|
||||||
|
|
||||||
|
msgid "FACTOR_CAMERA_HORIZONTALE_JOYPAD"
|
||||||
|
msgstr "Factor horizontal camera (Joypad)"
|
||||||
|
|
||||||
|
msgid "FACTOR_CAMERA_VERTICALE_JOYPAD"
|
||||||
|
msgstr "Factor veritcal camera (Joypad)"
|
||||||
|
|
||||||
|
msgid "FACTOR_PLAYER_HORIZONTALE_JOYPAD"
|
||||||
|
msgstr "FActor horizontal mouvement (Joypad)"
|
||||||
|
|
||||||
|
msgid "FACTOR_PLAYER_VERTICALE_JOYPAD"
|
||||||
|
msgstr "Factor vertical mouvement (Joypad)"
|
||||||
|
|
||||||
|
msgid "INPUT_ACTION_INTERACTION"
|
||||||
|
msgstr "Interaction"
|
||||||
|
|
||||||
|
msgid "INPUT_ACTION_FIRE"
|
||||||
|
msgstr "Fire"
|
||||||
|
|
||||||
|
msgid "INPUT_VIEW_SWITCH_CAMERA"
|
||||||
|
msgstr "Switch Camera"
|
||||||
|
|
|
@ -116,10 +116,10 @@ msgstr "Merci d'appuyer sur un bouton de la souris"
|
||||||
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
|
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
|
||||||
msgstr "Merci d'appuyer sur un bouton de votre manette de jeux"
|
msgstr "Merci d'appuyer sur un bouton de votre manette de jeux"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_UP"
|
msgid "INPUT_ACTION_FORWARD"
|
||||||
msgstr "En avant"
|
msgstr "En avant"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_DOWN"
|
msgid "INPUT_ACTION_BACK"
|
||||||
msgstr "En arrière"
|
msgstr "En arrière"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_LEFT"
|
msgid "INPUT_ACTION_LEFT"
|
||||||
|
@ -146,6 +146,10 @@ msgstr "S'asseoir/se lever"
|
||||||
msgid "INPUT_ACTION_FLY"
|
msgid "INPUT_ACTION_FLY"
|
||||||
msgstr "Voler"
|
msgstr "Voler"
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
msgid "INPUT_ACTION_AIM"
|
||||||
|
msgstr "En arrière"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_ENTER_VEHICLE"
|
msgid "INPUT_ACTION_ENTER_VEHICLE"
|
||||||
msgstr "Monter/Descendre d'un véhicule"
|
msgstr "Monter/Descendre d'un véhicule"
|
||||||
|
|
||||||
|
@ -309,10 +313,10 @@ msgid "INPUT_VIEW_CAMERA_RIGHT_JOYPAD"
|
||||||
msgstr "Caméra à droite (Manette)"
|
msgstr "Caméra à droite (Manette)"
|
||||||
|
|
||||||
msgid "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
|
msgid "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
|
||||||
msgstr "Caméra en haut (Manette)"
|
msgstr "Caméra en devant (Manette)"
|
||||||
|
|
||||||
msgid "INPUT_VIEW_CAMERA_BACK_JOYPAD"
|
msgid "INPUT_VIEW_CAMERA_BACK_JOYPAD"
|
||||||
msgstr "Caméra en bas (Manette)"
|
msgstr "Caméra en arrière (Manette)"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
|
msgid "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
|
||||||
msgstr "Déplacer à gauche (Manette)"
|
msgstr "Déplacer à gauche (Manette)"
|
||||||
|
@ -321,7 +325,29 @@ msgid "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
|
||||||
msgstr "Déplacer à droite (Manette)"
|
msgstr "Déplacer à droite (Manette)"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
|
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
|
||||||
msgstr "Déplacer en haut (Manette)"
|
msgstr "Déplacer en devant (Manette)"
|
||||||
|
|
||||||
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
|
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
|
||||||
msgstr "Déplacer en bas (Manette)"
|
msgstr "Déplacer en arrière (Manette)"
|
||||||
|
|
||||||
|
msgid "FACTOR_CAMERA_HORIZONTALE_JOYPAD"
|
||||||
|
msgstr "Facteur caméra horizontale (Manette)"
|
||||||
|
|
||||||
|
msgid "FACTOR_CAMERA_VERTICALE_JOYPAD"
|
||||||
|
msgstr "Facteur caméra verticale (Manette)"
|
||||||
|
|
||||||
|
msgid "FACTOR_PLAYER_HORIZONTALE_JOYPAD"
|
||||||
|
msgstr "Facteur déplacement horizontal (Manette)"
|
||||||
|
|
||||||
|
msgid "FACTOR_PLAYER_VERTICALE_JOYPAD"
|
||||||
|
msgstr "Facteur déplacement verticale (Manette)"
|
||||||
|
|
||||||
|
msgid "INPUT_ACTION_INTERACTION"
|
||||||
|
msgstr "Interaction"
|
||||||
|
|
||||||
|
msgid "INPUT_ACTION_FIRE"
|
||||||
|
msgstr "Feu"
|
||||||
|
|
||||||
|
msgid "INPUT_VIEW_SWITCH_CAMERA"
|
||||||
|
msgstr "Changer de caméra"
|
||||||
|
|
||||||
|
|