getting the weapon tutorial
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 16s
Create tag and build when new code gets to main / Export (push) Successful in 4m47s

This commit is contained in:
2025-10-31 16:18:59 +01:00
parent 2d3a1b0d4c
commit fd16342aca
8 changed files with 105 additions and 97 deletions

View File

@@ -6,6 +6,7 @@
height = 1.7
[sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"]
radius = 0.75
[node name="MantleSystem" type="Node3D"]
script = ExtResource("1_2oobp")

View File

@@ -81,6 +81,15 @@ public partial class WeaponSystem : RigidBody3D
EmitSignalWeaponRetrieved();
}
public void PlaceWeaponForTutorial(Vector3 location)
{
_weaponState.SendEvent("plant");
Freeze = true;
GlobalPosition = location;
PlantLocation = location;
Visible = false;
}
public void ThrowWeapon(Vector3 end, bool hasHit, Vector3 collisionLocation, Vector3 collisionNormal)
{
_weaponState.SendEvent("throw");
@@ -126,6 +135,7 @@ public partial class WeaponSystem : RigidBody3D
_weaponState.SendEvent("recover");
Transform = _startTransform;
Freeze = true;
Visible = true;
}
public override void _IntegrateForces(PhysicsDirectBodyState3D state)

View File

@@ -0,0 +1,13 @@
[gd_resource type="CylinderMesh" load_steps=2 format=3 uid="uid://b7vt0nk2htpo4"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jv82r"]
use_z_clip_scale = true
z_clip_scale = 0.9
use_fov_override = true
fov_override = 70.0
[resource]
material = SubResource("StandardMaterial3D_jv82r")
top_radius = 0.0
bottom_radius = 0.05
height = 1.0

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=13 format=3 uid="uid://ckm3d6k08a72u"]
[gd_scene load_steps=12 format=3 uid="uid://ckm3d6k08a72u"]
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://systems/weapon/WeaponSystem.cs" id="1_csqwk"]
[ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="2_x1nha"]
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
[ext_resource type="CylinderMesh" uid="uid://b7vt0nk2htpo4" path="res://systems/weapon/weapon.tres" id="3_svc06"]
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"]
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
@@ -11,23 +12,12 @@
height = 1.0
radius = 0.1
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5owyf"]
use_z_clip_scale = true
z_clip_scale = 0.9
use_fov_override = true
fov_override = 70.0
[sub_resource type="CylinderMesh" id="CylinderMesh_x1nha"]
material = SubResource("StandardMaterial3D_5owyf")
top_radius = 0.0
bottom_radius = 0.05
height = 1.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_svc06"]
render_priority = 1
transparency = 1
no_depth_test = true
shading_mode = 0
grow_amount = 0.1
stencil_mode = 3
stencil_flags = 1
stencil_compare = 5
@@ -62,7 +52,7 @@ shape = SubResource("CylinderShape3D_avini")
[node name="Weapon" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0)
mesh = SubResource("CylinderMesh_x1nha")
mesh = ExtResource("3_svc06")
[node name="StateChart" type="Node" parent="."]
script = ExtResource("3_5owyf")
@@ -72,6 +62,12 @@ metadata/_custom_type_script = "uid://couw105c3bde4"
script = ExtResource("4_svc06")
initial_state = NodePath("InHand")
[node name="ToPlanted" type="Node" parent="StateChart/Root"]
script = ExtResource("6_jpdh0")
to = NodePath("../Planted")
event = &"plant"
delay_in_seconds = "0.0"
[node name="InHand" type="Node" parent="StateChart/Root"]
script = ExtResource("5_m0v1h")
@@ -90,12 +86,6 @@ to = NodePath("../../InHand")
event = &"recover"
delay_in_seconds = "0.0"
[node name="ToPlanted" type="Node" parent="StateChart/Root/Flying"]
script = ExtResource("6_jpdh0")
to = NodePath("../../Planted")
event = &"plant"
delay_in_seconds = "0.0"
[node name="Planted" type="Node" parent="StateChart/Root"]
script = ExtResource("5_m0v1h")

View File

@@ -0,0 +1,11 @@
[gd_resource type="CylinderMesh" load_steps=2 format=3 uid="uid://bhkbwvuft1bpg"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_f5qr4"]
z_clip_scale = 0.9
fov_override = 70.0
[resource]
material = SubResource("StandardMaterial3D_f5qr4")
top_radius = 0.0
bottom_radius = 0.05
height = 1.0