diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2022-10-11 00:15:48 -0400 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2022-10-11 00:15:48 -0400 |
| commit | e7fb9bacf3ebb5209f90f412757c35276af51e85 (patch) | |
| tree | 2dfac9d1273bf5efa1da5cfe82b4d8e64ae0bf3a /godot/scenes/characters | |
| parent | 7dbec964a375598d454e04719576eb6c469a5d7b (diff) | |
ai cannon-manning state machine
Diffstat (limited to 'godot/scenes/characters')
| -rw-r--r-- | godot/scenes/characters/PlayerRigid.tscn | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/godot/scenes/characters/PlayerRigid.tscn b/godot/scenes/characters/PlayerRigid.tscn index bc5f588..d66655a 100644 --- a/godot/scenes/characters/PlayerRigid.tscn +++ b/godot/scenes/characters/PlayerRigid.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://scripts/characters/player_controller_new.gd" type="Script" id=1] [ext_resource path="res://theming/Rapscallion-q341.ttf" type="DynamicFontData" id=2] @@ -8,6 +8,9 @@ [ext_resource path="res://scenes/weapons/pistol.tres" type="Resource" id=6] [ext_resource path="res://scenes/weapons/rockets.tres" type="Resource" id=7] [ext_resource path="res://scenes/weapons/grapplinghook.tres" type="Resource" id=8] +[ext_resource path="res://scripts/fsm/StateMachine.gd" type="Script" id=9] +[ext_resource path="res://scripts/characters/ManCannon.gd" type="Script" id=10] +[ext_resource path="res://scripts/characters/Idle.gd" type="Script" id=11] [sub_resource type="PhysicsMaterial" id=8] resource_local_to_scene = true @@ -28,7 +31,10 @@ font_data = ExtResource( 2 ) [sub_resource type="BoxShape" id=1] extents = Vector3( 0.325, 0.9, 0.325 ) -[node name="Soldier" type="RigidBody" groups=["playable", "player"]] +[sub_resource type="SphereShape" id=9] +radius = 50.0 + +[node name="Marine" type="RigidBody" groups=["playable", "player"]] collision_layer = 32769 collision_mask = 32769 mode = 2 @@ -93,11 +99,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0 ) mesh = SubResource( 4 ) [node name="NavigationAgent" type="NavigationAgent" parent="."] -path_desired_distance = 1.5 -target_desired_distance = 1.5 -agent_height_offset = -0.5 -path_max_distance = 1.0 -neighbor_dist = 15.0 +avoidance_enabled = true +radius = 0.3 [node name="Nametag" type="Label3D" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.08522, 0 ) @@ -115,5 +118,21 @@ script = ExtResource( 3 ) [node name="Collision" type="CollisionShape" parent="AreaDetect"] shape = SubResource( 1 ) +[node name="AISearchArea" type="Area" parent="."] +monitorable = false + +[node name="Collision" type="CollisionShape" parent="AISearchArea"] +shape = SubResource( 9 ) + +[node name="AIStateMachine" type="Node" parent="."] +script = ExtResource( 9 ) +initial_state = NodePath("Idle") + +[node name="Idle" type="Node" parent="AIStateMachine"] +script = ExtResource( 11 ) + +[node name="ManCannon" type="Node" parent="AIStateMachine"] +script = ExtResource( 10 ) + [connection signal="area_entered" from="AreaDetect" to="AreaDetect" method="_on_AreaDetect_area_entered"] [connection signal="area_exited" from="AreaDetect" to="AreaDetect" method="_on_AreaDetect_area_exited"] |
