Computer Fixing

This commit is contained in:
patrick_pluto 2024-08-02 22:30:30 +02:00
parent 10551189f9
commit 89ccda1523
3 changed files with 25 additions and 10 deletions

View file

@ -1,6 +1,6 @@
[preset.0] [preset.0]
name="Windows Desktop" name="Windows x86_64"
platform="Windows Desktop" platform="Windows Desktop"
runnable=true runnable=true
dedicated_server=false dedicated_server=false
@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../Desktop/64.exe" export_path="../Desktop/Exports/win64/x86_64.exe"
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
encrypt_pck=false encrypt_pck=false
@ -63,7 +63,7 @@ Remove-Item -Recurse -Force '{temp_dir}'"
[preset.1] [preset.1]
name="Windows Desktop 2" name="Windows x86_32"
platform="Windows Desktop" platform="Windows Desktop"
runnable=false runnable=false
dedicated_server=false dedicated_server=false
@ -71,7 +71,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../Desktop/32.exe" export_path="../Desktop/Exports/win32/x86_32.exe"
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
encrypt_pck=false encrypt_pck=false
@ -126,7 +126,7 @@ Remove-Item -Recurse -Force '{temp_dir}'"
[preset.2] [preset.2]
name="Linux/X11" name="Linux/X11 x86_64"
platform="Linux/X11" platform="Linux/X11"
runnable=true runnable=true
dedicated_server=false dedicated_server=false
@ -134,7 +134,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../Desktop/linux.x86_64" export_path="../Desktop/Exports/linux64/linux.x86_64"
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
encrypt_pck=false encrypt_pck=false
@ -166,7 +166,7 @@ rm -rf \"{temp_dir}\""
[preset.3] [preset.3]
name="Linux/X11 2" name="Linux/X11 x86_32"
platform="Linux/X11" platform="Linux/X11"
runnable=false runnable=false
dedicated_server=false dedicated_server=false
@ -174,7 +174,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../Desktop/linux.x86_32" export_path="../Desktop/Exports/linux32/linux.x86_32"
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
encrypt_pck=false encrypt_pck=false

View file

@ -11,7 +11,9 @@ func _ready():
Game.computers += 1 Game.computers += 1
func _on_computer_tick_timeout(): func _on_computer_tick_timeout():
if multiplayer.is_server():
current += (pc_occupied[0] + pc_occupied[1] + pc_occupied[2]) current += (pc_occupied[0] + pc_occupied[1] + pc_occupied[2])
Server.sync_computers.rpc(name, current)
if current >= TARGET: if current >= TARGET:
current = "Complete" current = "Complete"
$computer_tick.stop() $computer_tick.stop()

View file

@ -31,10 +31,17 @@ func create_game():
@rpc("any_peer", "call_remote", "reliable") @rpc("any_peer", "call_remote", "reliable")
func send_playerinfo(name, id): func send_playerinfo(name, id):
if multiplayer.is_server(): if multiplayer.is_server():
var done = 0
players[id] = name players[id] = name
label = get_tree().root.get_node("create/player_list/list") label = get_tree().root.get_node("create/player_list/list")
label.text = ""
for w in players: for w in players:
if done == 1:
label.text = str(label.text +"\n" + players[w]) label.text = str(label.text +"\n" + players[w])
else:
label.text = players[w]
done = 1
@rpc("authority", "call_local", "reliable") @rpc("authority", "call_local", "reliable")
func start_game(server_players): func start_game(server_players):
@ -55,3 +62,9 @@ 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("./"+node_name)
current_character.position = position current_character.position = position
current_character.rotation = rotation current_character.rotation = rotation
@rpc("authority", "call_local", "reliable")
func sync_computers(node_name, current):
var current_character = get_tree().root.get_node("./map/"+node_name)
print(current_character)
current_character.current = current