From 8435fb0cf8382a8d73d50b867aeafbf0ab5dbd36 Mon Sep 17 00:00:00 2001 From: patrick_pluto Date: Sat, 3 Aug 2024 22:24:08 +0200 Subject: [PATCH] Bugfixes --- export_presets.cfg | 112 +++++++++++++++++++++++++++++++++++++------- objects/player.tscn | 6 +-- project.godot | 5 ++ scripts/computer.gd | 3 +- scripts/create.gd | 4 ++ scripts/game.gd | 4 ++ scripts/join.gd | 5 ++ scripts/movement.gd | 7 ++- scripts/server.gd | 30 +++++++----- 9 files changed, 140 insertions(+), 36 deletions(-) diff --git a/export_presets.cfg b/export_presets.cfg index 6b46780..e07bac2 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -8,7 +8,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../Desktop/Exports/win64/x86_64.exe" +export_path="../Desktop/Exports/windows/x86_64.exe" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -22,8 +22,8 @@ debug/export_console_wrapper=1 binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/etc=true +texture_format/etc2=true binary_format/architecture="x86_64" codesign/enable=false codesign/timestamp=true @@ -31,7 +31,7 @@ codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" codesign/custom_options=PackedStringArray() -application/modify_resources=true +application/modify_resources=false application/icon="" application/console_wrapper_icon="" application/icon_interpolation=4 @@ -71,7 +71,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../Desktop/Exports/win32/x86_32.exe" +export_path="../Desktop/Exports/windows/x86_32.exe" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -85,8 +85,8 @@ debug/export_console_wrapper=1 binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/etc=true +texture_format/etc2=true binary_format/architecture="x86_32" codesign/enable=false codesign/timestamp=true @@ -94,7 +94,7 @@ codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" codesign/custom_options=PackedStringArray() -application/modify_resources=true +application/modify_resources=false application/icon="" application/console_wrapper_icon="" application/icon_interpolation=4 @@ -134,7 +134,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../Desktop/Exports/linux64/linux.x86_64" +export_path="../Desktop/Exports/linux/x86_64.x86_64" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -148,8 +148,8 @@ debug/export_console_wrapper=1 binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/etc=true +texture_format/etc2=true binary_format/architecture="x86_64" ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" @@ -174,7 +174,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../Desktop/Exports/linux32/linux.x86_32" +export_path="../Desktop/Exports/linux/x86_32.x86_32" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -188,8 +188,8 @@ debug/export_console_wrapper=1 binary_format/embed_pck=true texture_format/bptc=true texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/etc=true +texture_format/etc2=true binary_format/architecture="x86_32" ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" @@ -206,6 +206,86 @@ rm -rf \"{temp_dir}\"" [preset.4] +name="Linux/X11 arm64" +platform="Linux/X11" +runnable=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Desktop/Exports/linux/arm64.arm64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.4.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=true +texture_format/etc2=true +binary_format/architecture="arm64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.5] + +name="Linux/X11 arm32" +platform="Linux/X11" +runnable=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Desktop/Exports/linux/arm32.arm32" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.5.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=true +texture_format/etc2=true +binary_format/architecture="arm32" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.6] + name="macOS" platform="macOS" runnable=true @@ -214,13 +294,13 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../Desktop/Exports/mac/mac.zip" +export_path="../Desktop/Exports/macos/macos.zip" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false -[preset.4.options] +[preset.6.options] export/distribution_type=1 binary_format/architecture="universal" diff --git a/objects/player.tscn b/objects/player.tscn index 9d22d2a..d04e86a 100644 --- a/objects/player.tscn +++ b/objects/player.tscn @@ -10,8 +10,6 @@ size = Vector3(0.5, 1, 0.75) [node name="player" type="CharacterBody3D"] -collision_layer = 2 -collision_mask = 3 script = ExtResource("1_uru11") [node name="in_bag" type="ColorRect" parent="."] @@ -37,8 +35,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 8) [node name="detect_hit" type="Area3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.25, -1.5) -collision_layer = 2 -collision_mask = 7 [node name="CollisionShape3D" type="CollisionShape3D" parent="detect_hit"] shape = SubResource("BoxShape3D_e4age") @@ -63,7 +59,7 @@ visible = false radius = 0.375 [node name="time_in_bag" type="Timer" parent="."] -wait_time = 10.0 +wait_time = 30.0 one_shot = true [connection signal="body_entered" from="detect_hit" to="." method="_on_detect_hit_body_entered"] diff --git a/project.godot b/project.godot index 239d273..de0a75e 100644 --- a/project.godot +++ b/project.godot @@ -61,6 +61,11 @@ zoom_out={ "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } +escape={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} [layer_names] diff --git a/scripts/computer.gd b/scripts/computer.gd index 4e522db..7dd296a 100644 --- a/scripts/computer.gd +++ b/scripts/computer.gd @@ -11,7 +11,7 @@ extends StaticBody3D const TARGET = 100 var current = 0 -var pc_occupied = [0, 0, 0,] +var pc_occupied = [0, 0, 0] var pc_body = [0, 0, 0] @@ -33,7 +33,6 @@ func _on_computer_tick_timeout(): func _on_pc_1_area_body_entered(body): if pc_occupied[0] == 0: - body.has_method("_input") pc_occupied[0] = 1 pc_body[0] = body diff --git a/scripts/create.gd b/scripts/create.gd index c9b239b..5972555 100644 --- a/scripts/create.gd +++ b/scripts/create.gd @@ -16,3 +16,7 @@ func _ready(): func _on_start_pressed(): Server.send_playerinfo(get_tree().root.get_node("create/player_customization/name").text, multiplayer.get_unique_id()) Server.start_game.rpc(Server.players) + +func _input(event): + if Input.is_action_just_pressed("escape"): + get_tree().change_scene_to_file("res://menus/main_menu.tscn") diff --git a/scripts/game.gd b/scripts/game.gd index 3614a79..0cac952 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -13,5 +13,9 @@ var players = 0 func _process(delta): pass + +func reset(): + computers = 0 + players = 0 diff --git a/scripts/join.gd b/scripts/join.gd index a1fecfa..649205c 100644 --- a/scripts/join.gd +++ b/scripts/join.gd @@ -20,3 +20,8 @@ func _on_join_pressed(): func _on_timer_timeout(): Server.send_playerinfo.rpc($player_customization/name.text, multiplayer.get_unique_id()) + + +func _input(event): + if Input.is_action_just_pressed("escape"): + get_tree().change_scene_to_file("res://menus/main_menu.tscn") diff --git a/scripts/movement.gd b/scripts/movement.gd index 0a8d68b..2ee76a4 100644 --- a/scripts/movement.gd +++ b/scripts/movement.gd @@ -33,12 +33,18 @@ func _ready(): npc = true func _physics_process(delta): + if Input.is_action_just_pressed("escape"): + get_tree().change_scene_to_file("res://menus/main_menu.tscn") + Game.reset() + Server.reset() + if enabled: if not is_on_floor(): velocity.y -= gravity * delta + if Input.is_action_just_pressed("jump") and is_on_floor(): velocity.y = JUMP_VELOCITY @@ -98,7 +104,6 @@ func _on_detect_hit_body_entered(body): func captured(beast): if !npc: $in_bag.visible = true - print(beast) $time_in_bag.start() visible = false enabled = false diff --git a/scripts/server.gd b/scripts/server.gd index 0fc0020..36b2fd9 100644 --- a/scripts/server.gd +++ b/scripts/server.gd @@ -18,6 +18,15 @@ var label var map var character = preload("res://objects/player.tscn") +func reset(): + players = {} + players_numbered = [] + label = null + map = null + character = preload("res://objects/player.tscn") + if multiplayer != null: + multiplayer.multiplayer_peer = null + func join_game(ip): var peer = ENetMultiplayerPeer.new() var error = peer.create_client(ip, PORT) @@ -40,7 +49,6 @@ func send_playerinfo(name, id): players[id] = name label = get_tree().root.get_node("create/player_list/list") label.text = "" - print(players) for w in players: if done == 1: label.text = str(label.text +"\n" + players[w]) @@ -53,8 +61,10 @@ func send_playerinfo(name, id): func start_game(server_players): players = server_players players_numbered = players.keys() - get_tree().change_scene_to_file("res://maps/base_map.tscn") - map = get_tree().root.get_node(".") + var success = get_tree().change_scene_to_file("res://maps/base_map.tscn") + while !get_tree().root.has_node("./map/"): + await get_tree().create_timer(0.001).timeout + map = get_tree().root.get_node("./map/") var i = 0 for w in players: var player = character.instantiate() @@ -68,28 +78,24 @@ func start_game(server_players): @rpc("any_peer", "call_remote", "unreliable") func sync_player(node_name, position, rotation): - var current_character = get_tree().root.get_node("./"+node_name) + var current_character = get_tree().root.get_node("./map/"+node_name) current_character.position = position current_character.rotation = rotation -@rpc("authority", "call_remote", "reliable") +@rpc("authority", "call_local", "reliable") func sync_computers(node_name, current): var current_character = get_tree().root.get_node("./map/"+node_name) current_character.current = current @rpc("authority", "call_local", "reliable") func sync_beast(player): - var current_character = get_tree().root.get_node("./"+"player"+str(player)) + var current_character = get_tree().root.get_node("./map/player"+str(player)) current_character.beast_init() @rpc("any_peer", "call_local", "reliable") func player_hit(target, beast): - target = get_tree().root.get_node("./"+target) - beast = get_tree().root.get_node("./"+beast) - map = get_tree().root.get_node(".") - print(target) - print(beast) - print(map) + target = get_tree().root.get_node("./map/"+target) + beast = get_tree().root.get_node("./map/"+beast) target.captured(beast) beast.got_one(target)