From: Clifton Palmer Date: Tue, 19 Nov 2024 17:17:50 +0000 (+0200) Subject: Initial skin, player, test X-Git-Url: http://git.purplebirdman.com/knight.git/commitdiff_plain/14955fc67047f5f1fde5c1cb2570ca5e6de5c439?hp=d60608f831a462b2f5f96cc4da9723d040dd695a Initial skin, player, test --- diff --git a/player/player.gd b/player/player.gd new file mode 100644 index 0000000..54b838e --- /dev/null +++ b/player/player.gd @@ -0,0 +1,37 @@ +extends CharacterBody3D + + +@onready var _skin: Node3D = $skin + + +const SPEED = 5.0 +const JUMP_VELOCITY = 4.5 + + +func _physics_process(delta: float) -> void: + # Add the gravity. + if not is_on_floor(): + velocity += get_gravity() * delta + + # Handle jump. + if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + velocity.y = JUMP_VELOCITY + + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var input_dir := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") + var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() + if direction: + velocity.x = direction.x * SPEED + velocity.z = -direction.z * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + velocity.z = move_toward(velocity.z, 0, SPEED) + + move_and_slide() + + if is_on_floor(): + _skin.forward(velocity.length()) + _skin.global_rotation.y = Vector3.FORWARD.signed_angle_to(direction, Vector3.UP) + else: + _skin.fall() diff --git a/player/player.tscn b/player/player.tscn new file mode 100644 index 0000000..ac16d4b --- /dev/null +++ b/player/player.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=4 format=3 uid="uid://chtr62feiltax"] + +[ext_resource type="PackedScene" uid="uid://bgmpst4q8lyw2" path="res://skin/the-knight.tscn" id="1_3dem8"] +[ext_resource type="Script" path="res://player/player.gd" id="1_lnm7a"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ew3kx"] +radius = 0.279573 +height = 0.942401 + +[node name="Player" type="CharacterBody3D"] +script = ExtResource("1_lnm7a") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.459262, 0) +shape = SubResource("CapsuleShape3D_ew3kx") + +[node name="skin" parent="." instance=ExtResource("1_3dem8")] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) + +[node name="camera-pivot" type="Node3D" parent="."] + +[node name="SpringArm3D" type="SpringArm3D" parent="camera-pivot"] +transform = Transform3D(-1, 0, -8.74228e-08, -2.26267e-08, 0.965926, 0.258819, 8.44439e-08, 0.258819, -0.965926, 0, 0.443057, 0) +spring_length = 3.0 + +[node name="Camera3D" type="Camera3D" parent="camera-pivot/SpringArm3D"] diff --git a/project.godot b/project.godot index e266997..631f3c7 100644 --- a/project.godot +++ b/project.godot @@ -11,5 +11,11 @@ config_version=5 [application] config/name="hollow-knight" +run/main_scene="res://test/test.tscn" config/features=PackedStringArray("4.3", "Forward Plus") config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=2304 +window/size/viewport_height=1296 diff --git a/skin/the-knight.glb b/skin/the-knight.glb new file mode 100644 index 0000000..266a850 Binary files /dev/null and b/skin/the-knight.glb differ diff --git a/skin/the-knight.glb.import b/skin/the-knight.glb.import new file mode 100644 index 0000000..253eb74 --- /dev/null +++ b/skin/the-knight.glb.import @@ -0,0 +1,36 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dd5nled5di42i" +path="res://.godot/imported/the-knight.glb-a3b5769fa1cd8b0d08fe48e55b804710.scn" + +[deps] + +source_file="res://skin/the-knight.glb" +dest_files=["res://.godot/imported/the-knight.glb-a3b5769fa1cd8b0d08fe48e55b804710.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/skin/the-knight.tscn b/skin/the-knight.tscn new file mode 100644 index 0000000..7d09542 --- /dev/null +++ b/skin/the-knight.tscn @@ -0,0 +1,325 @@ +[gd_scene load_steps=12 format=3 uid="uid://bgmpst4q8lyw2"] + +[ext_resource type="PackedScene" uid="uid://dd5nled5di42i" path="res://skin/the-knight.glb" id="1_mro73"] +[ext_resource type="Script" path="res://skin/the_knight.gd" id="2_ofwyo"] + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gbkev"] +animation = &"attack-default" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lvwr6"] +animation = &"move-jump" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_usd73"] +animation = &"idle-default" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2l48s"] +animation = &"move-walk" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fbyfq"] +animation = &"move-run" + +[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_73suy"] +blend_point_0/node = SubResource("AnimationNodeAnimation_usd73") +blend_point_0/pos = 0.0 +blend_point_1/node = SubResource("AnimationNodeAnimation_2l48s") +blend_point_1/pos = 0.5 +blend_point_2/node = SubResource("AnimationNodeAnimation_fbyfq") +blend_point_2/pos = 1.0 +min_space = 0.0 +sync = true + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_klojh"] +animation = &"idle-default" + +[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_87yve"] +sync = true +xfade_time = 0.1 +input_0/name = "forward" +input_0/auto_advance = false +input_0/break_loop_at_end = false +input_0/reset = true +input_1/name = "idle" +input_1/auto_advance = false +input_1/break_loop_at_end = false +input_1/reset = true +input_2/name = "fall" +input_2/auto_advance = false +input_2/break_loop_at_end = false +input_2/reset = true +input_3/name = "attack" +input_3/auto_advance = true +input_3/break_loop_at_end = false +input_3/reset = true + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_xdiqd"] +graph_offset = Vector2(-978.475, -4.15498) +nodes/Animation/node = SubResource("AnimationNodeAnimation_gbkev") +nodes/Animation/position = Vector2(-560, 520) +nodes/fall/node = SubResource("AnimationNodeAnimation_lvwr6") +nodes/fall/position = Vector2(-570, 370) +nodes/forward/node = SubResource("AnimationNodeBlendSpace1D_73suy") +nodes/forward/position = Vector2(-580, 50) +nodes/idle/node = SubResource("AnimationNodeAnimation_klojh") +nodes/idle/position = Vector2(-570, 220) +nodes/movement/node = SubResource("AnimationNodeTransition_87yve") +nodes/movement/position = Vector2(-260, 140) +node_connections = [&"movement", 0, &"forward", &"movement", 1, &"idle", &"movement", 2, &"fall", &"movement", 3, &"Animation", &"output", 0, &"movement"] + +[node name="the-knight" instance=ExtResource("1_mro73")] +script = ExtResource("2_ofwyo") + +[node name="Skeleton3D" parent="base/rig" index="0"] +bones/1/position = Vector3(-1.77636e-15, 0.03312, 0.292604) +bones/1/rotation = Quaternion(0.804573, 7.0793e-08, 9.59125e-08, 0.593854) +bones/3/rotation = Quaternion(-0.0924557, 1.18699e-07, -1.10216e-08, 0.995717) +bones/4/rotation = Quaternion(0.00901271, -1.19204e-07, 1.07438e-09, 0.999959) +bones/4/scale = Vector3(1, 1, 1) +bones/5/rotation = Quaternion(0.229497, 1.16028e-07, 2.73582e-08, 0.973309) +bones/5/scale = Vector3(1, 1, 1) +bones/6/rotation = Quaternion(-0.109628, -1.18491e-07, -1.30686e-08, 0.993973) +bones/7/rotation = Quaternion(-0.111466, 1.18466e-07, -1.32878e-08, 0.993768) +bones/8/position = Vector3(0.13946, 0.112574, 0.446366) +bones/8/rotation = Quaternion(0.304076, 0.928459, 0.110328, 0.182566) +bones/8/scale = Vector3(1, 17.7865, 1) +bones/9/position = Vector3(-0.13946, 0.112574, 0.446366) +bones/9/rotation = Quaternion(-0.304076, 0.928459, 0.110328, -0.182566) +bones/9/scale = Vector3(1, 17.7865, 1) +bones/10/position = Vector3(0.0733334, -0.00369957, 0.142112) +bones/10/rotation = Quaternion(0.999985, 3.48704e-08, 8.36928e-08, -0.00540465) +bones/10/scale = Vector3(1, 22.9334, 1) +bones/11/position = Vector3(-0.0733334, -0.00369957, 0.142112) +bones/11/rotation = Quaternion(0.999985, -3.48704e-08, -8.36928e-08, -0.00540465) +bones/11/scale = Vector3(1, 22.9334, 1) +bones/16/rotation = Quaternion(0.913341, -7.07102e-08, 0.407195, 3.58881e-08) +bones/25/rotation = Quaternion(-0.171685, -0.790881, -0.308025, 0.500152) +bones/25/scale = Vector3(1, 1, 1) +bones/27/rotation = Quaternion(-0.171685, 0.790881, 0.308025, 0.500152) +bones/27/scale = Vector3(1, 1, 1) +bones/29/rotation = Quaternion(0.980879, -1.75858e-08, 2.3549e-07, 0.194617) +bones/29/scale = Vector3(1, 1, 1) +bones/30/rotation = Quaternion(0.119238, 2.26485e-14, 2.84283e-08, 0.992866) +bones/30/scale = Vector3(1, 1, 1) +bones/31/rotation = Quaternion(-0.547448, 7.58144e-09, -1.46473e-07, 0.83684) +bones/31/scale = Vector3(1, 1, 0.999999) +bones/32/position = Vector3(1.74337e-08, 0.0775473, -2.3555e-08) +bones/32/rotation = Quaternion(3.28639e-08, 0.961249, -0.275683, 1.1459e-07) +bones/32/scale = Vector3(1, 1, 1) +bones/33/rotation = Quaternion(0.342783, 0.342783, -0.618466, 0.618466) +bones/36/scale = Vector3(1, 1, 1) +bones/38/rotation = Quaternion(1.86265e-08, -5.5398e-08, -1.74988e-08, 1) +bones/38/scale = Vector3(1, 1, 0.999999) +bones/40/scale = Vector3(1, 1, 1) +bones/41/rotation = Quaternion(-3.55765e-07, 1.96604e-09, -1.75672e-08, 1) +bones/43/rotation = Quaternion(0.980879, -2.88144e-08, -1.6302e-09, 0.194617) +bones/43/scale = Vector3(1, 1, 1) +bones/44/rotation = Quaternion(0.119238, -3.44169e-14, -2.84284e-08, 0.992866) +bones/45/rotation = Quaternion(-0.547448, -7.58145e-09, 1.46473e-07, 0.83684) +bones/45/scale = Vector3(1, 1, 0.999999) +bones/46/position = Vector3(-1.74337e-08, 0.0775473, -2.59373e-08) +bones/46/rotation = Quaternion(-3.28639e-08, 0.961249, -0.275683, -1.1459e-07) +bones/46/scale = Vector3(1, 1, 1) +bones/47/rotation = Quaternion(-0.618466, 0.618466, 0.342783, 0.342783) +bones/47/scale = Vector3(1, 1, 1) +bones/50/scale = Vector3(1, 1, 1) +bones/52/rotation = Quaternion(3.72529e-09, 5.5398e-08, 1.74988e-08, 1) +bones/52/scale = Vector3(1, 1, 0.999999) +bones/54/scale = Vector3(1, 1, 1) +bones/55/rotation = Quaternion(3.89293e-07, -2.18893e-09, 1.75668e-08, 1) +bones/55/scale = Vector3(1, 1, 1) +bones/57/rotation = Quaternion(0.980879, 2.14427e-08, 1.08072e-07, 0.194617) +bones/57/scale = Vector3(1, 1, 0.999999) +bones/58/rotation = Quaternion(-0.804572, -7.86797e-08, -1.01734e-07, 0.593854) +bones/58/scale = Vector3(1, 1, 1) +bones/59/rotation = Quaternion(-0.739083, 7.30564e-08, -8.15026e-08, 0.673615) +bones/59/scale = Vector3(1, 1, 1) +bones/60/rotation = Quaternion(0.119237, -2.16681e-14, 2.84284e-08, 0.992866) +bones/61/rotation = Quaternion(-0.547447, -2.54723e-14, -1.30522e-07, 0.83684) +bones/61/scale = Vector3(1, 1, 1) +bones/62/rotation = Quaternion(-4.47035e-08, 1.24345e-14, -1.72343e-15, 1) +bones/63/rotation = Quaternion(4.49144e-08, 0.961249, -0.275683, 7.25723e-08) +bones/63/scale = Vector3(1, 1, 1) +bones/64/rotation = Quaternion(-1.49012e-08, -4.37114e-08, -6.51351e-16, 1) +bones/65/rotation = Quaternion(-0.703275, 7.78544e-08, -7.68683e-08, 0.710918) +bones/66/rotation = Quaternion(-0.0516915, -9.12947e-10, 5.3134e-09, 0.998663) +bones/66/scale = Vector3(1, 1, 1) +bones/67/rotation = Quaternion(0.119238, 1.92069e-14, 2.84284e-08, 0.992866) +bones/68/rotation = Quaternion(0.980879, -3.03382e-08, 2.39879e-07, 0.194617) +bones/69/rotation = Quaternion(-7.45059e-09, 2.22045e-16, 4.5513e-08, 1) +bones/70/rotation = Quaternion(0.980879, -7.4981e-08, 2.48737e-07, 0.194617) +bones/70/scale = Vector3(1, 1, 1) +bones/71/rotation = Quaternion(-1.49011e-08, 1.19352e-07, -7.64426e-08, 1) +bones/72/rotation = Quaternion(0.119238, -1.18216e-07, 6.03186e-08, 0.992866) +bones/72/scale = Vector3(1, 1, 1) +bones/73/rotation = Quaternion(1.11759e-08, 6.38114e-08, -1.74988e-08, 1) +bones/74/rotation = Quaternion(-0.547448, -1.07996e-07, -2.47164e-07, 0.83684) +bones/74/scale = Vector3(1, 1, 1) +bones/75/rotation = Quaternion(-5.94909e-08, 0.961249, -0.275682, 1.41077e-07) +bones/75/scale = Vector3(1, 1, 1) +bones/76/rotation = Quaternion(0.980879, 2.14427e-08, 1.08072e-07, 0.194617) +bones/76/scale = Vector3(1, 1, 0.999999) +bones/77/rotation = Quaternion(-0.804572, -7.86797e-08, -1.01734e-07, 0.593854) +bones/77/scale = Vector3(1, 1, 1) +bones/78/rotation = Quaternion(-0.739083, -8.75458e-08, 9.47085e-08, 0.673615) +bones/78/scale = Vector3(1, 1, 1) +bones/79/rotation = Quaternion(0.119237, 2.81361e-14, -2.84283e-08, 0.992866) +bones/80/rotation = Quaternion(-0.547447, 2.54723e-14, 1.30522e-07, 0.83684) +bones/80/scale = Vector3(1, 1, 1) +bones/81/rotation = Quaternion(-4.47035e-08, -7.10543e-15, -5.29289e-17, 1) +bones/82/rotation = Quaternion(-4.49144e-08, 0.961249, -0.275683, -7.25723e-08) +bones/82/scale = Vector3(1, 1, 1) +bones/83/rotation = Quaternion(-1.49012e-08, 4.37114e-08, 6.5135e-16, 1) +bones/84/rotation = Quaternion(-0.703275, -9.16418e-08, 9.08055e-08, 0.710918) +bones/85/rotation = Quaternion(-0.0516915, 9.12979e-10, -5.31341e-09, 0.998663) +bones/85/scale = Vector3(1, 1, 1) +bones/86/rotation = Quaternion(0.119238, -3.27442e-14, -2.84284e-08, 0.992866) +bones/87/rotation = Quaternion(0.980879, -1.60621e-08, -6.01935e-09, 0.194617) +bones/89/rotation = Quaternion(0.980879, 1.42762e-08, -1.20388e-08, 0.194617) +bones/89/scale = Vector3(1, 1, 1) +bones/90/rotation = Quaternion(-1.11759e-08, -1.19575e-07, 6.18592e-08, 1) +bones/91/rotation = Quaternion(0.119238, 1.18438e-07, -6.03452e-08, 0.992866) +bones/91/scale = Vector3(1, 1, 1) +bones/92/rotation = Quaternion(1.86264e-08, -6.38114e-08, 1.74988e-08, 1) +bones/93/rotation = Quaternion(-0.547448, 1.07996e-07, 2.47164e-07, 0.83684) +bones/93/scale = Vector3(1, 1, 1) +bones/94/rotation = Quaternion(5.94909e-08, 0.961249, -0.275682, -1.41077e-07) +bones/94/scale = Vector3(1, 1, 1) +bones/95/rotation = Quaternion(-0.0759225, -1.18865e-07, -9.05066e-09, 0.997114) +bones/99/rotation = Quaternion(0.693526, 8.58822e-08, 8.26747e-08, 0.720432) +bones/100/rotation = Quaternion(0.0924558, -1.18699e-07, 1.10216e-08, 0.995717) +bones/101/rotation = Quaternion(-0.0924558, 1.18699e-07, -1.10216e-08, 0.995717) +bones/103/rotation = Quaternion(-0.693526, -8.58822e-08, -8.26747e-08, 0.720432) +bones/104/rotation = Quaternion(0.699991, 1.60739e-14, -5.80569e-15, 0.714152) +bones/105/rotation = Quaternion(0.229497, 1.16028e-07, 2.73582e-08, 0.973309) +bones/106/rotation = Quaternion(-0.109628, -1.18491e-07, -1.30686e-08, 0.993973) +bones/106/scale = Vector3(1, 1, 1) +bones/107/rotation = Quaternion(-0.111466, 1.18466e-07, -1.32878e-08, 0.993768) +bones/108/rotation = Quaternion(-0.699991, -1.60739e-14, 5.80569e-15, 0.714152) +bones/109/rotation = Quaternion(0.815783, 6.89457e-08, 9.72489e-08, 0.578359) +bones/109/scale = Vector3(1, 1, 1) +bones/110/rotation = Quaternion(-0.815783, -6.89457e-08, -9.72489e-08, 0.578359) +bones/110/scale = Vector3(1, 1, 1) +bones/111/rotation = Quaternion(0.707107, 8.42936e-08, 8.42937e-08, 0.707107) +bones/111/scale = Vector3(1, 1, 1) +bones/114/rotation = Quaternion(-2.98023e-07, 8.88179e-16, -7.21355e-14, 1) +bones/115/rotation = Quaternion(-0.0569537, -1.19016e-07, -6.7894e-09, 0.998377) +bones/118/rotation = Quaternion(-0.607777, -0.347396, -0.354639, 0.619803) +bones/118/scale = Vector3(1, 1, 1) +bones/119/rotation = Quaternion(-0.41259, 0.858332, -0.258332, 0.162176) +bones/119/scale = Vector3(0.976016, 0.976015, 0.976016) +bones/120/rotation = Quaternion(0.811563, -5.42386e-08, 6.02938e-08, 0.584264) +bones/120/scale = Vector3(0.995505, 0.995505, 0.995505) +bones/121/rotation = Quaternion(-0.407843, 0.0329286, -0.0168076, 0.912303) +bones/121/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/124/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/126/rotation = Quaternion(-8.52844e-08, 0.0172165, 1.76758e-08, 0.999852) +bones/126/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/127/rotation = Quaternion(-1.06171e-07, 0.000310402, 2.23517e-07, 1) +bones/128/scale = Vector3(1.02457, 1.02457, 1.02457) +bones/129/rotation = Quaternion(2.14423e-07, -0.17875, 1.69589e-08, 0.983895) +bones/129/scale = Vector3(1.02457, 1.02457, 1.02457) +bones/133/scale = Vector3(1, 1, 1) +bones/134/rotation = Quaternion(0.386027, 0.695499, -0.490038, 0.356548) +bones/135/rotation = Quaternion(0.192705, 7.77732e-09, -1.02176e-08, 0.981257) +bones/136/rotation = Quaternion(-0.0202495, -0.000620612, -0.0306112, 0.999326) +bones/136/scale = Vector3(1, 1, 1) +bones/137/rotation = Quaternion(-1.3411e-07, 3.09199e-07, 2.88244e-07, 1) +bones/138/rotation = Quaternion(0.0564366, 0.732928, -0.677933, -0.00629121) +bones/139/rotation = Quaternion(-0.421646, 0.0138039, 0.00641978, 0.906633) +bones/139/scale = Vector3(0.976015, 0.976015, 0.976015) +bones/140/rotation = Quaternion(0.811563, -5.74702e-08, 6.52868e-08, 0.584264) +bones/140/scale = Vector3(0.995505, 0.995505, 0.995505) +bones/141/rotation = Quaternion(-0.468492, 0.778371, -0.132216, 0.39645) +bones/141/scale = Vector3(1, 1, 1) +bones/143/rotation = Quaternion(-0.468492, 0.778371, -0.132216, 0.39645) +bones/143/scale = Vector3(1.01221, 0.976015, 1.01221) +bones/144/rotation = Quaternion(-3.93055e-08, 0.104437, -1.89924e-09, 0.994531) +bones/144/scale = Vector3(1, 1, 1) +bones/145/rotation = Quaternion(0.798642, 0.105596, -0.144409, 0.574601) +bones/145/scale = Vector3(1.00226, 0.963548, 1.03574) +bones/146/rotation = Quaternion(2.12587e-07, 0.017527, -7.76764e-08, 0.999846) +bones/147/rotation = Quaternion(-0.407427, 0.0163799, -0.0242184, 0.91277) +bones/147/scale = Vector3(0.985859, 1.00528, 1.00995) +bones/148/rotation = Quaternion(-0.607777, 0.347396, 0.354639, 0.619803) +bones/148/scale = Vector3(1, 1, 1) +bones/149/rotation = Quaternion(-0.41259, -0.858332, 0.258332, 0.162176) +bones/149/scale = Vector3(0.976016, 0.976015, 0.976016) +bones/150/rotation = Quaternion(0.811563, 5.42386e-08, -6.02938e-08, 0.584264) +bones/150/scale = Vector3(0.995505, 0.995505, 0.995505) +bones/151/rotation = Quaternion(-0.407843, -0.0329286, 0.0168076, 0.912303) +bones/151/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/154/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/156/rotation = Quaternion(9.07446e-08, -0.0172164, -2.04458e-08, 0.999852) +bones/156/scale = Vector3(1.0292, 1.0292, 1.0292) +bones/157/rotation = Quaternion(-1.06171e-07, -0.000310402, -2.23517e-07, 1) +bones/158/scale = Vector3(1.02457, 1.02457, 1.02457) +bones/159/rotation = Quaternion(3.33602e-07, 0.17875, 1.07571e-08, 0.983895) +bones/159/scale = Vector3(1.02457, 1.02457, 1.02457) +bones/163/scale = Vector3(1, 1, 1) +bones/164/rotation = Quaternion(-0.386027, 0.695499, -0.490038, -0.356548) +bones/165/rotation = Quaternion(0.192705, -7.77732e-09, 1.02176e-08, 0.981257) +bones/166/rotation = Quaternion(-0.0202495, 0.000620612, 0.0306112, 0.999326) +bones/166/scale = Vector3(1, 1, 1) +bones/167/rotation = Quaternion(-1.3411e-07, -3.09199e-07, -2.88244e-07, 1) +bones/168/rotation = Quaternion(-0.0564366, 0.732928, -0.677933, 0.00629121) +bones/169/rotation = Quaternion(-0.421646, -0.0138039, -0.00641978, 0.906633) +bones/169/scale = Vector3(0.976015, 0.976015, 0.976015) +bones/170/rotation = Quaternion(0.811563, 5.74702e-08, -6.52868e-08, 0.584264) +bones/170/scale = Vector3(0.995505, 0.995505, 0.995505) +bones/171/rotation = Quaternion(-0.468492, -0.778371, 0.132216, 0.39645) +bones/171/scale = Vector3(1, 1, 1) +bones/173/rotation = Quaternion(-0.468492, -0.778371, 0.132216, 0.39645) +bones/173/scale = Vector3(1.01221, 0.976015, 1.01221) +bones/174/rotation = Quaternion(-1.21486e-08, -0.104437, -2.05754e-08, 0.994532) +bones/175/rotation = Quaternion(0.798642, -0.105596, 0.144409, 0.574601) +bones/175/scale = Vector3(1.00226, 0.963548, 1.03574) +bones/176/rotation = Quaternion(2.2423e-07, -0.017527, 8.04709e-08, 0.999846) +bones/177/rotation = Quaternion(-0.407427, -0.0163799, 0.0242184, 0.91277) +bones/177/scale = Vector3(0.98586, 1.00528, 1.00995) +bones/178/rotation = Quaternion(-0.607777, -0.347396, -0.354639, 0.619803) +bones/178/scale = Vector3(1, 1, 1) +bones/179/rotation = Quaternion(-0.607777, 0.347396, 0.354639, 0.619803) +bones/179/scale = Vector3(1, 1, 1) +bones/182/position = Vector3(-0.265005, 3.1665e-08, -0.0406387) +bones/182/rotation = Quaternion(0.0909222, 0.66691, -0.737911, -0.0495121) +bones/182/scale = Vector3(1, 1, 1) +bones/184/rotation = Quaternion(-0.707107, -5.28304e-09, -5.27275e-09, 0.707107) +bones/185/rotation = Quaternion(0.966264, -1.05128e-08, -0.238719, -0.0966792) +bones/185/scale = Vector3(1, 1, 0.999998) +bones/187/position = Vector3(0.265005, 3.1665e-08, -0.0406387) +bones/187/rotation = Quaternion(-0.0909221, 0.66691, -0.737911, 0.0495122) +bones/187/scale = Vector3(1, 1, 1) +bones/189/rotation = Quaternion(-0.707107, 5.28304e-09, 5.27275e-09, 0.707107) +bones/190/rotation = Quaternion(0.966264, 1.05128e-08, 0.238719, -0.0966792) +bones/190/scale = Vector3(1, 1, 0.999998) +bones/199/rotation = Quaternion(0.961249, -3.28639e-08, 1.1459e-07, -0.275683) +bones/199/scale = Vector3(1, 1, 0.999999) +bones/200/position = Vector3(3.3131e-09, -2.79395e-09, 4.23446e-09) +bones/201/rotation = Quaternion(0.961249, -3.2864e-08, 1.14589e-07, 0.275683) +bones/201/scale = Vector3(1, 1, 0.999999) +bones/202/rotation = Quaternion(8.52652e-14, 1.21169e-27, 1, 2.54111e-21) +bones/203/position = Vector3(0.0733334, 0.139832, 0.214619) +bones/203/rotation = Quaternion(-0.707107, 0, 0, 0.707107) +bones/204/rotation = Quaternion(0.00540466, 0, 0, 0.999985) +bones/213/rotation = Quaternion(0.961249, 3.28639e-08, -1.1459e-07, -0.275683) +bones/213/scale = Vector3(1, 1, 0.999999) +bones/214/position = Vector3(-3.3131e-09, -2.79395e-09, 4.23446e-09) +bones/215/rotation = Quaternion(0.961249, 3.28639e-08, -1.1459e-07, 0.275683) +bones/215/scale = Vector3(1, 1, 0.999999) +bones/216/rotation = Quaternion(-8.52652e-14, 1.21169e-27, 1, -2.54111e-21) +bones/217/position = Vector3(-0.0733334, 0.139832, 0.214619) +bones/217/rotation = Quaternion(-0.707107, 0, 0, 0.707107) +bones/218/rotation = Quaternion(0.00540466, 0, 0, 0.999985) + +[node name="nail-blade" parent="base/rig/Skeleton3D" index="0"] +transform = Transform3D(0.668384, -1.58392e-07, 0.743816, 0.743816, 7.9704e-09, -0.668384, 9.99383e-08, 1, 1.23142e-07, -0.291155, 0.739636, -0.242499) + +[node name="nail-handle" parent="base/rig/Skeleton3D" index="1"] +transform = Transform3D(0.668384, -1.58392e-07, 0.743816, 0.743816, 7.9704e-09, -0.668384, 9.99383e-08, 1, 1.23142e-07, -0.291155, 0.739636, -0.242499) + +[node name="AnimationTree" type="AnimationTree" parent="." index="2"] +tree_root = SubResource("AnimationNodeBlendTree_xdiqd") +anim_player = NodePath("../AnimationPlayer") +parameters/forward/blend_position = 0.0 +parameters/movement/current_state = "forward" +parameters/movement/transition_request = "" +parameters/movement/current_index = 0 diff --git a/skin/the-knight_knight-cape-alpha.png b/skin/the-knight_knight-cape-alpha.png new file mode 100644 index 0000000..37f47c1 Binary files /dev/null and b/skin/the-knight_knight-cape-alpha.png differ diff --git a/skin/the-knight_knight-cape-alpha.png.import b/skin/the-knight_knight-cape-alpha.png.import new file mode 100644 index 0000000..1c2a0e7 --- /dev/null +++ b/skin/the-knight_knight-cape-alpha.png.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dfdlu7rg11uru" +path.s3tc="res://.godot/imported/the-knight_knight-cape-alpha.png-dcb4f2b60a65a5fc240b17f136d22ea6.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "f098d4c97c460581f4326eed8ebbf261" +} + +[deps] + +source_file="res://skin/the-knight_knight-cape-alpha.png" +dest_files=["res://.godot/imported/the-knight_knight-cape-alpha.png-dcb4f2b60a65a5fc240b17f136d22ea6.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +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 diff --git a/skin/the_knight.gd b/skin/the_knight.gd new file mode 100644 index 0000000..1296406 --- /dev/null +++ b/skin/the_knight.gd @@ -0,0 +1,21 @@ +extends Node3D + + +@onready var animation_tree: AnimationTree = $AnimationTree + + +func forward(speed: float) -> void: + animation_tree.set("parameters/movement/transition_request", "forward") + animation_tree.set("parameters/forward/blend_position", speed) + + +func idle() -> void: + animation_tree.set("parameters/movement/transition_request", "idle") + + +func fall() -> void: + animation_tree.set("parameters/movement/transition_request", "fall") + + +func attack() -> void: + animation_tree.set("parameters/movement/transition_request", "attack") diff --git a/test/test.tscn b/test/test.tscn new file mode 100644 index 0000000..0e2999b --- /dev/null +++ b/test/test.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=8 format=3 uid="uid://bvydwnbie3pv4"] + +[ext_resource type="PackedScene" uid="uid://chtr62feiltax" path="res://player/player.tscn" id="1_ytdba"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ohmka"] +sky_top_color = Color(0.0360979, 0.133006, 0.175678, 1) +sky_horizon_color = Color(0.542774, 0.569877, 0.606419, 1) +ground_bottom_color = Color(0.135, 0.1465, 0.25, 1) +ground_horizon_color = Color(0.542774, 0.569877, 0.606419, 1) + +[sub_resource type="Sky" id="Sky_mganl"] +sky_material = SubResource("ProceduralSkyMaterial_ohmka") + +[sub_resource type="Environment" id="Environment_7wa85"] +background_mode = 2 +sky = SubResource("Sky_mganl") +tonemap_mode = 2 +ssao_enabled = true +glow_enabled = true + +[sub_resource type="PlaneMesh" id="PlaneMesh_dplfc"] +size = Vector2(40, 8.98) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_87x6o"] +albedo_color = Color(0.149763, 0.203291, 0.262937, 1) + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_73kmu"] +data = PackedVector3Array(20, 0, 4.49, -20, 0, 4.49, 20, 0, -4.49, -20, 0, 4.49, -20, 0, -4.49, 20, 0, -4.49) + +[node name="Test" type="Node3D"] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_7wa85") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0) +light_color = Color(0.968627, 1, 0.913725, 1) +shadow_enabled = true + +[node name="Player" parent="." instance=ExtResource("1_ytdba")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.806743, 1.19209e-07, 0.147649) + +[node name="ground" type="Node3D" parent="."] + +[node name="plane" type="MeshInstance3D" parent="ground"] +mesh = SubResource("PlaneMesh_dplfc") +skeleton = NodePath("../..") +surface_material_override/0 = SubResource("StandardMaterial3D_87x6o") + +[node name="StaticBody3D" type="StaticBody3D" parent="ground/plane"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="ground/plane/StaticBody3D"] +shape = SubResource("ConcavePolygonShape3D_73kmu")