From 6f674df510d3fd35edb98637913364976f91b1ae Mon Sep 17 00:00:00 2001 From: Techwizz Date: Tue, 28 Feb 2023 11:48:41 -0700 Subject: [PATCH] Fixed #1, #8, #9 --- .DS_Store | Bin 8196 -> 8196 bytes characters/teddy/Teddy.gd | 12 ++++++------ export_presets.cfg | 1 - objects/toyland/Wood050_2K_Color.jpg.import | 5 +++-- objects/toyland/newplaster.jpg.import | 5 +++-- ...11479be4ff2e5f_Wood050_2K_Color.png.import | 5 +++-- ...7eef6111479be4ff2e5f_newplaster.png.import | 5 +++-- ...be4ff2e5f_windows_xp_bliss-wide.png.import | 5 +++-- .../toyland/windows_xp_bliss-wide.jpg.import | 5 +++-- .../toyland/woodfloor4k.jpg.001.jpg.import | 5 +++-- project.godot | 4 ++++ scripts/console.gd | 2 +- scripts/global.gd | 2 -- scripts/multiplayer.gd | 9 ++++++--- scripts/networking.gd | 4 ++++ 15 files changed, 42 insertions(+), 27 deletions(-) diff --git a/.DS_Store b/.DS_Store index fdf29a1ca17c4156f83ae44435f2c437a3a3bce8..b365780f1077ef9f4e5c0b549a9798703a3aa67e 100644 GIT binary patch delta 255 zcmZp1XmOa}FD%Z$z`)4BAi%&-;+d15oRpKFw6Sm+`@{zR&Fma39NHjxRt6&m7Y0X$ zB7_>CC{PQ-dZ1>$|6sttFquc-1BbDNg^q%`q4{PO!OhHyYz)N=`3$8Dc?>BG#W3?B zdKrI$^iEzQVxb2V;9w|WNM)!1lBGavQqdJNr6VlbSU8_)GrPn$7FP02n8O4Bk-kNz delta 82 zcmZp1XmOa}FDk;oz`)4BAi%(o$dJrX!jQ^P#8AAka2or>2Hwr=94s7+B9qMoK1@~< kcHf*USi(G+S5%i%0jLQG7#%hiN-=L{m-xoAv4Wi$0RGYv@&Et; diff --git a/characters/teddy/Teddy.gd b/characters/teddy/Teddy.gd index 9d738f7..acfec71 100644 --- a/characters/teddy/Teddy.gd +++ b/characters/teddy/Teddy.gd @@ -13,7 +13,7 @@ var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") @onready var teddyAuthority = get_multiplayer_authority() var selfTeddy var teddyParent - +var menuOpen = false var globalscene func _ready(): @@ -37,16 +37,16 @@ func _unhandled_input(event): neck.rotate_y(-event.relative.x * mousesense) camera.rotate_x(-event.relative.y * mousesense) camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-50), deg_to_rad(60)) - if Global.menuOpen == false: + if menuOpen == false: if Input.is_action_just_pressed("menu"): - Global.menuOpen = true + menuOpen = true var scene_trs = load("res://scenes/mainmenu.tscn") var scene = scene_trs.instantiate() globalscene = scene add_child(scene) - elif Global.menuOpen == true: + elif menuOpen == true: if Input.is_action_just_pressed("menu"): - Global.menuOpen = false + menuOpen = false Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) if globalscene: globalscene.queue_free() @@ -97,7 +97,7 @@ func _physics_process(delta): velocity.x = 0 velocity.z = 0 if Input.is_action_just_pressed("shoot"): - if Global.menuOpen == false: + if menuOpen == false: if Global.multiplayerCurrent == true: rpc("shoot_bullet") shoot_bullet() diff --git a/export_presets.cfg b/export_presets.cfg index 4a4345f..0e54e41 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -127,7 +127,6 @@ texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false -texture_format/no_bptc_fallbacks=true binary_format/architecture="x86_64" ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" diff --git a/objects/toyland/Wood050_2K_Color.jpg.import b/objects/toyland/Wood050_2K_Color.jpg.import index a7b8482..bf420fc 100644 --- a/objects/toyland/Wood050_2K_Color.jpg.import +++ b/objects/toyland/Wood050_2K_Color.jpg.import @@ -3,16 +3,17 @@ importer="texture" type="CompressedTexture2D" uid="uid://dnobq0anmbln8" +path.s3tc="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.s3tc.ctex" path.etc2="res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "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", "res://.godot/imported/Wood050_2K_Color.jpg-e6185de0fa12ff4588e435b3845fb87e.etc2.ctex"] [params] diff --git a/objects/toyland/newplaster.jpg.import b/objects/toyland/newplaster.jpg.import index 3dee182..076e54a 100644 --- a/objects/toyland/newplaster.jpg.import +++ b/objects/toyland/newplaster.jpg.import @@ -3,16 +3,17 @@ importer="texture" type="CompressedTexture2D" uid="uid://cmhq2gjngssxg" +path.s3tc="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.s3tc.ctex" path.etc2="res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "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", "res://.godot/imported/newplaster.jpg-c0159d01e1a6adffe0c3bf5b8dcfc7a7.etc2.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..edeadcd 100644 --- a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import +++ b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png.import @@ -3,9 +3,10 @@ importer="texture" type="CompressedTexture2D" uid="uid://c4brgjvonnjkr" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } generator_parameters={} @@ -13,7 +14,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", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_Wood050_2K_Color.png-09e60c6431251b5cdad5e7603ca8ef91.etc2.ctex"] [params] diff --git a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import index 452b403..335bdad 100644 --- a/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import +++ b/objects/toyland/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png.import @@ -3,9 +3,10 @@ importer="texture" type="CompressedTexture2D" uid="uid://ql40b60xucke" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } generator_parameters={} @@ -13,7 +14,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", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_newplaster.png-56bf5185a878e2d32e5a25ec8c8517fb.etc2.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..9e4436b 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,10 @@ importer="texture" type="CompressedTexture2D" uid="uid://cj28kq4i36gcg" +path.s3tc="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.s3tc.ctex" path.etc2="res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } generator_parameters={} @@ -13,7 +14,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", "res://.godot/imported/toyland-acc3ec7302587eef6111479be4ff2e5f_windows_xp_bliss-wide.png-c0ea880c9d43e5d1d8d800dd069f83dd.etc2.ctex"] [params] diff --git a/objects/toyland/windows_xp_bliss-wide.jpg.import b/objects/toyland/windows_xp_bliss-wide.jpg.import index b359361..8ddd13d 100644 --- a/objects/toyland/windows_xp_bliss-wide.jpg.import +++ b/objects/toyland/windows_xp_bliss-wide.jpg.import @@ -3,16 +3,17 @@ importer="texture" type="CompressedTexture2D" uid="uid://co6sxyhce6s7" +path.s3tc="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.s3tc.ctex" path.etc2="res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "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", "res://.godot/imported/windows_xp_bliss-wide.jpg-b027b98d80d6be8ceaca628f4dcf54ce.etc2.ctex"] [params] diff --git a/objects/toyland/woodfloor4k.jpg.001.jpg.import b/objects/toyland/woodfloor4k.jpg.001.jpg.import index 93c5c54..f764ed7 100644 --- a/objects/toyland/woodfloor4k.jpg.001.jpg.import +++ b/objects/toyland/woodfloor4k.jpg.001.jpg.import @@ -3,16 +3,17 @@ importer="texture" type="CompressedTexture2D" uid="uid://b6f2baaxv23qx" +path.s3tc="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.s3tc.ctex" path.etc2="res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex" metadata={ -"imported_formats": ["etc2_astc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "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", "res://.godot/imported/woodfloor4k.jpg.001.jpg-e2bdf4950350ecebed41e5db675a15f9.etc2.ctex"] [params] diff --git a/project.godot b/project.godot index 80f5e74..ea6c431 100644 --- a/project.godot +++ b/project.godot @@ -74,3 +74,7 @@ console_send={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null) ] } + +[rendering] + +textures/vram_compression/import_s3tc_bptc=true diff --git a/scripts/console.gd b/scripts/console.gd index 79bd172..ee963fd 100644 --- a/scripts/console.gd +++ b/scripts/console.gd @@ -12,7 +12,7 @@ func _process(delta): self.queue_free() if Input.is_action_just_pressed("console_send"): Global.consoleCommand = $consoleEdit.text - print (Global.consoleCommand) + print ("Console command run: ", Global.consoleCommand) run_command(Global.consoleCommand) func run_command(command): diff --git a/scripts/global.gd b/scripts/global.gd index 331942a..c5fdaac 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -1,8 +1,6 @@ extends Node - var mouseSensitivity = 0.01 # Unless otherwise changed by user in settings var playingGame = false # Should be true while in a map, set by menus -var menuOpen = false # Whether or not the in-game menu is active var fatigue = 100 # Makes it so you can't run forever, you have limited energy var playerHealth = 100 # If zero, the player dies. Bullets cause damage var playerDead = false # Defined by Global.player_dead() diff --git a/scripts/multiplayer.gd b/scripts/multiplayer.gd index 4cb60c3..8c4ee90 100644 --- a/scripts/multiplayer.gd +++ b/scripts/multiplayer.gd @@ -22,6 +22,7 @@ func _on_host_button_pressed(): func _on_join_button_pressed(): + peer.close() var IPADD var PORT var intPORT @@ -41,13 +42,15 @@ func _on_join_button_pressed(): $errorLabel.text = resultString prints("Creating client result:", result) if result != OK: - printerr("Did NOT connect to server") - $errorLabel.text = "Did NOT connect to server" + printerr("Failed to create client object, please report to Paul/Techwizz") + $errorLabel.text = "Failed to create client object, please report to Paul/Techwizz" if result == OK: print("Connecting to server at IP ", IPADD, ":", intPORT, "...") $errorLabel.text = "Connecting to server..." multiplayer.multiplayer_peer = peer - + await get_tree().create_timer(5).timeout + printerr("FAILED TO CONNECT, CHECK INFO THEN TRY AGAIN") + $errorLabel.text = "FAILED TO CONNECT, CHECK INFO THEN TRY AGAIN" diff --git a/scripts/networking.gd b/scripts/networking.gd index 1bec0d4..5040740 100644 --- a/scripts/networking.gd +++ b/scripts/networking.gd @@ -25,6 +25,7 @@ func create_server(port, maxPlayers): add_player_node(new_peer_id) ) + func load_map(map): Global.multiplayerCurrent = true get_tree().change_scene_to_file(map) @@ -52,3 +53,6 @@ func add_previously_connected_player_characters(peer_ids): for peer_id in peer_ids: add_player_node(peer_id) +@rpc +func disconnect_peer(peer_id): + peer_id.queue_free()