From 028037cdc494dd40a7b23a17066e3809762ed2ff Mon Sep 17 00:00:00 2001 From: Techwizz Date: Sat, 25 Feb 2023 14:31:15 -0700 Subject: [PATCH] Fixed issue #2 --- characters/teddy/Teddy.gd | 1 + objects/toyland/Wood050_2K_Color.jpg.import | 6 +++--- objects/toyland/newplaster.jpg.import | 6 +++--- ...ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import | 6 +++--- ...d-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import | 6 +++--- ...2587eef6111479be4ff2e5f_windows_xp_bliss-wide.png.import | 6 +++--- objects/toyland/windows_xp_bliss-wide.jpg.import | 6 +++--- objects/toyland/woodfloor4k.jpg.001.jpg.import | 6 +++--- scripts/global.gd | 1 + scripts/networking.gd | 6 ++++-- 10 files changed, 27 insertions(+), 23 deletions(-) diff --git a/characters/teddy/Teddy.gd b/characters/teddy/Teddy.gd index 157939c..cc1c0e6 100644 --- a/characters/teddy/Teddy.gd +++ b/characters/teddy/Teddy.gd @@ -22,6 +22,7 @@ func _ready(): Global.selfTeddy = selfTeddy selfTeddy = self.get_path() teddyParent = get_node(selfTeddy).get_parent() + Global.teddyAuthorityID = teddyAuthority func _unhandled_input(event): Global.selfTeddy = selfTeddy diff --git a/objects/toyland/Wood050_2K_Color.jpg.import b/objects/toyland/Wood050_2K_Color.jpg.import index a7b8482..15a51b8 100644 --- a/objects/toyland/Wood050_2K_Color.jpg.import +++ b/objects/toyland/Wood050_2K_Color.jpg.import @@ -3,16 +3,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dnobq0anmbln8" -path.etc2="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex" +path.s3tc="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } [deps] source_file="res://objects/toyland/Wood050_2K_Color.jpg" -dest_files=["res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex"] +dest_files=["res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.s3tc.ctex"] [params] diff --git a/objects/toyland/newplaster.jpg.import b/objects/toyland/newplaster.jpg.import index 3dee182..f3c11ff 100644 --- a/objects/toyland/newplaster.jpg.import +++ b/objects/toyland/newplaster.jpg.import @@ -3,16 +3,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://cmhq2gjngssxg" -path.etc2="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex" +path.s3tc="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } [deps] source_file="res://objects/toyland/newplaster.jpg" -dest_files=["res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex"] +dest_files=["res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex"] [params] diff --git a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import index c6c32b0..20523ea 100644 --- a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import +++ b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import @@ -3,9 +3,9 @@ importer="texture" type="CompressedTexture2D" uid="uid://c4brgjvonnjkr" -path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } generator_parameters={} @@ -13,7 +13,7 @@ generator_parameters={} [deps] source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png" -dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex"] +dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.s3tc.ctex"] [params] diff --git a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import index 452b403..815903a 100644 --- a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import +++ b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import @@ -3,9 +3,9 @@ importer="texture" type="CompressedTexture2D" uid="uid://ql40b60xucke" -path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } generator_parameters={} @@ -13,7 +13,7 @@ generator_parameters={} [deps] source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png" -dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex"] +dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.s3tc.ctex"] [params] diff --git a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png.import b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png.import index e0cad85..48aa335 100644 --- a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png.import +++ b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png.import @@ -3,9 +3,9 @@ importer="texture" type="CompressedTexture2D" uid="uid://cj28kq4i36gcg" -path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } generator_parameters={} @@ -13,7 +13,7 @@ generator_parameters={} [deps] source_file="res://objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png" -dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex"] +dest_files=["res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.s3tc.ctex"] [params] diff --git a/objects/toyland/windows_xp_bliss-wide.jpg.import b/objects/toyland/windows_xp_bliss-wide.jpg.import index b359361..7487fe2 100644 --- a/objects/toyland/windows_xp_bliss-wide.jpg.import +++ b/objects/toyland/windows_xp_bliss-wide.jpg.import @@ -3,16 +3,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://co6sxyhce6s7" -path.etc2="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex" +path.s3tc="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } [deps] source_file="res://objects/toyland/windows_xp_bliss-wide.jpg" -dest_files=["res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex"] +dest_files=["res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.s3tc.ctex"] [params] diff --git a/objects/toyland/woodfloor4k.jpg.001.jpg.import b/objects/toyland/woodfloor4k.jpg.001.jpg.import index 93c5c54..abdef6e 100644 --- a/objects/toyland/woodfloor4k.jpg.001.jpg.import +++ b/objects/toyland/woodfloor4k.jpg.001.jpg.import @@ -3,16 +3,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://b6f2baaxv23qx" -path.etc2="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex" +path.s3tc="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.s3tc.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc"], "vram_texture": true } [deps] source_file="res://objects/toyland/woodfloor4k.jpg.001.jpg" -dest_files=["res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex"] +dest_files=["res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.s3tc.ctex"] [params] diff --git a/scripts/global.gd b/scripts/global.gd index 9ded706..331942a 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -19,6 +19,7 @@ var godMode = false # Defined by console.gd var selfTeddy # Defined as soon as the player script is initalized var multiplayerCurrent = false # Whether the player is using multiplayer var currentMapNode # Defined in map scripts +var teddyAuthorityID # Defined from teddy.gd after object is initalized func _process(delta): if godMode: diff --git a/scripts/networking.gd b/scripts/networking.gd index a77e71c..020b9d6 100644 --- a/scripts/networking.gd +++ b/scripts/networking.gd @@ -32,12 +32,14 @@ func load_map(map): @rpc func add_newly_connected_player_character(new_peer_id): print("Connected to server!") - load_map(SCENE) - Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) + if Global.teddyAuthorityID == null: + load_map(SCENE) + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) add_player_node(new_peer_id) func add_player_node(peer_id): + print("Global teddy Authority: ", Global.teddyAuthorityID) connected_peers.append(peer_id) var player_character = preload("res://scenes/Teddy.tscn").instantiate() player_character.set_multiplayer_authority(peer_id)