diff --git a/levels/prototype_scene.tscn b/levels/prototype_scene.tscn index 48b73b2..1b040bf 100644 --- a/levels/prototype_scene.tscn +++ b/levels/prototype_scene.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=8 format=3 uid="uid://cqrh2cc7m2i7f"] +[gd_scene load_steps=9 format=3 uid="uid://cqrh2cc7m2i7f"] [ext_resource type="Environment" uid="uid://d0cfgtx2yxw13" path="res://environments/prototype_environment.tres" id="1_i6jab"] [ext_resource type="Script" uid="uid://ypgm3aplt78m" path="res://scripts/multiplayer/team_spawner.gd" id="4_pi0y7"] [ext_resource type="Material" uid="uid://bx3f5vx71ynh5" path="res://materials/OrangeMat.tres" id="4_y6i55"] [ext_resource type="Material" uid="uid://mlha6r17v2en" path="res://materials/Bluemat.tres" id="5_bno23"] +[ext_resource type="Script" uid="uid://be7l33prlm8gh" path="res://scripts/multiplayer/dynamic_objects_container.gd" id="5_y6i55"] [sub_resource type="Animation" id="Animation_y6i55"] length = 0.001 @@ -98,29 +99,38 @@ polygon = PackedVector2Array(1.1265539, -0.16863012, -3.9689837, 4.1396155, -6.2 depth = 2.64 material = ExtResource("5_bno23") -[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."] -_spawnable_scenes = PackedStringArray("uid://dpsr6ug3pkb40", "uid://ckjabjcvgki6n") -spawn_path = NodePath("..") - [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { &"": SubResource("AnimationLibrary_bno23") } autoplay = "main" -[node name="DefenceSpawn" type="Marker3D" parent="."] +[node name="PlayersContainer" type="Node3D" parent="."] + +[node name="DefenceSpawn" type="Marker3D" parent="PlayersContainer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.2367034, 0.5180037, -10.260834) script = ExtResource("4_pi0y7") spawn_radius = 10.0 -[node name="AttackSpawn" type="Marker3D" parent="."] +[node name="AttackSpawn" type="Marker3D" parent="PlayersContainer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -32.38732, 0.5180037, 8.271217) script = ExtResource("4_pi0y7") team = 1 spawn_radius = 10.0 -[node name="SpectatorSpawn" type="Marker3D" parent="."] +[node name="SpectatorSpawn" type="Marker3D" parent="PlayersContainer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.0165482, 17.832424, 2.9756432) script = ExtResource("4_pi0y7") team = 2 spawn_radius = 10.0 + +[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="PlayersContainer"] +_spawnable_scenes = PackedStringArray("uid://dpsr6ug3pkb40", "uid://ckjabjcvgki6n") +spawn_path = NodePath("..") + +[node name="DynamicObjectsContainer" type="Node3D" parent="."] +script = ExtResource("5_y6i55") + +[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="DynamicObjectsContainer"] +_spawnable_scenes = PackedStringArray("uid://dtbpyfdawb02b") +spawn_path = NodePath("..") diff --git a/models/molikman_hands.glb b/models/characters/viewmodels/molikman_hands.glb similarity index 100% rename from models/molikman_hands.glb rename to models/characters/viewmodels/molikman_hands.glb diff --git a/models/molikman_hands.glb.import b/models/characters/viewmodels/molikman_hands.glb.import similarity index 99% rename from models/molikman_hands.glb.import rename to models/characters/viewmodels/molikman_hands.glb.import index bd161eb..2fb684b 100644 --- a/models/molikman_hands.glb.import +++ b/models/characters/viewmodels/molikman_hands.glb.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://c3hg4ux4j76j2" -path="res://.godot/imported/molikman_hands.glb-28dc337a5d818e73f3f959c666943024.scn" +path="res://.godot/imported/molikman_hands.glb-17829dafd195d0cd3da4b3a21f0bdff6.scn" [deps] -source_file="res://models/molikman_hands.glb" -dest_files=["res://.godot/imported/molikman_hands.glb-28dc337a5d818e73f3f959c666943024.scn"] +source_file="res://models/characters/viewmodels/molikman_hands.glb" +dest_files=["res://.godot/imported/molikman_hands.glb-17829dafd195d0cd3da4b3a21f0bdff6.scn"] [params] diff --git a/models/molikman_hands_tex_Molikman.png b/models/characters/viewmodels/molikman_hands_tex_Molikman.png similarity index 100% rename from models/molikman_hands_tex_Molikman.png rename to models/characters/viewmodels/molikman_hands_tex_Molikman.png diff --git a/models/molikman_hands_tex_Molikman.png.import b/models/characters/viewmodels/molikman_hands_tex_Molikman.png.import similarity index 82% rename from models/molikman_hands_tex_Molikman.png.import rename to models/characters/viewmodels/molikman_hands_tex_Molikman.png.import index 50e681f..3ec9b73 100644 --- a/models/molikman_hands_tex_Molikman.png.import +++ b/models/characters/viewmodels/molikman_hands_tex_Molikman.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://eo4fkc3b4h01" -path.s3tc="res://.godot/imported/molikman_hands_tex_Molikman.png-00eab978ebbbebd3d27ba6449445dd5a.s3tc.ctex" +uid="uid://c81mv6bw6gr6t" +path.s3tc="res://.godot/imported/molikman_hands_tex_Molikman.png-309150e72c75bcb8d14d5eaef94f2a57.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/molikman_hands_tex_Molikman.png" -dest_files=["res://.godot/imported/molikman_hands_tex_Molikman.png-00eab978ebbbebd3d27ba6449445dd5a.s3tc.ctex"] +source_file="res://models/characters/viewmodels/molikman_hands_tex_Molikman.png" +dest_files=["res://.godot/imported/molikman_hands_tex_Molikman.png-309150e72c75bcb8d14d5eaef94f2a57.s3tc.ctex"] [params] diff --git a/models/molikman_hands_tex_bomb.png b/models/characters/viewmodels/molikman_hands_tex_bomb.png similarity index 100% rename from models/molikman_hands_tex_bomb.png rename to models/characters/viewmodels/molikman_hands_tex_bomb.png diff --git a/models/characters/viewmodels/molikman_hands_tex_bomb.png.import b/models/characters/viewmodels/molikman_hands_tex_bomb.png.import new file mode 100644 index 0000000..824510b --- /dev/null +++ b/models/characters/viewmodels/molikman_hands_tex_bomb.png.import @@ -0,0 +1,44 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://twxsiwqgu1dy" +path.s3tc="res://.godot/imported/molikman_hands_tex_bomb.png-f43d1a526d57ce29d4126c1880d5be9a.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "478cd944aa7bbc08b6e05bea8b51b71e" +} + +[deps] + +source_file="res://models/characters/viewmodels/molikman_hands_tex_bomb.png" +dest_files=["res://.godot/imported/molikman_hands_tex_bomb.png-f43d1a526d57ce29d4126c1880d5be9a.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/models/molikman_hands_tex_sp_albedo.png b/models/characters/viewmodels/molikman_hands_tex_sp_albedo.png similarity index 100% rename from models/molikman_hands_tex_sp_albedo.png rename to models/characters/viewmodels/molikman_hands_tex_sp_albedo.png diff --git a/models/molikman_hands_tex_sp_albedo.png.import b/models/characters/viewmodels/molikman_hands_tex_sp_albedo.png.import similarity index 82% rename from models/molikman_hands_tex_sp_albedo.png.import rename to models/characters/viewmodels/molikman_hands_tex_sp_albedo.png.import index 5395443..73079f7 100644 --- a/models/molikman_hands_tex_sp_albedo.png.import +++ b/models/characters/viewmodels/molikman_hands_tex_sp_albedo.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cheflq6sljpmk" -path.s3tc="res://.godot/imported/molikman_hands_tex_sp_albedo.png-1f43db41736e6d0c2527c3839e087d2e.s3tc.ctex" +uid="uid://mjmyeeb7m7yy" +path.s3tc="res://.godot/imported/molikman_hands_tex_sp_albedo.png-eeec5d3a3e4d9bcb56cdb0eedad0e3d5.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/molikman_hands_tex_sp_albedo.png" -dest_files=["res://.godot/imported/molikman_hands_tex_sp_albedo.png-1f43db41736e6d0c2527c3839e087d2e.s3tc.ctex"] +source_file="res://models/characters/viewmodels/molikman_hands_tex_sp_albedo.png" +dest_files=["res://.godot/imported/molikman_hands_tex_sp_albedo.png-eeec5d3a3e4d9bcb56cdb0eedad0e3d5.s3tc.ctex"] [params] diff --git a/models/molikman_hands_tex_sp_roughness.png b/models/characters/viewmodels/molikman_hands_tex_sp_roughness.png similarity index 100% rename from models/molikman_hands_tex_sp_roughness.png rename to models/characters/viewmodels/molikman_hands_tex_sp_roughness.png diff --git a/models/molikman_hands_tex_sp_roughness.png.import b/models/characters/viewmodels/molikman_hands_tex_sp_roughness.png.import similarity index 81% rename from models/molikman_hands_tex_sp_roughness.png.import rename to models/characters/viewmodels/molikman_hands_tex_sp_roughness.png.import index b76dbf7..e89c69d 100644 --- a/models/molikman_hands_tex_sp_roughness.png.import +++ b/models/characters/viewmodels/molikman_hands_tex_sp_roughness.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cppa8jv8ean45" -path.s3tc="res://.godot/imported/molikman_hands_tex_sp_roughness.png-ff414b619c112cac9e303a92eba0d925.s3tc.ctex" +uid="uid://cmpn3gco5t5p2" +path.s3tc="res://.godot/imported/molikman_hands_tex_sp_roughness.png-c6dffe5c091cc4a6b361ce8b971b2c3c.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/molikman_hands_tex_sp_roughness.png" -dest_files=["res://.godot/imported/molikman_hands_tex_sp_roughness.png-ff414b619c112cac9e303a92eba0d925.s3tc.ctex"] +source_file="res://models/characters/viewmodels/molikman_hands_tex_sp_roughness.png" +dest_files=["res://.godot/imported/molikman_hands_tex_sp_roughness.png-c6dffe5c091cc4a6b361ce8b971b2c3c.s3tc.ctex"] [params] diff --git a/models/molikman_ingame.glb b/models/characters/worldmodels/molikman_ingame.glb similarity index 100% rename from models/molikman_ingame.glb rename to models/characters/worldmodels/molikman_ingame.glb diff --git a/models/molikman_ingame.glb.import b/models/characters/worldmodels/molikman_ingame.glb.import similarity index 76% rename from models/molikman_ingame.glb.import rename to models/characters/worldmodels/molikman_ingame.glb.import index b93c503..7f91ade 100644 --- a/models/molikman_ingame.glb.import +++ b/models/characters/worldmodels/molikman_ingame.glb.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://c2r8dbudbs7l3" -path="res://.godot/imported/molikman_ingame.glb-dc1d9902b7bc622e5bda8fed04560710.scn" +path="res://.godot/imported/molikman_ingame.glb-aaebce235b7cde5aaa332a05b6193b29.scn" [deps] -source_file="res://models/molikman_ingame.glb" -dest_files=["res://.godot/imported/molikman_ingame.glb-dc1d9902b7bc622e5bda8fed04560710.scn"] +source_file="res://models/characters/worldmodels/molikman_ingame.glb" +dest_files=["res://.godot/imported/molikman_ingame.glb-aaebce235b7cde5aaa332a05b6193b29.scn"] [params] diff --git a/models/molikman_ingame_tex_Molikman.png b/models/characters/worldmodels/molikman_ingame_tex_Molikman.png similarity index 100% rename from models/molikman_ingame_tex_Molikman.png rename to models/characters/worldmodels/molikman_ingame_tex_Molikman.png diff --git a/models/molikman_ingame_tex_Molikman.png.import b/models/characters/worldmodels/molikman_ingame_tex_Molikman.png.import similarity index 81% rename from models/molikman_ingame_tex_Molikman.png.import rename to models/characters/worldmodels/molikman_ingame_tex_Molikman.png.import index 73197d9..f7029f9 100644 --- a/models/molikman_ingame_tex_Molikman.png.import +++ b/models/characters/worldmodels/molikman_ingame_tex_Molikman.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bfc7syqoe06pt" -path.s3tc="res://.godot/imported/molikman_ingame_tex_Molikman.png-5702ec26cbf18695fea633cff99e732a.s3tc.ctex" +uid="uid://d1rfpdlpfnt5w" +path.s3tc="res://.godot/imported/molikman_ingame_tex_Molikman.png-fa994ec91481577d99049156480274fc.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/molikman_ingame_tex_Molikman.png" -dest_files=["res://.godot/imported/molikman_ingame_tex_Molikman.png-5702ec26cbf18695fea633cff99e732a.s3tc.ctex"] +source_file="res://models/characters/worldmodels/molikman_ingame_tex_Molikman.png" +dest_files=["res://.godot/imported/molikman_ingame_tex_Molikman.png-fa994ec91481577d99049156480274fc.s3tc.ctex"] [params] diff --git a/models/weapons/Bomb.glb b/models/weapons/Bomb.glb new file mode 100644 index 0000000..cf18cb4 Binary files /dev/null and b/models/weapons/Bomb.glb differ diff --git a/models/weapons/Bomb.glb.import b/models/weapons/Bomb.glb.import new file mode 100644 index 0000000..a12a94b --- /dev/null +++ b/models/weapons/Bomb.glb.import @@ -0,0 +1,42 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dftij0fdq3lbr" +path="res://.godot/imported/Bomb.glb-d4aa7dce05e968f36a20d01a6e8c400f.scn" + +[deps] + +source_file="res://models/weapons/Bomb.glb" +dest_files=["res://.godot/imported/Bomb.glb-d4aa7dce05e968f36a20d01a6e8c400f.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +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="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=1 diff --git a/models/weapons/Bomb_tex_bomb.png b/models/weapons/Bomb_tex_bomb.png new file mode 100644 index 0000000..842657e Binary files /dev/null and b/models/weapons/Bomb_tex_bomb.png differ diff --git a/models/molikman_hands_tex_bomb.png.import b/models/weapons/Bomb_tex_bomb.png.import similarity index 73% rename from models/molikman_hands_tex_bomb.png.import rename to models/weapons/Bomb_tex_bomb.png.import index 569edca..6c5c9ad 100644 --- a/models/molikman_hands_tex_bomb.png.import +++ b/models/weapons/Bomb_tex_bomb.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://2fho0wsa054v" -path.s3tc="res://.godot/imported/molikman_hands_tex_bomb.png-7baac85b3f254b7ca25ecb123abd1736.s3tc.ctex" +uid="uid://kiprxlfy83qr" +path.s3tc="res://.godot/imported/Bomb_tex_bomb.png-9ebaef1ac68a22dd59a32bc05f6a9a4b.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/molikman_hands_tex_bomb.png" -dest_files=["res://.godot/imported/molikman_hands_tex_bomb.png-7baac85b3f254b7ca25ecb123abd1736.s3tc.ctex"] +source_file="res://models/weapons/Bomb_tex_bomb.png" +dest_files=["res://.godot/imported/Bomb_tex_bomb.png-9ebaef1ac68a22dd59a32bc05f6a9a4b.s3tc.ctex"] [params] diff --git a/models/starting_pistol.glb b/models/weapons/starting_pistol.glb similarity index 100% rename from models/starting_pistol.glb rename to models/weapons/starting_pistol.glb diff --git a/models/starting_pistol.glb.import b/models/weapons/starting_pistol.glb.import similarity index 77% rename from models/starting_pistol.glb.import rename to models/weapons/starting_pistol.glb.import index 5c2baaa..7ea93c6 100644 --- a/models/starting_pistol.glb.import +++ b/models/weapons/starting_pistol.glb.import @@ -4,12 +4,12 @@ importer="scene" importer_version=1 type="PackedScene" uid="uid://d3sjs6efbshpk" -path="res://.godot/imported/starting_pistol.glb-29198af604eac72687b4adaf951ef022.scn" +path="res://.godot/imported/starting_pistol.glb-5a510d4729ccd8a4a1a6e6b87c5e9d4d.scn" [deps] -source_file="res://models/starting_pistol.glb" -dest_files=["res://.godot/imported/starting_pistol.glb-29198af604eac72687b4adaf951ef022.scn"] +source_file="res://models/weapons/starting_pistol.glb" +dest_files=["res://.godot/imported/starting_pistol.glb-5a510d4729ccd8a4a1a6e6b87c5e9d4d.scn"] [params] diff --git a/models/starting_pistol_tex_sp_albedo.png b/models/weapons/starting_pistol_tex_sp_albedo.png similarity index 100% rename from models/starting_pistol_tex_sp_albedo.png rename to models/weapons/starting_pistol_tex_sp_albedo.png diff --git a/models/starting_pistol_tex_sp_albedo.png.import b/models/weapons/starting_pistol_tex_sp_albedo.png.import similarity index 82% rename from models/starting_pistol_tex_sp_albedo.png.import rename to models/weapons/starting_pistol_tex_sp_albedo.png.import index 71f5477..c48299d 100644 --- a/models/starting_pistol_tex_sp_albedo.png.import +++ b/models/weapons/starting_pistol_tex_sp_albedo.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://yl82ojt8wph5" -path.s3tc="res://.godot/imported/starting_pistol_tex_sp_albedo.png-8161f1ff7d1a76474d978c2a86f54261.s3tc.ctex" +uid="uid://dby4gckjjasjg" +path.s3tc="res://.godot/imported/starting_pistol_tex_sp_albedo.png-b67d5560b2f5fdc20868def544d0d36d.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/starting_pistol_tex_sp_albedo.png" -dest_files=["res://.godot/imported/starting_pistol_tex_sp_albedo.png-8161f1ff7d1a76474d978c2a86f54261.s3tc.ctex"] +source_file="res://models/weapons/starting_pistol_tex_sp_albedo.png" +dest_files=["res://.godot/imported/starting_pistol_tex_sp_albedo.png-b67d5560b2f5fdc20868def544d0d36d.s3tc.ctex"] [params] diff --git a/models/starting_pistol_tex_sp_roughness.png b/models/weapons/starting_pistol_tex_sp_roughness.png similarity index 100% rename from models/starting_pistol_tex_sp_roughness.png rename to models/weapons/starting_pistol_tex_sp_roughness.png diff --git a/models/starting_pistol_tex_sp_roughness.png.import b/models/weapons/starting_pistol_tex_sp_roughness.png.import similarity index 82% rename from models/starting_pistol_tex_sp_roughness.png.import rename to models/weapons/starting_pistol_tex_sp_roughness.png.import index 11b9ef2..56240f7 100644 --- a/models/starting_pistol_tex_sp_roughness.png.import +++ b/models/weapons/starting_pistol_tex_sp_roughness.png.import @@ -2,8 +2,8 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bb302fhk1eu05" -path.s3tc="res://.godot/imported/starting_pistol_tex_sp_roughness.png-2f38dacd3f9e1e69ced706fb91133b7c.s3tc.ctex" +uid="uid://u5ofn7whunh" +path.s3tc="res://.godot/imported/starting_pistol_tex_sp_roughness.png-5f5db40d7fa74c333919ab39658cbad8.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -14,8 +14,8 @@ generator_parameters={ [deps] -source_file="res://models/starting_pistol_tex_sp_roughness.png" -dest_files=["res://.godot/imported/starting_pistol_tex_sp_roughness.png-2f38dacd3f9e1e69ced706fb91133b7c.s3tc.ctex"] +source_file="res://models/weapons/starting_pistol_tex_sp_roughness.png" +dest_files=["res://.godot/imported/starting_pistol_tex_sp_roughness.png-5f5db40d7fa74c333919ab39658cbad8.s3tc.ctex"] [params] diff --git a/scenes/molikman.tscn b/scenes/molikman.tscn index 28a817c..e076db9 100644 --- a/scenes/molikman.tscn +++ b/scenes/molikman.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"] [ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"] [ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scripts/player/player_camera.gd" id="3_qhqgy"] -[ext_resource type="PackedScene" uid="uid://c3hg4ux4j76j2" path="res://models/molikman_hands.glb" id="4_dqkch"] +[ext_resource type="PackedScene" uid="uid://c3hg4ux4j76j2" path="res://models/characters/viewmodels/molikman_hands.glb" id="4_dqkch"] [ext_resource type="Script" uid="uid://6c14qse4vnra" path="res://scripts/player/player_raycast.gd" id="4_fjrip"] [ext_resource type="Script" uid="uid://bmecgup3kcua7" path="res://scripts/weapon_system/weapon_system.gd" id="4_qlg0r"] [ext_resource type="Script" uid="uid://dd5mp72dq43v6" path="res://scripts/multiplayer/own_visibility_toggle.gd" id="4_smehm"] @@ -11,7 +11,7 @@ [ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"] [ext_resource type="Script" uid="uid://7gmgcaxfh8sb" path="res://scripts/debug/property_shower.gd" id="7_oprun"] [ext_resource type="Script" uid="uid://3777rkbebgjm" path="res://scripts/state_machine/machine.gd" id="8_f1ej7"] -[ext_resource type="PackedScene" uid="uid://c2r8dbudbs7l3" path="res://models/molikman_ingame.glb" id="8_smehm"] +[ext_resource type="PackedScene" uid="uid://c2r8dbudbs7l3" path="res://models/characters/worldmodels/molikman_ingame.glb" id="8_smehm"] [ext_resource type="Script" uid="uid://bv8sgx78s8hwn" path="res://scripts/player/states/crouching.gd" id="9_oprun"] [ext_resource type="Script" uid="uid://u0e2b2mvij1k" path="res://scripts/player/states/standing.gd" id="10_a8ls1"] [ext_resource type="Script" uid="uid://cwasvwhm5yg0o" path="res://scripts/player/states/walk.gd" id="11_qfm1y"] @@ -125,10 +125,14 @@ _data = { &"crouch": SubResource("Animation_oprun") } -[node name="Player" type="CharacterBody3D"] +[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_models")] collision_layer = 2 collision_mask = 3 script = ExtResource("1_g2els") +weapon_models = { +&"bomb": NodePath("Camera3D/molikman_hands/Armature"), +&"sp": NodePath("Camera3D/molikman_hands/GunArm") +} [node name="molikman_ingame" parent="." instance=ExtResource("8_smehm")] transform = Transform3D(0.75, 0, 0, 0, 0.75, 0, 0, 0, 0.75, 0, 1.1793717, 0) @@ -248,21 +252,20 @@ script = ExtResource("12_fulsm") player = NodePath("../..") SPEED = 5.0 -[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "default_knife", "animation_player", "camera")] +[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "default_knife", "animation_player", "camera", "player")] script = ExtResource("4_qlg0r") default_pistol = NodePath("StartingPistol") default_knife = NodePath("Bomb") animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer") camera = NodePath("../Camera3D") +player = NodePath("..") -[node name="StartingPistol" parent="WeaponSystem" node_paths=PackedStringArray("visibility_mesh") instance=ExtResource("7_fjrip")] -visibility_mesh = NodePath("../../Camera3D/molikman_hands/GunArm") +[node name="StartingPistol" parent="WeaponSystem" instance=ExtResource("7_fjrip")] [node name="Shoot" parent="WeaponSystem/StartingPistol" index="1" node_paths=PackedStringArray("raycast")] raycast = NodePath("../../../Camera3D/RayCast3D") -[node name="Bomb" parent="WeaponSystem" node_paths=PackedStringArray("visibility_mesh") instance=ExtResource("17_fjvrb")] -visibility_mesh = NodePath("../../Camera3D/molikman_hands/Armature") +[node name="Bomb" parent="WeaponSystem" instance=ExtResource("17_fjvrb")] [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { diff --git a/scenes/weapons/active_bomb.tscn b/scenes/weapons/active_bomb.tscn new file mode 100644 index 0000000..b10a616 --- /dev/null +++ b/scenes/weapons/active_bomb.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=3 uid="uid://dtbpyfdawb02b"] + +[ext_resource type="PackedScene" uid="uid://dftij0fdq3lbr" path="res://models/weapons/Bomb.glb" id="1_yh58y"] + +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_yh58y"] +properties/0/path = NodePath(".:position") +properties/0/spawn = true +properties/0/replication_mode = 2 + +[node name="ActiveBomb" type="Node3D"] + +[node name="Bomb" parent="." instance=ExtResource("1_yh58y")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1307683, 0) + +[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] +replication_config = SubResource("SceneReplicationConfig_yh58y") diff --git a/scenes/weapons/bomb.tscn b/scenes/weapons/bomb.tscn index a4e2776..f828c8f 100644 --- a/scenes/weapons/bomb.tscn +++ b/scenes/weapons/bomb.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=3 format=3 uid="uid://bxdatd1ilfgmc"] +[gd_scene load_steps=4 format=3 uid="uid://bxdatd1ilfgmc"] [ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_krsgt"] +[ext_resource type="PackedScene" uid="uid://dftij0fdq3lbr" path="res://models/weapons/Bomb.glb" id="2_1x0so"] [ext_resource type="Script" uid="uid://rx78vdadldm7" path="res://scripts/weapon_system/bomb/bomb_state.gd" id="2_870cc"] [node name="Bomb" type="Node" node_paths=PackedStringArray("enter_state")] script = ExtResource("1_krsgt") animation_prefix = &"baked_bomb_" +model = ExtResource("2_1x0so") +visibility_target = &"bomb" max_ammo = 1 can_be_previous = false enter_state = NodePath("Main") diff --git a/scenes/weapons/starting_pistol.tscn b/scenes/weapons/starting_pistol.tscn index e3c1de9..2b61eef 100644 --- a/scenes/weapons/starting_pistol.tscn +++ b/scenes/weapons/starting_pistol.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=8 format=3 uid="uid://djwjl8xll53vn"] +[gd_scene load_steps=9 format=3 uid="uid://djwjl8xll53vn"] [ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_g7s1i"] +[ext_resource type="PackedScene" uid="uid://d3sjs6efbshpk" path="res://models/weapons/starting_pistol.glb" id="2_016ti"] [ext_resource type="Script" uid="uid://ofv4e3dsfe8" path="res://scripts/weapon_system/gun/idle_state.gd" id="2_cmn6f"] [ext_resource type="Script" uid="uid://vj13r83l3xyq" path="res://scripts/weapon_system/gun/semi_auto_shoot_state.gd" id="3_016ti"] [ext_resource type="Script" uid="uid://hmekwp8444ao" path="res://scripts/weapon_system/gun/reload_state.gd" id="4_hoqxt"] @@ -21,6 +22,8 @@ point_count = 5 [node name="StartingPistol" type="Node" node_paths=PackedStringArray("enter_state")] script = ExtResource("1_g7s1i") animation_prefix = &"baked_sp_" +model = ExtResource("2_016ti") +visibility_target = &"sp" max_ammo = 20 enter_state = NodePath("Intro") metadata/_custom_type_script = "uid://e6lqknfl4ngt" diff --git a/scripts/multiplayer/dynamic_objects_container.gd b/scripts/multiplayer/dynamic_objects_container.gd new file mode 100644 index 0000000..d5593dc --- /dev/null +++ b/scripts/multiplayer/dynamic_objects_container.gd @@ -0,0 +1,5 @@ +extends Node3D + + +func _ready() -> void: + Session.dynamic_objects_container = self diff --git a/scripts/multiplayer/dynamic_objects_container.gd.uid b/scripts/multiplayer/dynamic_objects_container.gd.uid new file mode 100644 index 0000000..0dbc95a --- /dev/null +++ b/scripts/multiplayer/dynamic_objects_container.gd.uid @@ -0,0 +1 @@ +uid://be7l33prlm8gh diff --git a/scripts/multiplayer/session.gd b/scripts/multiplayer/session.gd index 728983a..e12aad1 100644 --- a/scripts/multiplayer/session.gd +++ b/scripts/multiplayer/session.gd @@ -5,3 +5,5 @@ enum TEAMS { ATTACK, SPECTATE } + +var dynamic_objects_container: Node3D diff --git a/scripts/multiplayer/team_spawner.gd b/scripts/multiplayer/team_spawner.gd index 7d03628..64457b8 100644 --- a/scripts/multiplayer/team_spawner.gd +++ b/scripts/multiplayer/team_spawner.gd @@ -31,7 +31,7 @@ func spawn_spectator(id: int) -> void: deferred_setup.bind(inst,Session.TEAMS.SPECTATE).call_deferred() func deferred_setup(what: Node3D, new_team: Session.TEAMS): - get_tree().current_scene.add_child(what) + get_parent().add_child(what) var distance = randf_range(0,spawn_radius) var angle = randf_range(0,TAU) var new_position = global_position + Vector3.RIGHT.rotated(Vector3.UP,angle) * distance diff --git a/scripts/player/player.gd b/scripts/player/player.gd index 7b02e33..7ab1867 100644 --- a/scripts/player/player.gd +++ b/scripts/player/player.gd @@ -3,6 +3,7 @@ extends CharacterBody3D class_name Player @export var team: Session.TEAMS +@export var weapon_models: Dictionary[StringName,Node3D] signal spawned diff --git a/scripts/weapon_system/bomb/bomb_state.gd b/scripts/weapon_system/bomb/bomb_state.gd index 9baf008..52fe578 100644 --- a/scripts/weapon_system/bomb/bomb_state.gd +++ b/scripts/weapon_system/bomb/bomb_state.gd @@ -1,5 +1,6 @@ extends WeaponState +const active_bomb: PackedScene = preload("res://scenes/weapons/active_bomb.tscn") func enter(): machine.animation_player.play(machine.animation_prefix+"plant") @@ -10,8 +11,13 @@ func exit(): func on_animation_finished(animation: StringName): if animation == machine.animation_prefix + "plant": + var bomb = active_bomb.instantiate() + Session.dynamic_objects_container.add_child(bomb,true) + bomb.global_position = machine.player_camera.get_parent().global_position + return_to_previous.emit() func state_input(event: InputEvent) -> void: if event.is_action_released("plr_bomb"): + return_to_previous.emit() diff --git a/scripts/weapon_system/weapon_substate_machine.gd b/scripts/weapon_system/weapon_substate_machine.gd index c1d67ee..e9f4cd4 100644 --- a/scripts/weapon_system/weapon_substate_machine.gd +++ b/scripts/weapon_system/weapon_substate_machine.gd @@ -3,10 +3,12 @@ extends SubStateMachine class_name WeaponSubStateMachine @export var animation_prefix: StringName -@export var visibility_mesh: Node3D +@export var model: PackedScene +@export var visibility_target: StringName @export var max_ammo: int @onready var ammo: int = max_ammo +@onready var remaining_ammo: int = max_ammo * 3 @export var can_be_previous: bool = true @@ -15,6 +17,7 @@ signal request_return var system: WeaponSystem var animation_player: AnimationPlayer var player_camera: PlayerCamera +var player: Player func _ready() -> void: for child in get_children(): @@ -26,11 +29,11 @@ func _ready() -> void: func enter() -> void: super() - visibility_mesh.visible = true + player.weapon_models[visibility_target].show() func exit() -> void: super() - visibility_mesh.visible = false + player.weapon_models[visibility_target].hide() @rpc("authority","call_local","reliable") func use_begin() -> void: diff --git a/scripts/weapon_system/weapon_system.gd b/scripts/weapon_system/weapon_system.gd index 135f94d..45eef7d 100644 --- a/scripts/weapon_system/weapon_system.gd +++ b/scripts/weapon_system/weapon_system.gd @@ -7,14 +7,15 @@ class_name WeaponSystem @export var animation_player: AnimationPlayer @export var camera: PlayerCamera +@export var player: Player var current_state: WeaponSubStateMachine var last_slot: StringName var slots: Dictionary[StringName,WeaponSubStateMachine] = { "primary": null, - "secondary": default_pistol, - "knife": default_knife, + "secondary": null, + "knife": null, "bomb": null, "ability_first": null, "ability_second": null, @@ -25,34 +26,31 @@ var slots: Dictionary[StringName,WeaponSubStateMachine] = { signal switched_to(state: WeaponSubStateMachine) func _ready() -> void: - for child in get_children(): - if child is WeaponSubStateMachine: - child.system = self - child.animation_player = animation_player - child.player_camera = camera - child.request_return.connect(return_to_previous) - else: - push_warning("Child of weapon system is not ability or weapon") - current_state = default_pistol - slots["knife"] = default_knife - slots["secondary"] = default_pistol + add(default_knife,"knife") + add(default_pistol,"secondary") current_state.enter() func can_add(slot: StringName) -> bool: - return slots.has(slot) + return slots.has(slot) and slots[slot] == null +@rpc("call_local","reliable") func add(state: WeaponSubStateMachine, slot: StringName) -> void: if can_add(slot) == false: return + print('leech') - add_child(state) + if state.get_parent() == null: + add_child(state) + if state.get_parent() != self: + state.reparent(self) slots[slot] = state state.system = self state.animation_player = animation_player state.player_camera = camera - + state.player = player + state.request_return.connect(return_to_previous) func switch(to: StringName): if slots.has(to) == false or slots[to] == null or slots[to] == current_state: