Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions examples/forest-brawl/scripts/brawler-controller.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ var gravity = ProjectSettings.get_setting(&"physics/3d/default_gravity")
var respawn_tick: int = -1
var respawn_count: int = 0

static func get_color_of(player_id: int) -> Color:
return Color.from_hsv((hash(player_id) % 256) / 256.0, 1.0, 1.0)

func register_hit(from: BrawlerController):
if from == self:
push_error("Player %s (#%s) trying to register hit on themselves!" % [player_name, player_id])
Expand All @@ -46,6 +49,16 @@ func register_hit(from: BrawlerController):
func shove(motion: Vector3):
move_and_collide(motion / mass)

func set_color(color: Color) -> void:
if not is_instance_valid(mesh): return

var material: StandardMaterial3D = mesh.get_active_material(0)
if not is_instance_valid(material): return

material = material.duplicate()
material.albedo_color = color
mesh.set_surface_override_material(0, material)

func _exit_tree():
GameEvents.on_brawler_despawn.emit(self)

Expand All @@ -62,11 +75,7 @@ func _ready():
player_name = "Nameless Brawler #%s" % [player_id]

# Set player color
var color = Color.from_hsv((hash(player_id) % 256) / 256.0, 1.0, 1.0)
var material: StandardMaterial3D = mesh.get_active_material(0)
material = material.duplicate()
material.albedo_color = color
mesh.set_surface_override_material(0, material)
set_color(get_color_of(player_id))

# Specify schema
rollback_synchronizer.set_schema({
Expand Down
83 changes: 33 additions & 50 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
[preset.0]

name="Linux/X11"
platform="Linux"
platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/linux/netfox.x86_64"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.0.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=2
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
Expand All @@ -44,13 +37,12 @@ unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false

[preset.1]

Expand All @@ -63,28 +55,21 @@ export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/windows/netfox.exe"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.1.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=2
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
Expand All @@ -103,9 +88,6 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
application/export_d3d12=0
application/d3d12_agility_sdk_multiarch=true
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
Expand All @@ -123,18 +105,20 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
application/export_angle=0
application/export_d3d12=0
application/d3d12_agility_sdk_multiarch=true
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false

[preset.2]

name="Edgegap Linux Server"
platform="Linux"
platform="Linux/X11"
runnable=false
dedicated_server=true
custom_features=""
Expand All @@ -145,38 +129,37 @@ customized_files={
include_filter=""
exclude_filter=""
export_path="build/edgegap-linux-server.x86_64"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.2.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=2
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
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}\""
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
Loading