Compare commits
18 Commits
d2ed1afdc7
...
2023.01.01
| Author | SHA1 | Date | |
|---|---|---|---|
| ce7b74c832 | |||
| 9893bc45b4 | |||
| 1ef5d54d6c | |||
| 5cfc0839f7 | |||
| 2e4c378991 | |||
| 40d73f2590 | |||
| a7118b3d77 | |||
| b2b82271f7 | |||
| b5286a5f54 | |||
| 4c8499f4f0 | |||
| 5a891a5636 | |||
| 701bcfd39c | |||
| 4de8162f48 | |||
| face5c4527 | |||
| 2c2641c1d3 | |||
| 54a90ab22c | |||
| d808ef5a53 | |||
| 56255f5473 |
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bk3khvviorvmm"
|
||||
path="res://.godot/imported/untitled.png-d7b497081dc8ae225dae2b6ac59973dc.ctex"
|
||||
uid="uid://bpsjhyhlis3ov"
|
||||
path="res://.godot/imported/.exr-a7725c7e971a9679cf60303f5fa7defa.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/Bullet/untitled.png"
|
||||
dest_files=["res://.godot/imported/untitled.png-d7b497081dc8ae225dae2b6ac59973dc.ctex"]
|
||||
source_file="res://.exr"
|
||||
dest_files=["res://.godot/imported/.exr-a7725c7e971a9679cf60303f5fa7defa.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "scoom"]
|
||||
path = scoom
|
||||
url = ssh://git@git.peroxy.dev:222/kookroach/Scoom-Data.git
|
||||
@@ -1,28 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="2d_array_texture"
|
||||
type="CompressedTexture2DArray"
|
||||
uid="uid://djhovwrdokme0"
|
||||
path.etc2="res://.godot/imported/Game.exr-72bd638e1628ca77f007b851e1ccfc0d.etc2.ctexarray"
|
||||
path.s3tc="res://.godot/imported/Game.exr-72bd638e1628ca77f007b851e1ccfc0d.s3tc.ctexarray"
|
||||
metadata={
|
||||
"imported_formats": ["etc2", "s3tc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Game.exr"
|
||||
dest_files=["res://.godot/imported/Game.exr-72bd638e1628ca77f007b851e1ccfc0d.etc2.ctexarray", "res://.godot/imported/Game.exr-72bd638e1628ca77f007b851e1ccfc0d.s3tc.ctexarray"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/channel_pack=1
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
slices/horizontal=1
|
||||
slices/vertical=1
|
||||
33
Game.gd
@@ -1,20 +1,32 @@
|
||||
extends Node3D
|
||||
class_name Game
|
||||
|
||||
signal game_loaded
|
||||
|
||||
@onready var label : Label = $CanvasLayer/Label
|
||||
@onready var player : CharacterBody3D = $PlayerQ3
|
||||
|
||||
var init_config
|
||||
var weapon_config
|
||||
|
||||
func _ready():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
label.text = "H Velocity: %3.2f" % [Vector2(player.velocity.x, player.velocity.z).length()]
|
||||
label.text += "\nV Velocity: %3.2f" % [player.velocity.y]
|
||||
label.text += "\nOn floor: %s" % player.is_on_floor()
|
||||
weapon_config = Runtimeloader.loadConfig("weapons.cfg") as ConfigFile
|
||||
init_config = Runtimeloader.loadConfig("init.cfg") as ConfigFile
|
||||
|
||||
print("Loading PCK...")
|
||||
for map_list in init_config.get_section_keys("MAPS"):
|
||||
for map in init_config.get_value("MAPS", map_list):
|
||||
Runtimeloader.loadPCK(map)
|
||||
|
||||
for weapons_list in init_config.get_section_keys("WEAPONS"):
|
||||
for weapon in init_config.get_value("WEAPONS", weapons_list):
|
||||
Runtimeloader.loadPCK(weapon)
|
||||
|
||||
print("Loading Resources Done.")
|
||||
|
||||
func load_map():
|
||||
Runtimeloader.loadScene("maps/test_map.tscn", self)
|
||||
#Runtimeloader.get_all_entities(node)
|
||||
game_loaded.emit()
|
||||
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if event.keycode == KEY_F:
|
||||
@@ -24,3 +36,4 @@ func _input(event):
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
||||
elif event.keycode == KEY_ESCAPE:
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
BIN
Game.lmbake
@@ -3,4 +3,4 @@ Developing a 3D game inspired by Doom64 on Godot 4 engine.
|
||||
|
||||
Using:
|
||||
- [Simple-Q3-Controller](https://github.com/fossegutten/Simple-Q3-Controller) by fossegutten
|
||||
- [CrosshairShader](https://github.com/0xspig/CrosshairShader) by 0xspig
|
||||
- [CrosshairShader](https://github.com/0xspig/CrosshairShader) by 0xspig
|
||||
@@ -1,20 +0,0 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
add_custom_type(
|
||||
"SfxrStreamPlayer", "AudioStreamPlayer", load("res://addons/godot_sfxr/SfxrStreamPlayer.gd"),
|
||||
get_editor_interface().get_base_control().get_theme_icon("AudioStreamPlayer", "EditorIcons"))
|
||||
add_custom_type(
|
||||
"SfxrStreamPlayer2D", "AudioStreamPlayer2D", load("res://addons/godot_sfxr/SfxrStreamPlayer2D.gd"),
|
||||
get_editor_interface().get_base_control().get_theme_icon("AudioStreamPlayer2D", "EditorIcons"))
|
||||
add_custom_type(
|
||||
"SfxrStreamPlayer3D", "AudioStreamPlayer3D", load("res://addons/godot_sfxr/SfxrStreamPlayer3D.gd"),
|
||||
get_editor_interface().get_base_control().get_theme_icon("AudioStreamPlayer3D", "EditorIcons"))
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
remove_custom_type("SfxrStreamPlayer")
|
||||
remove_custom_type("SfxrStreamPlayer2D")
|
||||
remove_custom_type("SfxrStreamPlayer3D")
|
||||
@@ -1,309 +0,0 @@
|
||||
extends RefCounted
|
||||
class_name SfxrGenerator
|
||||
|
||||
|
||||
var params
|
||||
|
||||
var wave_shape: int
|
||||
|
||||
var repeat_time: float
|
||||
var elapsed_since_repeat: float
|
||||
|
||||
var arpeggio_time: int
|
||||
var arpeggio_multiplier: float
|
||||
|
||||
var period: float
|
||||
var period_mult: float
|
||||
var period_mult_slide: float
|
||||
var period_max: float
|
||||
|
||||
var enable_frequency_cutoff: bool
|
||||
|
||||
var duty_cycle: float
|
||||
var duty_cycle_slide: float
|
||||
|
||||
var fltw: float
|
||||
var fltw_d: float
|
||||
var fltdmp: float
|
||||
var flthp: float
|
||||
var flthp_d: float
|
||||
var enable_low_pass_filter: bool
|
||||
|
||||
var vibrato_speed: float
|
||||
var vibrato_amplitude: float
|
||||
|
||||
var envelope_length: Array
|
||||
var envelope_punch: float
|
||||
|
||||
var flanger_offset: float
|
||||
var flanger_offset_slide: float
|
||||
|
||||
var gain: float
|
||||
var sample_rate: float
|
||||
|
||||
|
||||
func init_params(stream_player) -> void:
|
||||
params = stream_player
|
||||
|
||||
prepare_values()
|
||||
|
||||
# Wave shape
|
||||
wave_shape = params.wave_type
|
||||
|
||||
# Filter
|
||||
fltw = pow(params.p_lpf_freq, 3.0) * 0.1
|
||||
enable_low_pass_filter = params.p_lpf_freq != 1.0
|
||||
fltw_d = 1.0 + params.p_lpf_ramp * 0.0001
|
||||
fltdmp = 5.0 / (1.0 + pow(params.p_lpf_resonance, 2.0) * 20.0) * (0.01 + fltw)
|
||||
if (fltdmp > 0.8):
|
||||
fltdmp = 0.8
|
||||
flthp = pow(params.p_hpf_freq, 2.0) * 0.1
|
||||
flthp_d = 1 + params.p_hpf_ramp * 0.0003
|
||||
|
||||
# Vibrato
|
||||
vibrato_speed = pow(params.p_vib_speed, 2.0) * 0.01
|
||||
vibrato_amplitude = params.p_vib_strength * 0.5
|
||||
|
||||
# Envelope
|
||||
envelope_length = [
|
||||
floor(params.p_env_attack * params.p_env_attack * 100000.0),
|
||||
floor(params.p_env_sustain * params.p_env_sustain * 100000.0),
|
||||
floor(params.p_env_decay * params.p_env_decay * 100000.0),
|
||||
]
|
||||
envelope_punch = params.p_env_punch
|
||||
|
||||
# Flanger
|
||||
flanger_offset = pow(params.p_pha_offset, 2.0) * 1020.0
|
||||
if (params.p_pha_offset < 0.0):
|
||||
flanger_offset = -flanger_offset
|
||||
flanger_offset_slide = pow(params.p_pha_ramp, 2.0) * 1.0
|
||||
if (params.p_pha_ramp < 0.0):
|
||||
flanger_offset_slide = -flanger_offset_slide
|
||||
|
||||
# Repeat
|
||||
repeat_time = floor(pow(1 - params.p_repeat_speed, 2.0) * 20000.0 + 32.0)
|
||||
if (params.p_repeat_speed == 0.0):
|
||||
repeat_time = 0.0
|
||||
|
||||
gain = exp(params.sound_vol) - 1.0
|
||||
sample_rate = params.sample_rate
|
||||
|
||||
|
||||
func prepare_values() -> void:
|
||||
elapsed_since_repeat = 0.0
|
||||
|
||||
period = 100.0 / (params.p_base_freq * params.p_base_freq + 0.001)
|
||||
period_max = 100.0 / (params.p_freq_limit * params.p_freq_limit + 0.001)
|
||||
enable_frequency_cutoff = params.p_freq_limit > 0.0
|
||||
period_mult = 1.0 - pow(params.p_freq_ramp, 3.0) * 0.01
|
||||
period_mult_slide = -pow(params.p_freq_dramp, 3.0) * 0.000001
|
||||
|
||||
duty_cycle = 0.5 - params.p_duty * 0.5
|
||||
duty_cycle_slide = -params.p_duty_ramp * 0.00005
|
||||
|
||||
if (params.p_arp_mod >= 0.0):
|
||||
arpeggio_multiplier = 1.0 - pow(params.p_arp_mod, 2.0) * 0.9
|
||||
else:
|
||||
arpeggio_multiplier = 1.0 + pow(params.p_arp_mod, 2.0) * 10.0
|
||||
arpeggio_time = floor(pow(1.0 - params.p_arp_speed, 2.0) * 20000.0 + 32.0)
|
||||
if (params.p_arp_speed == 1.0):
|
||||
arpeggio_time = 0
|
||||
|
||||
|
||||
func get_raw_buffer() -> Array:
|
||||
randomize()
|
||||
|
||||
var fltp: float = 0.0
|
||||
var fltdp: float = 0.0
|
||||
var fltphp: float = 0.0
|
||||
|
||||
var noise_buffer_length: int = 32
|
||||
var noise_buffer: Array = []
|
||||
for i in noise_buffer_length:
|
||||
noise_buffer.append(randf() * 2.0 - 1.0)
|
||||
|
||||
var envelope_stage: int = 0
|
||||
var envelope_elapsed: float = 0.0
|
||||
|
||||
var vibrato_phase: float = 0.0
|
||||
|
||||
var phase: int = 0
|
||||
var ipp: int = 0
|
||||
var flanger_buffer_length: int = 1024
|
||||
var flanger_buffer: Array = []
|
||||
for i in flanger_buffer_length:
|
||||
flanger_buffer.append(0.0)
|
||||
|
||||
var _buffer: Array = []
|
||||
|
||||
var sample_sum: float = 0.0
|
||||
var num_summed: float = 0.0
|
||||
var summands: int = floor(44100.0 / sample_rate)
|
||||
|
||||
var t: float = -1.0
|
||||
while t < INF:
|
||||
t += 1
|
||||
|
||||
# Repeats
|
||||
elapsed_since_repeat += 1.0
|
||||
if (repeat_time != 0.0 and elapsed_since_repeat >= repeat_time):
|
||||
prepare_values()
|
||||
|
||||
# Arpeggio (single)
|
||||
if (arpeggio_time != 0 and t >= arpeggio_time):
|
||||
arpeggio_time = 0
|
||||
period *= arpeggio_multiplier
|
||||
|
||||
# Frequency slide, and frequency slide slide!
|
||||
period_mult += period_mult_slide
|
||||
period *= period_mult
|
||||
if (period > period_max):
|
||||
period = period_max
|
||||
if (enable_frequency_cutoff):
|
||||
break
|
||||
|
||||
# Vibrato
|
||||
var rfperiod: float = period
|
||||
if (vibrato_amplitude > 0.0):
|
||||
vibrato_phase += vibrato_speed
|
||||
rfperiod = period * (1.0 + sin(vibrato_phase) * vibrato_amplitude)
|
||||
var iperiod: int = floor(rfperiod)
|
||||
if (iperiod < SfxrGlobals.OVERSAMPLING):
|
||||
iperiod = SfxrGlobals.OVERSAMPLING
|
||||
|
||||
# Square wave duty cycle
|
||||
duty_cycle = duty_cycle + duty_cycle_slide
|
||||
if (duty_cycle > 0.5):
|
||||
duty_cycle = 0.5
|
||||
elif (duty_cycle < 0.0):
|
||||
duty_cycle = 0.0
|
||||
|
||||
# Volume envelope
|
||||
envelope_elapsed += 1.0
|
||||
if (envelope_elapsed > envelope_length[envelope_stage]):
|
||||
envelope_elapsed = 0.0
|
||||
envelope_stage += 1.0
|
||||
if (envelope_stage > 2.0):
|
||||
break
|
||||
|
||||
if (envelope_length[envelope_stage] == 0):
|
||||
continue
|
||||
|
||||
var env_vol: float = 0.0
|
||||
var envf: float = envelope_elapsed / envelope_length[envelope_stage]
|
||||
if (envelope_stage == 0.0): # Attack
|
||||
env_vol = envf
|
||||
elif (envelope_stage == 1.0): # Sustain
|
||||
env_vol = 1.0 + (1.0 - envf) * 2.0 * envelope_punch
|
||||
else: # Decay
|
||||
env_vol = 1.0 - envf
|
||||
|
||||
# Flanger step
|
||||
flanger_offset += flanger_offset_slide
|
||||
var iphase: int = abs(floor(flanger_offset))
|
||||
if (iphase > 1023):
|
||||
iphase = 1023
|
||||
|
||||
if (flthp_d != 0.0):
|
||||
flthp = flthp * flthp_d
|
||||
if (flthp > 0.1):
|
||||
flthp = 0.1
|
||||
elif (flthp < 0.00001):
|
||||
flthp = 0.00001
|
||||
|
||||
# 8x Oversampling
|
||||
var sample: float = 0.0
|
||||
for i in SfxrGlobals.OVERSAMPLING:
|
||||
var sub_sample: float = 0.0
|
||||
phase += 1
|
||||
if (phase >= iperiod):
|
||||
phase %= iperiod
|
||||
if (wave_shape == SfxrGlobals.WAVE_SHAPES.NOISE):
|
||||
for j in noise_buffer_length:
|
||||
noise_buffer[i] = randf() * 2.0 - 1.0
|
||||
|
||||
# Base waveform
|
||||
var fp: float = float(phase) / float(iperiod)
|
||||
if (wave_shape == SfxrGlobals.WAVE_SHAPES.SQUARE):
|
||||
if (fp < duty_cycle):
|
||||
sub_sample = 0.5
|
||||
else:
|
||||
sub_sample = -0.5
|
||||
elif (wave_shape == SfxrGlobals.WAVE_SHAPES.SAWTOOTH):
|
||||
if (fp < duty_cycle):
|
||||
sub_sample = -1.0 + 2.0 * fp / duty_cycle
|
||||
else:
|
||||
sub_sample = 1.0 - 2.0 * (fp - duty_cycle) / (1 - duty_cycle)
|
||||
elif (wave_shape == SfxrGlobals.WAVE_SHAPES.SINE):
|
||||
sub_sample = sin(fp * 2.0 * PI)
|
||||
elif (wave_shape == SfxrGlobals.WAVE_SHAPES.NOISE):
|
||||
sub_sample = noise_buffer[int(floor(phase * 32.0 / iperiod))]
|
||||
else:
|
||||
printerr("ERROR: Bad wave type: " + str(wave_shape))
|
||||
sub_sample = 0
|
||||
|
||||
# Low-pass filter
|
||||
var pp: float = fltp
|
||||
fltw *= fltw_d
|
||||
if (fltw > 0.1):
|
||||
fltw = 0.1
|
||||
elif (fltw < 0.0):
|
||||
fltw = 0.0
|
||||
if (enable_low_pass_filter):
|
||||
fltdp += (sub_sample - fltp) * fltw
|
||||
fltdp -= fltdp * fltdmp
|
||||
else:
|
||||
fltp = sub_sample
|
||||
fltdp = 0.0
|
||||
fltp += fltdp
|
||||
|
||||
# High-pass filter
|
||||
fltphp += fltp - pp
|
||||
fltphp -= fltphp * flthp
|
||||
sub_sample = fltphp
|
||||
|
||||
# Flanger
|
||||
flanger_buffer[ipp & 1023] = sub_sample
|
||||
sub_sample += flanger_buffer[(ipp - iphase + 1024) & 1023]
|
||||
|
||||
ipp = (ipp + 1) & 1023
|
||||
|
||||
# Final accumulation and envelope application
|
||||
sample += sub_sample * env_vol
|
||||
|
||||
# Accumulate samples appropriately for sample rate
|
||||
sample_sum += sample
|
||||
num_summed += 1.0
|
||||
if (num_summed >= summands):
|
||||
num_summed = 0.0
|
||||
sample = sample_sum / summands
|
||||
sample_sum = 0.0
|
||||
else:
|
||||
continue
|
||||
|
||||
sample = sample / SfxrGlobals.OVERSAMPLING * SfxrGlobals.MASTER_VOLUME
|
||||
sample *= gain
|
||||
|
||||
sample = floor((sample + 1) * 128)
|
||||
if (sample > 255):
|
||||
sample = 255;
|
||||
elif (sample < 0):
|
||||
sample = 0
|
||||
sample += 128
|
||||
if sample > 255:
|
||||
sample -= 255
|
||||
|
||||
_buffer.append(sample)
|
||||
|
||||
return _buffer
|
||||
|
||||
|
||||
func build_sample(stream_player):
|
||||
init_params(stream_player)
|
||||
var sample: AudioStreamWAV = stream_player.stream
|
||||
if (not sample):
|
||||
stream_player.stream = AudioStreamWAV.new()
|
||||
sample = stream_player.stream
|
||||
sample.mix_rate = sample_rate
|
||||
sample.data = PackedByteArray(get_raw_buffer())
|
||||
return sample
|
||||
@@ -1,30 +0,0 @@
|
||||
extends Object
|
||||
class_name SfxrGlobals
|
||||
|
||||
|
||||
enum WAVE_SHAPES {
|
||||
SQUARE,
|
||||
SAWTOOTH,
|
||||
SINE,
|
||||
NOISE,
|
||||
}
|
||||
|
||||
enum PRESETS {
|
||||
NONE,
|
||||
PICKUP,
|
||||
LASER,
|
||||
EXPLOSION,
|
||||
POWERUP,
|
||||
HIT,
|
||||
JUMP,
|
||||
CLICK,
|
||||
BLIP,
|
||||
SYNTH,
|
||||
RANDOM,
|
||||
TONE,
|
||||
MUTATE,
|
||||
}
|
||||
|
||||
const OVERSAMPLING = 8
|
||||
|
||||
const MASTER_VOLUME = 1
|
||||
@@ -1,119 +0,0 @@
|
||||
@tool
|
||||
extends AudioStreamPlayer
|
||||
|
||||
|
||||
# Wave Shape
|
||||
var wave_type: int
|
||||
|
||||
# Envelope
|
||||
var p_env_attack: float
|
||||
var p_env_sustain: float
|
||||
var p_env_punch: float
|
||||
var p_env_decay: float
|
||||
|
||||
# Tone
|
||||
var p_base_freq: float
|
||||
var p_freq_limit: float
|
||||
var p_freq_ramp: float
|
||||
var p_freq_dramp: float
|
||||
|
||||
# Vibrato
|
||||
var p_vib_strength: float
|
||||
var p_vib_speed: float
|
||||
|
||||
# Tonal Change
|
||||
var p_arp_mod: float
|
||||
var p_arp_speed: float
|
||||
|
||||
# Square wve duty (proportion of time signal is high vs low)
|
||||
var p_duty: float
|
||||
var p_duty_ramp: float
|
||||
|
||||
# Repeat
|
||||
var p_repeat_speed: float
|
||||
|
||||
# Flanger
|
||||
var p_pha_offset: float
|
||||
var p_pha_ramp: float
|
||||
|
||||
# Low-pass filter
|
||||
var p_lpf_freq: float
|
||||
var p_lpf_ramp: float
|
||||
var p_lpf_resonance: float
|
||||
|
||||
# High-pass filter
|
||||
var p_hpf_freq: float
|
||||
var p_hpf_ramp: float
|
||||
|
||||
# Sample parameters
|
||||
var sound_vol: float
|
||||
var sample_rate: float
|
||||
|
||||
# Sfx Generation
|
||||
var sfx_timer: SceneTreeTimer
|
||||
|
||||
|
||||
##################################
|
||||
# Inspector Properties
|
||||
##################################
|
||||
|
||||
|
||||
func _get_property_list() -> Array:
|
||||
return SfxrStreamPlayerInterface.object_get_property_list()
|
||||
|
||||
|
||||
func _get(property):
|
||||
return SfxrStreamPlayerInterface.object_get(self, property)
|
||||
|
||||
|
||||
func _set(property, value) -> bool:
|
||||
return SfxrStreamPlayerInterface.object_set(self, property, value)
|
||||
|
||||
|
||||
##################################
|
||||
# Defaults
|
||||
##################################
|
||||
|
||||
|
||||
func _init():
|
||||
SfxrStreamPlayerInterface.object_set_defaults(self)
|
||||
|
||||
|
||||
func property_can_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_can_revert(property)
|
||||
|
||||
|
||||
func property_get_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_get_revert(property)
|
||||
|
||||
|
||||
##################################
|
||||
# Presets
|
||||
##################################
|
||||
|
||||
|
||||
func random_preset() -> bool:
|
||||
return SfxrStreamPlayerInterface.random_preset(self)
|
||||
|
||||
|
||||
func preset_values(preset_key: int) -> bool:
|
||||
return SfxrStreamPlayerInterface.preset_values(self, preset_key)
|
||||
|
||||
|
||||
##################################
|
||||
# Playback
|
||||
##################################
|
||||
|
||||
|
||||
func _on_sfx_timer_timeout(timer: SceneTreeTimer, play_after_build: bool):
|
||||
SfxrStreamPlayerInterface._on_sfx_timer_timeout(self, timer, play_after_build)
|
||||
|
||||
|
||||
func build_sfx(play_after_build: bool = false):
|
||||
SfxrStreamPlayerInterface.build_sfx(self, play_after_build)
|
||||
|
||||
|
||||
func play(from_position: float = 0.0):
|
||||
if playing:
|
||||
stop()
|
||||
super.play(from_position)
|
||||
@@ -1,119 +0,0 @@
|
||||
@tool
|
||||
extends AudioStreamPlayer2D
|
||||
|
||||
|
||||
# Wave Shape
|
||||
var wave_type: int
|
||||
|
||||
# Envelope
|
||||
var p_env_attack: float
|
||||
var p_env_sustain: float
|
||||
var p_env_punch: float
|
||||
var p_env_decay: float
|
||||
|
||||
# Tone
|
||||
var p_base_freq: float
|
||||
var p_freq_limit: float
|
||||
var p_freq_ramp: float
|
||||
var p_freq_dramp: float
|
||||
|
||||
# Vibrato
|
||||
var p_vib_strength: float
|
||||
var p_vib_speed: float
|
||||
|
||||
# Tonal Change
|
||||
var p_arp_mod: float
|
||||
var p_arp_speed: float
|
||||
|
||||
# Square wve duty (proportion of time signal is high vs low)
|
||||
var p_duty: float
|
||||
var p_duty_ramp: float
|
||||
|
||||
# Repeat
|
||||
var p_repeat_speed: float
|
||||
|
||||
# Flanger
|
||||
var p_pha_offset: float
|
||||
var p_pha_ramp: float
|
||||
|
||||
# Low-pass filter
|
||||
var p_lpf_freq: float
|
||||
var p_lpf_ramp: float
|
||||
var p_lpf_resonance: float
|
||||
|
||||
# High-pass filter
|
||||
var p_hpf_freq: float
|
||||
var p_hpf_ramp: float
|
||||
|
||||
# Sample parameters
|
||||
var sound_vol: float
|
||||
var sample_rate: float
|
||||
|
||||
# Sfx Generation
|
||||
var sfx_timer: SceneTreeTimer
|
||||
|
||||
|
||||
##################################
|
||||
# Inspector Properties
|
||||
##################################
|
||||
|
||||
|
||||
func _get_property_list() -> Array:
|
||||
return SfxrStreamPlayerInterface.object_get_property_list()
|
||||
|
||||
|
||||
func _get(property):
|
||||
return SfxrStreamPlayerInterface.object_get(self, property)
|
||||
|
||||
|
||||
func _set(property, value) -> bool:
|
||||
return SfxrStreamPlayerInterface.object_set(self, property, value)
|
||||
|
||||
|
||||
##################################
|
||||
# Defaults
|
||||
##################################
|
||||
|
||||
|
||||
func _init():
|
||||
SfxrStreamPlayerInterface.object_set_defaults(self)
|
||||
|
||||
|
||||
func property_can_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_can_revert(property)
|
||||
|
||||
|
||||
func property_get_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_get_revert(property)
|
||||
|
||||
|
||||
##################################
|
||||
# Presets
|
||||
##################################
|
||||
|
||||
|
||||
func random_preset() -> bool:
|
||||
return SfxrStreamPlayerInterface.random_preset(self)
|
||||
|
||||
|
||||
func preset_values(preset_key: int) -> bool:
|
||||
return SfxrStreamPlayerInterface.preset_values(self, preset_key)
|
||||
|
||||
|
||||
##################################
|
||||
# Playback
|
||||
##################################
|
||||
|
||||
|
||||
func _on_sfx_timer_timeout(timer: SceneTreeTimer, play_after_build: bool):
|
||||
SfxrStreamPlayerInterface._on_sfx_timer_timeout(self, timer, play_after_build)
|
||||
|
||||
|
||||
func build_sfx(play_after_build: bool = false):
|
||||
SfxrStreamPlayerInterface.build_sfx(self, play_after_build)
|
||||
|
||||
|
||||
func play(from_position: float = 0.0):
|
||||
if playing:
|
||||
stop()
|
||||
super.play(from_position)
|
||||
@@ -1,119 +0,0 @@
|
||||
@tool
|
||||
extends AudioStreamPlayer3D
|
||||
|
||||
|
||||
# Wave Shape
|
||||
var wave_type: int
|
||||
|
||||
# Envelope
|
||||
var p_env_attack: float
|
||||
var p_env_sustain: float
|
||||
var p_env_punch: float
|
||||
var p_env_decay: float
|
||||
|
||||
# Tone
|
||||
var p_base_freq: float
|
||||
var p_freq_limit: float
|
||||
var p_freq_ramp: float
|
||||
var p_freq_dramp: float
|
||||
|
||||
# Vibrato
|
||||
var p_vib_strength: float
|
||||
var p_vib_speed: float
|
||||
|
||||
# Tonal Change
|
||||
var p_arp_mod: float
|
||||
var p_arp_speed: float
|
||||
|
||||
# Square wve duty (proportion of time signal is high vs low)
|
||||
var p_duty: float
|
||||
var p_duty_ramp: float
|
||||
|
||||
# Repeat
|
||||
var p_repeat_speed: float
|
||||
|
||||
# Flanger
|
||||
var p_pha_offset: float
|
||||
var p_pha_ramp: float
|
||||
|
||||
# Low-pass filter
|
||||
var p_lpf_freq: float
|
||||
var p_lpf_ramp: float
|
||||
var p_lpf_resonance: float
|
||||
|
||||
# High-pass filter
|
||||
var p_hpf_freq: float
|
||||
var p_hpf_ramp: float
|
||||
|
||||
# Sample parameters
|
||||
var sound_vol: float
|
||||
var sample_rate: float
|
||||
|
||||
# Sfx Generation
|
||||
var sfx_timer: SceneTreeTimer
|
||||
|
||||
|
||||
##################################
|
||||
# Inspector Properties
|
||||
##################################
|
||||
|
||||
|
||||
func _get_property_list() -> Array:
|
||||
return SfxrStreamPlayerInterface.object_get_property_list()
|
||||
|
||||
|
||||
func _get(property):
|
||||
return SfxrStreamPlayerInterface.object_get(self, property)
|
||||
|
||||
|
||||
func _set(property, value):
|
||||
return SfxrStreamPlayerInterface.object_set(self, property, value)
|
||||
|
||||
|
||||
##################################
|
||||
# Defaults
|
||||
##################################
|
||||
|
||||
|
||||
func _init():
|
||||
SfxrStreamPlayerInterface.object_set_defaults(self)
|
||||
|
||||
|
||||
func property_can_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_can_revert(property)
|
||||
|
||||
|
||||
func property_get_revert(property: String):
|
||||
return SfxrStreamPlayerInterface.object_property_get_revert(property)
|
||||
|
||||
|
||||
##################################
|
||||
# Presets
|
||||
##################################
|
||||
|
||||
|
||||
func random_preset() -> bool:
|
||||
return SfxrStreamPlayerInterface.random_preset(self)
|
||||
|
||||
|
||||
func preset_values(preset_key: int) -> bool:
|
||||
return SfxrStreamPlayerInterface.preset_values(self, preset_key)
|
||||
|
||||
|
||||
##################################
|
||||
# Playback
|
||||
##################################
|
||||
|
||||
|
||||
func _on_sfx_timer_timeout(timer: SceneTreeTimer, play_after_build: bool):
|
||||
SfxrStreamPlayerInterface._on_sfx_timer_timeout(self, timer, play_after_build)
|
||||
|
||||
|
||||
func build_sfx(play_after_build: bool = false):
|
||||
SfxrStreamPlayerInterface.build_sfx(self, play_after_build)
|
||||
|
||||
|
||||
func play(from_position: float = 0.0):
|
||||
if playing:
|
||||
stop()
|
||||
super.play(from_position)
|
||||
@@ -1,477 +0,0 @@
|
||||
extends Object
|
||||
class_name SfxrStreamPlayerInterface
|
||||
|
||||
|
||||
##################################
|
||||
# Inspector Properties
|
||||
##################################
|
||||
|
||||
|
||||
const PROPERTY_MAP = {
|
||||
# Sample params
|
||||
"sample_params/sound_vol": {"name": "sound_vol", "hint_string": "0,1,0.000000001", "default": 0.25},
|
||||
"sample_params/sample_rate": {"name": "sample_rate", "hint_string": "6000,44100,1", "default": 44100.0},
|
||||
# Envelope
|
||||
"envelope/attack_time": {"name": "p_env_attack", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"envelope/sustain_time": {"name": "p_env_sustain", "hint_string": "0,1,0.000000001", "default": 0.6641},
|
||||
"envelope/punch_time": {"name": "p_env_punch", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"envelope/decay_time": {"name": "p_env_decay", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
# Frequency
|
||||
"frequency/start_frequency": {"name": "p_base_freq", "hint_string": "0,1,0.000000001", "default": 0.35173364},
|
||||
"frequency/min_freq_cutoff": {"name": "p_freq_limit", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"frequency/slide": {"name": "p_freq_ramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
"frequency/delta_slide": {"name": "p_freq_dramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
# Vibrato
|
||||
"vibrato/depth": {"name": "p_vib_strength", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"vibrato/speed": {"name": "p_vib_speed", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
# Arpeggiation
|
||||
"arpeggiation/frequency_mult": {"name": "p_arp_mod", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
"arpeggiation/change_speed": {"name": "p_arp_speed", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
# Duty cycle
|
||||
"duty_cycle/duty_cycle": {"name": "p_duty", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"duty_cycle/sweep": {"name": "p_duty_ramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
# Retrigger
|
||||
"retrigger/rate": {"name": "p_repeat_speed", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
# Flanger
|
||||
"flanger/offset": {"name": "p_pha_offset", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
"flanger/sweep": {"name": "p_pha_ramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
# Low-pass filter
|
||||
"low_pass_filter/cutoff_frequency": {"name": "p_lpf_freq", "hint_string": "0,1,0.000000001", "default": 1.0},
|
||||
"low_pass_filter/cutoff_sweep": {"name": "p_lpf_ramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
"low_pass_filter/resonance": {"name": "p_lpf_resonance", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
# High-pass filter
|
||||
"high_pass_filter/cutoff_frequency": {"name": "p_hpf_freq", "hint_string": "0,1,0.000000001", "default": 0.0},
|
||||
"high_pass_filter/cutoff_sweep": {"name": "p_hpf_ramp", "hint_string": "-1,1,0.000000001", "default": 0.0},
|
||||
}
|
||||
|
||||
|
||||
static func object_get_property_list() -> Array:
|
||||
var presets = SfxrGlobals.PRESETS.keys()
|
||||
presets.pop_front()
|
||||
var props = []
|
||||
props.append({
|
||||
"name": "SfxrStreamPlayer",
|
||||
"type": TYPE_NIL,
|
||||
"usage": PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE,
|
||||
})
|
||||
for preset in presets:
|
||||
props.append({
|
||||
"name": "generators/" + str(preset).to_lower(),
|
||||
"type": TYPE_BOOL,
|
||||
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE,
|
||||
})
|
||||
props.append({
|
||||
"name": "wave/type",
|
||||
"type": TYPE_INT,
|
||||
"hint": PROPERTY_HINT_ENUM,
|
||||
"hint_string": ",".join(PackedStringArray(SfxrGlobals.WAVE_SHAPES.keys())),
|
||||
})
|
||||
for property in PROPERTY_MAP:
|
||||
props.append({
|
||||
"name": property,
|
||||
"type": TYPE_FLOAT,
|
||||
"hint": PROPERTY_HINT_RANGE,
|
||||
"hint_string": PROPERTY_MAP[property]["hint_string"],
|
||||
})
|
||||
props.append_array([
|
||||
{
|
||||
"name": "actions/force_rebuild",
|
||||
"type": TYPE_BOOL,
|
||||
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE,
|
||||
},
|
||||
])
|
||||
return props
|
||||
|
||||
|
||||
static func object_get(object: Node, property: String):
|
||||
if property in PROPERTY_MAP:
|
||||
return object[PROPERTY_MAP[property]["name"]]
|
||||
elif property == "wave/type":
|
||||
return object.wave_type
|
||||
|
||||
|
||||
static func object_set(object: Node, property: String, value) -> bool:
|
||||
var auto_build = Engine.is_editor_hint() and object.is_inside_tree()
|
||||
if property in PROPERTY_MAP:
|
||||
object[PROPERTY_MAP[property]["name"]] = value
|
||||
if auto_build:
|
||||
_schedule_build_sfx(object, true)
|
||||
return true
|
||||
elif property == "wave/type":
|
||||
object.wave_type = value
|
||||
if auto_build:
|
||||
_schedule_build_sfx(object, true)
|
||||
return true
|
||||
elif property == "actions/force_rebuild":
|
||||
if value and auto_build:
|
||||
build_sfx(object, true)
|
||||
return true
|
||||
elif property == "sfxr_generator":
|
||||
if not value:
|
||||
value = 0
|
||||
if preset_values(object, value) and auto_build:
|
||||
build_sfx(object, true)
|
||||
return true
|
||||
elif property.begins_with("generators/"):
|
||||
property = property.replace("generators/", "").to_upper()
|
||||
if preset_values(object, SfxrGlobals.PRESETS.get(property, -1)) and auto_build:
|
||||
build_sfx(object, true)
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
##################################
|
||||
# Defaults
|
||||
##################################
|
||||
|
||||
|
||||
static func object_set_defaults(object: Node):
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.SAWTOOTH
|
||||
for property in PROPERTY_MAP:
|
||||
object[PROPERTY_MAP[property]["name"]] = PROPERTY_MAP[property]["default"]
|
||||
|
||||
|
||||
static func object_property_can_revert(property: String):
|
||||
return property in PROPERTY_MAP
|
||||
|
||||
|
||||
static func object_property_get_revert(property: String):
|
||||
return PROPERTY_MAP[property]["default"]
|
||||
|
||||
|
||||
##################################
|
||||
# Helpers
|
||||
##################################
|
||||
|
||||
|
||||
static func frnd(rrange) -> float:
|
||||
return randf() * rrange
|
||||
|
||||
|
||||
static func rndr(from, to) -> float:
|
||||
return randf() * (to - from) + from
|
||||
|
||||
|
||||
static func rnd(rmax) -> float:
|
||||
return floor(randf() * (rmax + 1))
|
||||
|
||||
|
||||
##################################
|
||||
# Presets
|
||||
##################################
|
||||
|
||||
|
||||
static func _presets_pickup(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.SAWTOOTH
|
||||
object.p_base_freq = 0.4 + frnd(0.5)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = frnd(0.1)
|
||||
object.p_env_decay = 0.1 + frnd(0.4)
|
||||
object.p_env_punch = 0.3 + frnd(0.3)
|
||||
if rnd(1):
|
||||
object.p_arp_speed = 0.5 + frnd(0.2)
|
||||
object.p_arp_mod = 0.2 + frnd(0.4)
|
||||
|
||||
|
||||
static func _presets_laser(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = rnd(2)
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SINE and rnd(1):
|
||||
object.wave_type = rnd(1)
|
||||
if rnd(2) == 0:
|
||||
object.p_base_freq = 0.3 + frnd(0.6)
|
||||
object.p_freq_limit = frnd(0.1)
|
||||
object.p_freq_ramp = -0.35 - frnd(0.3)
|
||||
else:
|
||||
object.p_base_freq = 0.5 + frnd(0.5)
|
||||
object.p_freq_limit = object.p_base_freq - 0.2 - frnd(0.6)
|
||||
if object.p_freq_limit < 0.2:
|
||||
object.p_freq_limit = 0.2
|
||||
object.p_freq_ramp = -0.15 - frnd(0.2)
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SAWTOOTH:
|
||||
object.p_duty = 1
|
||||
if rnd(1):
|
||||
object.p_duty = frnd(0.5)
|
||||
object.p_duty_ramp = frnd(0.2)
|
||||
else:
|
||||
object.p_duty = 0.4 + frnd(0.5)
|
||||
object.p_duty_ramp = -frnd(0.7)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = 0.1 + frnd(0.2)
|
||||
object.p_env_decay = frnd(0.4)
|
||||
if rnd(1):
|
||||
object.p_env_punch = frnd(0.3)
|
||||
if rnd(2) == 0:
|
||||
object.p_pha_offset = frnd(0.2)
|
||||
object.p_pha_ramp = -frnd(0.2)
|
||||
object.p_hpf_freq = frnd(0.3)
|
||||
|
||||
|
||||
static func _presets_explosion(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.NOISE
|
||||
if rnd(1):
|
||||
object.p_base_freq = pow(0.1 + frnd(0.4), 2)
|
||||
object.p_freq_ramp = -0.1 + frnd(0.4)
|
||||
else:
|
||||
object.p_base_freq = pow(0.2 + frnd(0.7), 2)
|
||||
object.p_freq_ramp = -0.2 - frnd(0.2)
|
||||
if rnd(4) == 0:
|
||||
object.p_freq_ramp = 0
|
||||
if rnd(2) == 0:
|
||||
object.p_repeat_speed = 0.3 + frnd(0.5)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = 0.1 + frnd(0.3)
|
||||
object.p_env_decay = frnd(0.5)
|
||||
if rnd(1):
|
||||
object.p_pha_offset = -0.3 + frnd(0.9)
|
||||
object.p_pha_ramp = -frnd(0.3)
|
||||
object.p_env_punch = 0.2 + frnd(0.6)
|
||||
if rnd(1):
|
||||
object.p_vib_strength = frnd(0.7)
|
||||
object.p_vib_speed = frnd(0.6)
|
||||
if rnd(2) == 0:
|
||||
object.p_arp_speed = 0.6 + frnd(0.3)
|
||||
object.p_arp_mod = 0.8 - frnd(1.6)
|
||||
|
||||
|
||||
static func _presets_powerup(object: Node):
|
||||
object_set_defaults(object)
|
||||
if rnd(1):
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.SAWTOOTH
|
||||
object.p_duty = 1
|
||||
else:
|
||||
object.p_duty = frnd(0.6)
|
||||
object.p_base_freq = 0.2 + frnd(0.3)
|
||||
if rnd(1):
|
||||
object.p_freq_ramp = 0.1 + frnd(0.4)
|
||||
object.p_repeat_speed = 0.4 + frnd(0.4)
|
||||
else:
|
||||
object.p_freq_ramp = 0.05 + frnd(0.2)
|
||||
if rnd(1):
|
||||
object.p_vib_strength = frnd(0.7)
|
||||
object.p_vib_speed = frnd(0.6)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = frnd(0.4)
|
||||
object.p_env_decay = 0.1 + frnd(0.4)
|
||||
|
||||
|
||||
static func _presets_hit(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = rnd(2)
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SINE:
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.NOISE
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SQUARE:
|
||||
object.p_duty = frnd(0.6)
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SAWTOOTH:
|
||||
object.p_duty = 1
|
||||
object.p_base_freq = 0.2 + frnd(0.6)
|
||||
object.p_freq_ramp = -0.3 - frnd(0.4)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = frnd(0.1)
|
||||
object.p_env_decay = 0.1 + frnd(0.2)
|
||||
if rnd(1):
|
||||
object.p_hpf_freq = frnd(0.3)
|
||||
|
||||
|
||||
static func _presets_jump(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = SfxrGlobals.WAVE_SHAPES.SQUARE
|
||||
object.p_duty = frnd(0.6)
|
||||
object.p_base_freq = 0.3 + frnd(0.3)
|
||||
object.p_freq_ramp = 0.1 + frnd(0.2)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = 0.1 + frnd(0.3)
|
||||
object.p_env_decay = 0.1 + frnd(0.2)
|
||||
if rnd(1):
|
||||
object.p_hpf_freq = frnd(0.3)
|
||||
if rnd(1):
|
||||
object.p_lpf_freq = 1 - frnd(0.6)
|
||||
|
||||
|
||||
static func _presets_blip(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = rnd(1)
|
||||
if object.wave_type == SfxrGlobals.WAVE_SHAPES.SQUARE:
|
||||
object.p_duty = frnd(0.6)
|
||||
else:
|
||||
object.p_duty = 1
|
||||
object.p_base_freq = 0.2 + frnd(0.4)
|
||||
object.p_env_attack = 0
|
||||
object.p_env_sustain = 0.1 + frnd(0.1)
|
||||
object.p_env_decay = frnd(0.2)
|
||||
object.p_hpf_freq = 0.1
|
||||
|
||||
|
||||
static func _presets_synth(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = rnd(1)
|
||||
object.p_base_freq = [0.2723171360931539, 0.19255692561524382, 0.13615778746815113][rnd(2)]
|
||||
object.p_env_attack = frnd(0.5) if rnd(4) > 3 else 0
|
||||
object.p_env_sustain = frnd(1)
|
||||
object.p_env_punch = frnd(1)
|
||||
object.p_env_decay = frnd(0.9) + 0.1
|
||||
object.p_arp_mod = [0, 0, 0, 0, -0.3162, 0.7454, 0.7454][rnd(6)]
|
||||
object.p_arp_speed = frnd(0.5) + 0.4
|
||||
object.p_duty = frnd(1)
|
||||
object.p_duty_ramp = frnd(1) if rnd(2) == 2 else 0
|
||||
object.p_lpf_freq = [1, frnd(1) * frnd(1)][rnd(1)]
|
||||
object.p_lpf_ramp = rndr(-1, 1)
|
||||
object.p_lpf_resonance = frnd(1)
|
||||
object.p_hpf_freq = frnd(1) if rnd(3) == 3 else 0
|
||||
object.p_hpf_ramp = frnd(1) if rnd(3) == 3 else 0
|
||||
|
||||
|
||||
static func _presets_tone(object: Node):
|
||||
object_set_defaults(object)
|
||||
|
||||
|
||||
static func _presets_click(object: Node):
|
||||
if rnd(1):
|
||||
_presets_hit(object)
|
||||
else:
|
||||
_presets_explosion(object)
|
||||
if rnd(1):
|
||||
object.p_freq_ramp = -0.5 + frnd(1.0)
|
||||
if rnd(1):
|
||||
object.p_env_sustain = (frnd(0.4) + 0.2) * object.p_env_sustain
|
||||
object.p_env_decay = (frnd(0.4) + 0.2) * object.p_env_decay
|
||||
if rnd(3) == 0:
|
||||
object.p_env_attack = frnd(0.3)
|
||||
object.p_base_freq = 1 - frnd(0.25)
|
||||
object.p_hpf_freq = 1 - frnd(0.1)
|
||||
|
||||
|
||||
static func _presets_random(object: Node):
|
||||
object_set_defaults(object)
|
||||
object.wave_type = rnd(3)
|
||||
if rnd(1):
|
||||
object.p_base_freq = pow(frnd(2) - 1, 3) + 0.5
|
||||
else:
|
||||
object.p_base_freq = pow(frnd(1), 2)
|
||||
object.p_freq_limit = 0
|
||||
object.p_freq_ramp = pow(frnd(2) - 1, 5)
|
||||
if object.p_base_freq > 0.7 and object.p_freq_ramp > 0.2:
|
||||
object.p_freq_ramp = -object.p_freq_ramp
|
||||
if object.p_base_freq < 0.2 and object.p_freq_ramp < -0.05:
|
||||
object.p_freq_ramp = -object.p_freq_ramp
|
||||
object.p_freq_dramp = pow(frnd(2) - 1, 3)
|
||||
object.p_duty = frnd(2) - 1
|
||||
object.p_duty_ramp = pow(frnd(2) - 1, 3)
|
||||
object.p_vib_strength = pow(frnd(2) - 1, 3)
|
||||
object.p_vib_speed = rndr(-1, 1)
|
||||
object.p_env_attack = pow(rndr(-1, 1), 3)
|
||||
object.p_env_sustain = pow(rndr(-1, 1), 2)
|
||||
object.p_env_decay = rndr(-1, 1)
|
||||
object.p_env_punch = pow(frnd(0.8), 2)
|
||||
if object.p_env_attack + object.p_env_sustain + object.p_env_decay < 0.2:
|
||||
object.p_env_sustain += 0.2 + frnd(0.3)
|
||||
object.p_env_decay += 0.2 + frnd(0.3)
|
||||
object.p_lpf_resonance = rndr(-1, 1)
|
||||
object.p_lpf_freq = 1 - pow(frnd(1), 3)
|
||||
object.p_lpf_ramp = pow(frnd(2) - 1, 3)
|
||||
if object.p_lpf_freq < 0.1 and object.p_lpf_ramp < -0.05:
|
||||
object.p_lpf_ramp = -object.p_lpf_ramp
|
||||
object.p_hpf_freq = pow(frnd(1), 5)
|
||||
object.p_hpf_ramp = pow(frnd(2) - 1, 5)
|
||||
object.p_pha_offset = pow(frnd(2) - 1, 3)
|
||||
object.p_pha_ramp = pow(frnd(2) - 1, 3)
|
||||
object.p_repeat_speed = frnd(2) - 1
|
||||
object.p_arp_speed = frnd(2) - 1
|
||||
object.p_arp_mod = frnd(2) - 1
|
||||
|
||||
|
||||
static func _presets_mutate(object: Node):
|
||||
if rnd(1): object.p_base_freq += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_freq_ramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_freq_dramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_duty += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_duty_ramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_vib_strength += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_vib_speed += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_env_attack += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_env_sustain += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_env_decay += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_env_punch += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_lpf_resonance += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_lpf_freq += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_lpf_ramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_hpf_freq += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_hpf_ramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_pha_offset += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_pha_ramp += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_repeat_speed += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_arp_speed += frnd(0.1) - 0.05
|
||||
if rnd(1): object.p_arp_mod += frnd(0.1) - 0.05
|
||||
|
||||
|
||||
static func random_preset(object: Node) -> bool:
|
||||
return preset_values(object, (randi() % (len(SfxrGlobals.PRESETS) - 1)) + 1)
|
||||
|
||||
|
||||
static func preset_values(object: Node, preset_key: int) -> bool:
|
||||
if preset_key >= 0 and preset_key < len(SfxrGlobals.PRESETS):
|
||||
var preset = SfxrGlobals.PRESETS.keys()[preset_key].to_lower()
|
||||
match preset:
|
||||
"pickup":
|
||||
_presets_pickup(object)
|
||||
return true
|
||||
"laser":
|
||||
_presets_laser(object)
|
||||
return true
|
||||
"explosion":
|
||||
_presets_explosion(object)
|
||||
return true
|
||||
"powerup":
|
||||
_presets_powerup(object)
|
||||
return true
|
||||
"hit":
|
||||
_presets_hit(object)
|
||||
return true
|
||||
"jump":
|
||||
_presets_jump(object)
|
||||
return true
|
||||
"click":
|
||||
_presets_click(object)
|
||||
return true
|
||||
"blip":
|
||||
_presets_blip(object)
|
||||
return true
|
||||
"synth":
|
||||
_presets_synth(object)
|
||||
return true
|
||||
"random":
|
||||
_presets_random(object)
|
||||
return true
|
||||
"tone":
|
||||
_presets_tone(object)
|
||||
return true
|
||||
"mutate":
|
||||
_presets_mutate(object)
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
##################################
|
||||
# Playback
|
||||
##################################
|
||||
|
||||
|
||||
static func _schedule_build_sfx(object: Node, play_after_build: bool):
|
||||
var timer: SceneTreeTimer = object.get_tree().create_timer(.5)
|
||||
object.sfx_timer = timer
|
||||
timer.timeout.connect(func(): object._on_sfx_timer_timeout(timer, play_after_build))
|
||||
|
||||
|
||||
static func _on_sfx_timer_timeout(object: Node, timer: SceneTreeTimer, play_after_build: bool):
|
||||
if timer == object.sfx_timer:
|
||||
build_sfx(object, play_after_build)
|
||||
|
||||
|
||||
static func build_sfx(object: Node, play_after_build: bool = false):
|
||||
var sfxg = SfxrGenerator.new()
|
||||
sfxg.build_sample(object)
|
||||
if play_after_build:
|
||||
object.play()
|
||||
object.notify_property_list_changed()
|
||||
@@ -1,7 +0,0 @@
|
||||
[plugin]
|
||||
|
||||
name="GodotSfxr"
|
||||
description="Sfx Generator. Port of jsfxr (https://sfxr.me - by Eric Fredricksen) which is a port of sfxr (https://www.drpetter.se/project_sfxr.html - by DrPetter)."
|
||||
author="Tomeyro"
|
||||
version="1.0"
|
||||
script="GodotSfxr.gd"
|
||||
BIN
addons/tbloader/bin/libtbloader.linux.x86_64.so
Normal file
BIN
addons/tbloader/bin/libtbloader.macos.universal.dylib
Normal file
BIN
addons/tbloader/bin/tbloader.windows.x86_64.dll
Normal file
BIN
addons/tbloader/icon.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
@@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dqv5atotjgx01"
|
||||
path="res://.godot/imported/untitled_DefaultMaterial_Normal.png-1d66825270be8b0e737ff63c686f533c.ctex"
|
||||
uid="uid://cbbpw5sol06i6"
|
||||
path="res://.godot/imported/icon.png-7c6403be1be0a98a34b14bf837b41c44.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/Bullet/untitled_DefaultMaterial_Normal.png"
|
||||
dest_files=["res://.godot/imported/untitled_DefaultMaterial_Normal.png-1d66825270be8b0e737ff63c686f533c.ctex"]
|
||||
source_file="res://addons/tbloader/icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-7c6403be1be0a98a34b14bf837b41c44.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
16
addons/tbloader/icons/tbloader.svg
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>TBLoader</title>
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:title>TBLoader</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g transform="matrix(.23996 0 0 .24633 -15.301 -26.547)" fill="none">
|
||||
<path d="m97.213 109.57-30.357 8.4385-5.37e-4 -5.6e-4 8.3597 29.977 21.989 21.198v8.6e-4l9.36e-4 -5.5e-4 5.35e-4 5.5e-4v-8.6e-4l21.99-21.198 8.356-29.965 0.0192-0.0115zm0 25.412 0.0083 0.5401-0.01402 9e-3zm-0.0083 0.54822 0.0022 8.5e-4 -9.37e-4 0.94463z" stop-color="#000000" style="-inkscape-stroke:none;font-variation-settings:normal"/>
|
||||
<path transform="translate(-6.7616,1.2332)" d="m103.97 109.62-29.045 8.0742 29.039 16.766 6e-3 -0.52539 8e-3 0.52539 29.039-16.766z" stop-color="#000000" stroke="#fb8080" stroke-miterlimit="3" stroke-width="3.3" style="-inkscape-stroke:none;font-variation-settings:normal;paint-order:normal"/>
|
||||
<path d="m68.168 118.93 29.038 16.766 0.01581 32.214-21.055-20.297zm58.077 0-29.038 16.766-0.01581 32.214 21.055-20.297z" stop-color="#000000" stroke="#fb8080" stroke-miterlimit="3" stroke-width="3.3" style="-inkscape-stroke:none;font-variation-settings:normal;paint-order:normal"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
37
addons/tbloader/icons/tbloader.svg.import
Normal file
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b6bigon1m2gl"
|
||||
path="res://.godot/imported/tbloader.svg-ac537690612434f49f9a80d3b536a819.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/tbloader/icons/tbloader.svg"
|
||||
dest_files=["res://.godot/imported/tbloader.svg-ac537690612434f49f9a80d3b536a819.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
7
addons/tbloader/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="TBLoader"
|
||||
description="TrenchBroom map loader."
|
||||
author="Codecat"
|
||||
version="0.9.0"
|
||||
script="src/plugin.gd"
|
||||
64
addons/tbloader/src/plugin.gd
Normal file
@@ -0,0 +1,64 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
class_name TBPlugin
|
||||
|
||||
var map_control: Control = null
|
||||
var editing_loader: WeakRef = weakref(null)
|
||||
|
||||
func _enter_tree():
|
||||
set_icons(true)
|
||||
|
||||
map_control = create_map_control()
|
||||
map_control.set_visible(false)
|
||||
add_control_to_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_MENU, map_control)
|
||||
|
||||
func _exit_tree():
|
||||
set_icons(false)
|
||||
|
||||
remove_control_from_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_MENU, map_control)
|
||||
map_control.queue_free()
|
||||
map_control = null
|
||||
|
||||
func _handles(object):
|
||||
return object is TBLoader
|
||||
|
||||
func _make_visible(visible: bool):
|
||||
map_control.set_visible(visible)
|
||||
|
||||
func _edit(object):
|
||||
editing_loader = weakref(object)
|
||||
|
||||
func create_map_control() -> Control:
|
||||
var button_build_meshes = Button.new()
|
||||
button_build_meshes.flat = true
|
||||
button_build_meshes.text = "Build Meshes"
|
||||
button_build_meshes.connect("pressed", Callable(self, "build_meshes"))
|
||||
|
||||
var button_build_csg = Button.new()
|
||||
button_build_csg.flat = true
|
||||
button_build_csg.text = "Build Combined CSG"
|
||||
button_build_csg.connect("pressed", Callable(self, "build_combined_csg"))
|
||||
|
||||
var ret = HBoxContainer.new()
|
||||
ret.add_child(button_build_meshes)
|
||||
ret.add_child(button_build_csg)
|
||||
return ret
|
||||
|
||||
func build_meshes():
|
||||
var loader = editing_loader.get_ref()
|
||||
loader.build_meshes()
|
||||
|
||||
func build_combined_csg():
|
||||
var loader = editing_loader.get_ref()
|
||||
loader.build_combined_csg()
|
||||
|
||||
func set_icons(on):
|
||||
var editor_interface = get_editor_interface()
|
||||
var base_control = editor_interface.get_base_control()
|
||||
var theme = base_control.theme
|
||||
|
||||
if on:
|
||||
var texture = ResourceLoader.load("res://addons/tbloader/icons/tbloader.svg")
|
||||
theme.set_icon("TBLoader", "EditorIcons", texture)
|
||||
else:
|
||||
theme.clear_icon("TBLoader", "EditorIcons")
|
||||
7
addons/tbloader/tbloader.gdextension
Normal file
@@ -0,0 +1,7 @@
|
||||
[configuration]
|
||||
entry_symbol = "tbloader_init"
|
||||
|
||||
[libraries]
|
||||
windows.64 = "bin/tbloader.windows.x86_64.dll"
|
||||
linux.64 = "bin/libtbloader.linux.x86_64.so"
|
||||
macos.64 = "bin/libtbloader.macos.universal.dylib"
|
||||
@@ -1,173 +0,0 @@
|
||||
{
|
||||
"asset": {
|
||||
"generator": "FBX2glTF",
|
||||
"version": "2.0"
|
||||
},
|
||||
"scene": 0,
|
||||
"buffers": [
|
||||
{
|
||||
"byteLength": 6920,
|
||||
"uri": "buffer.bin"
|
||||
}
|
||||
],
|
||||
"bufferViews": [
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 1128,
|
||||
"byteOffset": 0,
|
||||
"target": 34963
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 2172,
|
||||
"byteOffset": 1128,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 2172,
|
||||
"byteOffset": 3300,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 1448,
|
||||
"byteOffset": 5472,
|
||||
"target": 34962
|
||||
}
|
||||
],
|
||||
"scenes": [
|
||||
{
|
||||
"name": "Root Scene",
|
||||
"nodes": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"accessors": [
|
||||
{
|
||||
"componentType": 5123,
|
||||
"type": "SCALAR",
|
||||
"count": 564,
|
||||
"bufferView": 0,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 181,
|
||||
"bufferView": 1,
|
||||
"byteOffset": 0,
|
||||
"min": [
|
||||
-0.0108033427968621,
|
||||
-0.0108033427968621,
|
||||
-0.00999999977648258
|
||||
],
|
||||
"max": [
|
||||
0.0108033427968621,
|
||||
0.0108033427968621,
|
||||
0.0483268722891808
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 181,
|
||||
"bufferView": 2,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC2",
|
||||
"count": 181,
|
||||
"bufferView": 3,
|
||||
"byteOffset": 0
|
||||
}
|
||||
],
|
||||
"samplers": [
|
||||
{}
|
||||
],
|
||||
"materials": [
|
||||
{
|
||||
"name": "DefaultMaterial",
|
||||
"alphaMode": "OPAQUE",
|
||||
"extras": {
|
||||
"fromFBX": {
|
||||
"shadingModel": "Lambert",
|
||||
"isTruePBR": false
|
||||
}
|
||||
},
|
||||
"pbrMetallicRoughness": {
|
||||
"baseColorFactor": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
1.0
|
||||
],
|
||||
"metallicFactor": 0.200000002980232,
|
||||
"roughnessFactor": 0.800000011920929
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes": [
|
||||
{
|
||||
"name": "Cylinder",
|
||||
"primitives": [
|
||||
{
|
||||
"material": 0,
|
||||
"mode": 4,
|
||||
"attributes": {
|
||||
"NORMAL": 2,
|
||||
"POSITION": 1,
|
||||
"TEXCOORD_0": 3
|
||||
},
|
||||
"indices": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"name": "RootNode",
|
||||
"translation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"rotation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"scale": [
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Cylinder",
|
||||
"translation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"rotation": [
|
||||
-0.707106828689575,
|
||||
0.0,
|
||||
0.0,
|
||||
0.707106709480286
|
||||
],
|
||||
"scale": [
|
||||
100.0,
|
||||
100.0,
|
||||
100.0
|
||||
],
|
||||
"mesh": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b214bo6dwp0rh"
|
||||
path="res://.godot/imported/Bullet.gltf-2a14837db27fd94e8b92de2a56a298d3.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/Bullet/Bullet.gltf"
|
||||
dest_files=["res://.godot/imported/Bullet.gltf-2a14837db27fd94e8b92de2a56a298d3.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
@@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://d3sl3ypfxbfmw"
|
||||
path="res://.godot/imported/Revolver.glb-42b722e7214b13489cbe235a595da532.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/Revolver/Revolver.glb"
|
||||
dest_files=["res://.godot/imported/Revolver.glb-42b722e7214b13489cbe235a595da532.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
|
Before Width: | Height: | Size: 65 KiB |
@@ -1,289 +0,0 @@
|
||||
{
|
||||
"asset": {
|
||||
"generator": "FBX2glTF",
|
||||
"version": "2.0"
|
||||
},
|
||||
"scene": 0,
|
||||
"buffers": [
|
||||
{
|
||||
"byteLength": 7484,
|
||||
"uri": "buffer.bin"
|
||||
}
|
||||
],
|
||||
"bufferViews": [
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 604,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 1812,
|
||||
"byteOffset": 604
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 2416,
|
||||
"byteOffset": 2416
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 1812,
|
||||
"byteOffset": 4832
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 72,
|
||||
"byteOffset": 6644,
|
||||
"target": 34963
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 288,
|
||||
"byteOffset": 6716,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 288,
|
||||
"byteOffset": 7004,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteLength": 192,
|
||||
"byteOffset": 7292,
|
||||
"target": 34962
|
||||
}
|
||||
],
|
||||
"scenes": [
|
||||
{
|
||||
"name": "Root Scene",
|
||||
"nodes": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"accessors": [
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "SCALAR",
|
||||
"count": 151,
|
||||
"bufferView": 0,
|
||||
"byteOffset": 0,
|
||||
"min": [
|
||||
0.0
|
||||
],
|
||||
"max": [
|
||||
6.25
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 151,
|
||||
"bufferView": 1,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC4",
|
||||
"count": 151,
|
||||
"bufferView": 2,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 151,
|
||||
"bufferView": 3,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5123,
|
||||
"type": "SCALAR",
|
||||
"count": 36,
|
||||
"bufferView": 4,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 24,
|
||||
"bufferView": 5,
|
||||
"byteOffset": 0,
|
||||
"min": [
|
||||
-0.00477957352995872,
|
||||
-0.00677411770448089,
|
||||
-0.0176910851150751
|
||||
],
|
||||
"max": [
|
||||
0.00477957399562001,
|
||||
0.00677412236109376,
|
||||
0.0176910851150751
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC3",
|
||||
"count": 24,
|
||||
"bufferView": 6,
|
||||
"byteOffset": 0
|
||||
},
|
||||
{
|
||||
"componentType": 5126,
|
||||
"type": "VEC2",
|
||||
"count": 24,
|
||||
"bufferView": 7,
|
||||
"byteOffset": 0
|
||||
}
|
||||
],
|
||||
"images": [
|
||||
{
|
||||
"name": "untitled.png",
|
||||
"uri": "untitled.png"
|
||||
}
|
||||
],
|
||||
"samplers": [
|
||||
{}
|
||||
],
|
||||
"textures": [
|
||||
{
|
||||
"name": "base_color_texture",
|
||||
"sampler": 0,
|
||||
"source": 0
|
||||
}
|
||||
],
|
||||
"materials": [
|
||||
{
|
||||
"name": "Material.003",
|
||||
"alphaMode": "OPAQUE",
|
||||
"extras": {
|
||||
"fromFBX": {
|
||||
"shadingModel": "Phong",
|
||||
"isTruePBR": false
|
||||
}
|
||||
},
|
||||
"pbrMetallicRoughness": {
|
||||
"baseColorTexture": {
|
||||
"index": 0,
|
||||
"texCoord": 0
|
||||
},
|
||||
"baseColorFactor": [
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"metallicFactor": 0.400000005960464,
|
||||
"roughnessFactor": 1.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes": [
|
||||
{
|
||||
"name": "Cube.003",
|
||||
"primitives": [
|
||||
{
|
||||
"material": 0,
|
||||
"mode": 4,
|
||||
"attributes": {
|
||||
"NORMAL": 6,
|
||||
"POSITION": 5,
|
||||
"TEXCOORD_0": 7
|
||||
},
|
||||
"indices": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"animations": [
|
||||
{
|
||||
"name": "Cube.003|Cube.002Action",
|
||||
"channels": [
|
||||
{
|
||||
"sampler": 0,
|
||||
"target": {
|
||||
"node": 1,
|
||||
"path": "translation"
|
||||
}
|
||||
},
|
||||
{
|
||||
"sampler": 1,
|
||||
"target": {
|
||||
"node": 1,
|
||||
"path": "rotation"
|
||||
}
|
||||
},
|
||||
{
|
||||
"sampler": 2,
|
||||
"target": {
|
||||
"node": 1,
|
||||
"path": "scale"
|
||||
}
|
||||
}
|
||||
],
|
||||
"samplers": [
|
||||
{
|
||||
"input": 0,
|
||||
"interpolation": "LINEAR",
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"interpolation": "LINEAR",
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"interpolation": "LINEAR",
|
||||
"output": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"name": "RootNode",
|
||||
"translation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"rotation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"scale": [
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Cube.003",
|
||||
"translation": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"rotation": [
|
||||
0.289807051420212,
|
||||
0.644989848136902,
|
||||
0.644989788532257,
|
||||
-0.289807081222534
|
||||
],
|
||||
"scale": [
|
||||
93.5872116088867,
|
||||
93.5872116088867,
|
||||
93.5872116088867
|
||||
],
|
||||
"mesh": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://0nt2837hvq0i"
|
||||
path="res://.godot/imported/Magazine.gltf-e920a32b66e939dfd1525af61d83f29d.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/UZI_MAGAZINE/Magazine.gltf"
|
||||
dest_files=["res://.godot/imported/Magazine.gltf-e920a32b66e939dfd1525af61d83f29d.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
@@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://qc35m1a5gq81"
|
||||
path="res://.godot/imported/Uzi.glb-866af1e12117b5342702c3f3313b68b1.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Weapons/Uzi/Uzi.glb"
|
||||
dest_files=["res://.godot/imported/Uzi.glb-866af1e12117b5342702c3f3313b68b1.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
|
Before Width: | Height: | Size: 35 KiB |
55
assets/shader/Viewmodel.gdshader
Normal file
@@ -0,0 +1,55 @@
|
||||
shader_type spatial;
|
||||
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
|
||||
|
||||
uniform float viewmodel_fov = 50.0f;
|
||||
|
||||
uniform vec4 albedo = vec4(1.0);
|
||||
uniform sampler2D texture_albedo;
|
||||
uniform float specular = 0.5f;
|
||||
uniform float metallic = 1.0f;
|
||||
uniform float roughness : hint_range(0,1) = 1.0f;
|
||||
uniform float point_size : hint_range(0,128);
|
||||
uniform sampler2D texture_metallic;
|
||||
uniform vec4 metallic_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
uniform sampler2D texture_roughness;
|
||||
uniform vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
//uniform sampler2D texture_emission : hint_black_albedo;
|
||||
//uniform vec4 emission : hint_color;
|
||||
//uniform float emission_energy;
|
||||
uniform sampler2D texture_normal : hint_normal;
|
||||
uniform float normal_scale : hint_range(-16,16) = 0.5f;
|
||||
uniform vec3 uv1_scale = vec3(1.0f);
|
||||
uniform vec3 uv1_offset = vec3(0.0f);
|
||||
uniform vec3 uv2_scale = vec3(1.0f);
|
||||
uniform vec3 uv2_offset = vec3(0.0f);
|
||||
|
||||
void vertex() {
|
||||
UV = UV * uv1_scale.xy + uv1_offset.xy;
|
||||
|
||||
/* begin shader magic*/
|
||||
float onetanfov = 1.0f / tan(0.5f * (viewmodel_fov * PI / 180.0f));
|
||||
float aspect = VIEWPORT_SIZE.x / VIEWPORT_SIZE.y;
|
||||
// modify projection matrix
|
||||
PROJECTION_MATRIX[1][1] = onetanfov;
|
||||
PROJECTION_MATRIX[0][0] = onetanfov / aspect;
|
||||
// draws the viewmodel over everything (disable if you want dof near on viewmodel)
|
||||
POSITION = PROJECTION_MATRIX * MODELVIEW_MATRIX * vec4(VERTEX.xyz, 1.0);
|
||||
POSITION.z = mix(POSITION.z, 0, 0.999);
|
||||
/* end shader magic */
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 base_uv = UV;
|
||||
vec4 albedo_tex = texture(texture_albedo,base_uv);
|
||||
albedo_tex *= COLOR;
|
||||
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
||||
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
|
||||
METALLIC = metallic_tex * metallic;
|
||||
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
|
||||
ROUGHNESS = roughness_tex * roughness;
|
||||
SPECULAR = specular;
|
||||
NORMAL_MAP = texture(texture_normal,base_uv).rgb;
|
||||
NORMAL_MAP_DEPTH = normal_scale;
|
||||
//vec3 emission_tex = texture(texture_emission,base_uv).rgb;
|
||||
//EMISSION = (emission.rgb+emission_tex)*emission_energy;
|
||||
}
|
||||
9
assets/shader/no_depth.gdshader
Normal file
@@ -0,0 +1,9 @@
|
||||
shader_type spatial;
|
||||
render_mode cull_back;
|
||||
|
||||
uniform float z_offset : hint_range(-1, 1);
|
||||
|
||||
void fragment() {
|
||||
// write the final depth value to the depth buffer
|
||||
DEPTH = 0.9;
|
||||
}
|
||||
14
assets/shader/test.tscn
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://tojfiub8y1f6"]
|
||||
|
||||
[ext_resource type="Shader" path="res://assets/shader/no_depth.gdshader" id="2_lklwv"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_5pubw"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("2_lklwv")
|
||||
shader_parameter/z_offset = null
|
||||
|
||||
[node name="Chainsaw_test"]
|
||||
|
||||
[node name="Cube014" parent="." index="0"]
|
||||
material_override = SubResource("ShaderMaterial_5pubw")
|
||||
transparency = 0.02
|
||||
@@ -1,7 +0,0 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="Sky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
100
entities/Player.tscn
Normal file
@@ -0,0 +1,100 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bl7jynld7s25o"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/player/PlayerQ3.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scripts/player/Weapons.gd" id="2_dl1i1"]
|
||||
[ext_resource type="Texture2D" uid="uid://17b1nu8spjfi" path="res://textures/icon.png" id="2_mxb5i"]
|
||||
[ext_resource type="Shader" path="res://assets/shader/crosshair.gdshader" id="3_3vnqi"]
|
||||
[ext_resource type="Script" path="res://entities/PlayerSync.gd" id="5_828co"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6d8kk"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ikq67"]
|
||||
albedo_texture = ExtResource("2_mxb5i")
|
||||
uv1_scale = Vector3(3, 2, 1)
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_4e7dm"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_08bwh"]
|
||||
shader = ExtResource("3_3vnqi")
|
||||
shader_parameter/center_enabled = null
|
||||
shader_parameter/legs_enabled = null
|
||||
shader_parameter/inverted = null
|
||||
shader_parameter/color_id = null
|
||||
shader_parameter/color_0 = null
|
||||
shader_parameter/color_1 = null
|
||||
shader_parameter/color_2 = null
|
||||
shader_parameter/center_radius = null
|
||||
shader_parameter/width = null
|
||||
shader_parameter/len = null
|
||||
shader_parameter/spacing = null
|
||||
shader_parameter/spread = null
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rfdcv"]
|
||||
properties/0/path = NodePath("Body/Head:rotation")
|
||||
properties/0/spawn = true
|
||||
properties/0/sync = true
|
||||
properties/1/path = NodePath("Body:rotation")
|
||||
properties/1/spawn = true
|
||||
properties/1/sync = true
|
||||
properties/2/path = NodePath("Networking:player_state")
|
||||
properties/2/spawn = false
|
||||
properties/2/sync = true
|
||||
properties/3/path = NodePath("Networking:sync_position")
|
||||
properties/3/spawn = true
|
||||
properties/3/sync = false
|
||||
properties/4/path = NodePath("Networking:sync_velocity")
|
||||
properties/4/spawn = true
|
||||
properties/4/sync = false
|
||||
|
||||
[node name="PlayerQ3" type="CharacterBody3D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("CylinderShape3D_6d8kk")
|
||||
|
||||
[node name="Body" type="Node3D" parent="."]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
material_override = SubResource("StandardMaterial3D_ikq67")
|
||||
mesh = SubResource("CylinderMesh_4e7dm")
|
||||
skeleton = NodePath("../../CollisionShape3D")
|
||||
|
||||
[node name="Head" type="Node3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.75, 0)
|
||||
|
||||
[node name="Hand" type="Node3D" parent="Body/Head"]
|
||||
script = ExtResource("2_dl1i1")
|
||||
|
||||
[node name="Crosshair" type="ColorRect" parent="Body/Head/Hand"]
|
||||
material = SubResource("ShaderMaterial_08bwh")
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Body/Head"]
|
||||
cull_mask = 1048573
|
||||
current = true
|
||||
|
||||
[node name="AimCast" type="RayCast3D" parent="Body/Head/Camera3D"]
|
||||
target_position = Vector3(0, 0, -1)
|
||||
collision_mask = 512
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer"]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 14.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Networking" type="Node" parent="."]
|
||||
script = ExtResource("5_828co")
|
||||
|
||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="Networking"]
|
||||
root_path = NodePath("../..")
|
||||
replication_config = SubResource("SceneReplicationConfig_rfdcv")
|
||||
31
entities/PlayerSync.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
extends Node
|
||||
|
||||
###SYNC PLAYER###
|
||||
const PLAYER_STATE_SIZE = 13
|
||||
var player_state:
|
||||
get:
|
||||
var buf = PackedByteArray()
|
||||
buf.resize(PLAYER_STATE_SIZE)
|
||||
buf.encode_half(0, sync_position.x)
|
||||
buf.encode_half(2, sync_position.y)
|
||||
buf.encode_half(4, sync_position.z)
|
||||
buf.encode_half(6, sync_velocity.x)
|
||||
buf.encode_half(8, sync_velocity.y)
|
||||
buf.encode_half(10, sync_velocity.z)
|
||||
return buf
|
||||
set(value):
|
||||
assert(typeof(value) == TYPE_PACKED_BYTE_ARRAY and value.size() == PLAYER_STATE_SIZE,
|
||||
"Invalid `player_state` array type or size (must be TYPE_PACKED_BYTE_ARRAY of size 11).")
|
||||
sync_position = Vector3(value.decode_half(0), value.decode_half(2), value.decode_half(4))
|
||||
sync_velocity = Vector3(value.decode_half(6), value.decode_half(8), value.decode_half(10))
|
||||
|
||||
var sync_position : Vector3:
|
||||
set(value):
|
||||
sync_position = value
|
||||
processed_position = false
|
||||
var sync_velocity : Vector3
|
||||
var sync_is_jumping : bool
|
||||
|
||||
var processed_position : bool
|
||||
|
||||
|
||||
BIN
entities/Weapon.scn
Normal file
24
entities/enemy/dummy.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bp5ekvan8qsmc"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/player/Hitable.gd" id="1_f1sho"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_uw38t"]
|
||||
albedo_color = Color(0.85098, 0, 0.172549, 1)
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_3ufk0"]
|
||||
material = SubResource("StandardMaterial3D_uw38t")
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_mfgnk"]
|
||||
|
||||
[node name="Enemy" type="CharacterBody3D"]
|
||||
collision_layer = 512
|
||||
collision_mask = 512
|
||||
script = ExtResource("1_f1sho")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_3ufk0")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("CapsuleShape3D_mfgnk")
|
||||
@@ -9,25 +9,20 @@
|
||||
config_version=5
|
||||
|
||||
_global_script_classes=[{
|
||||
"base": "Node3D",
|
||||
"class": &"Game",
|
||||
"language": &"GDScript",
|
||||
"path": "res://Game.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"class": &"Hitable",
|
||||
"language": &"GDScript",
|
||||
"path": "res://scripts/player/Hitable.gd"
|
||||
}, {
|
||||
"base": "RefCounted",
|
||||
"class": &"SfxrGenerator",
|
||||
"base": "EditorPlugin",
|
||||
"class": &"TBPlugin",
|
||||
"language": &"GDScript",
|
||||
"path": "res://addons/godot_sfxr/SfxrGenerator.gd"
|
||||
}, {
|
||||
"base": "Object",
|
||||
"class": &"SfxrGlobals",
|
||||
"language": &"GDScript",
|
||||
"path": "res://addons/godot_sfxr/SfxrGlobals.gd"
|
||||
}, {
|
||||
"base": "Object",
|
||||
"class": &"SfxrStreamPlayerInterface",
|
||||
"language": &"GDScript",
|
||||
"path": "res://addons/godot_sfxr/SfxrStreamPlayerInterface.gd"
|
||||
"path": "res://addons/tbloader/src/plugin.gd"
|
||||
}, {
|
||||
"base": "Node3D",
|
||||
"class": &"Weapon",
|
||||
@@ -35,20 +30,24 @@ _global_script_classes=[{
|
||||
"path": "res://scripts/player/Weapon.gd"
|
||||
}]
|
||||
_global_script_class_icons={
|
||||
"Game": "",
|
||||
"Hitable": "",
|
||||
"SfxrGenerator": "",
|
||||
"SfxrGlobals": "",
|
||||
"SfxrStreamPlayerInterface": "",
|
||||
"TBPlugin": "",
|
||||
"Weapon": ""
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Scoom"
|
||||
run/main_scene="res://Game.tscn"
|
||||
run/main_scene="res://scenes/map/Game.tscn"
|
||||
config/features=PackedStringArray("4.0")
|
||||
config/icon="res://textures/icon.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
Runtimeloader="*res://scripts/utils/runtimeloader.gd"
|
||||
Network="*res://scripts/utils/network.gd"
|
||||
|
||||
[display]
|
||||
|
||||
window/stretch/mode="2d"
|
||||
@@ -59,7 +58,7 @@ window/size/test_height=720
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/godot_sfxr/plugin.cfg")
|
||||
enabled=PackedStringArray("res://addons/tbloader/plugin.cfg")
|
||||
|
||||
[input]
|
||||
|
||||
@@ -115,4 +114,8 @@ common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/default_filters/use_nearest_mipmap_filter=true
|
||||
textures/default_filters/anisotropic_filtering_level=4
|
||||
textures/canvas_textures/default_texture_filter=2
|
||||
textures/canvas_textures/default_texture_repeat=1
|
||||
environment/default_environment="res://default_env.tres"
|
||||
|
||||
57
scenes/GUI/MAIN.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://3o430r2kys4k"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/GUI/main.gd" id="1_i8nr4"]
|
||||
|
||||
[node name="MAIN" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_i8nr4")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -198.0
|
||||
offset_top = -104.0
|
||||
offset_right = 199.0
|
||||
offset_bottom = 64.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 2
|
||||
|
||||
[node name="Start" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Start Game"
|
||||
|
||||
[node name="ModsMenu" type="MenuButton" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Select Mod"
|
||||
flat = false
|
||||
item_count = 2
|
||||
popup/item_0/text = "test1"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "test2"
|
||||
popup/item_1/id = 1
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="SettingsButton" type="Button" parent="VBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Game Settings"
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="ExitButton" type="Button" parent="VBoxContainer/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Exit"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Start" to="." method="_on_start_pressed"]
|
||||
26
scenes/GUI/Main Menu.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dsnlwjofq6psf"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/GUI/MainMenu.gd" id="1_23sw7"]
|
||||
[ext_resource type="PackedScene" uid="uid://3o430r2kys4k" path="res://scenes/GUI/MAIN.tscn" id="1_sojs8"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0kkhtesg83g" path="res://scenes/GUI/START_GAME.tscn" id="2_ipoll"]
|
||||
|
||||
[node name="Main Menu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_23sw7")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="MAIN" parent="." instance=ExtResource("1_sojs8")]
|
||||
|
||||
[node name="START GAME" parent="." instance=ExtResource("2_ipoll")]
|
||||
visible = false
|
||||
|
||||
[connection signal="start_game" from="MAIN" to="." method="_on_main_start_game"]
|
||||
[connection signal="back" from="START GAME" to="." method="_on_start_game_back"]
|
||||
[connection signal="start_game" from="START GAME" to="." method="_on_start_game_start_game"]
|
||||
25
scenes/GUI/MainMenu.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends Control
|
||||
|
||||
@onready var game = get_tree().get_current_scene() as Game
|
||||
@onready var previous = $MAIN
|
||||
@onready var current = $MAIN
|
||||
|
||||
func _on_main_start_game():
|
||||
previous = current
|
||||
current = $"START GAME"
|
||||
$"START GAME".show()
|
||||
|
||||
func back():
|
||||
current.hide()
|
||||
previous.show()
|
||||
var tmp = current
|
||||
current = previous
|
||||
previous = tmp
|
||||
|
||||
func _on_start_game_start_game():
|
||||
game.load_map()
|
||||
self.hide()
|
||||
|
||||
func _on_start_game_back():
|
||||
previous = $MAIN
|
||||
back()
|
||||
62
scenes/GUI/START_GAME.tscn
Normal file
@@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d0kkhtesg83g"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/GUI/start_game.gd" id="1_amknd"]
|
||||
|
||||
[node name="START GAME" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_amknd")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -198.0
|
||||
offset_top = -104.0
|
||||
offset_right = 199.0
|
||||
offset_bottom = 64.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="HostContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 2
|
||||
|
||||
[node name="HostButton" type="Button" parent="VBoxContainer/HostContainer"]
|
||||
layout_mode = 2
|
||||
text = "Host"
|
||||
|
||||
[node name="JoinContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 2
|
||||
|
||||
[node name="IPAdress" type="TextEdit" parent="VBoxContainer/JoinContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 13
|
||||
placeholder_text = "localhost"
|
||||
|
||||
[node name="JoinButton" type="Button" parent="VBoxContainer/JoinContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
text = "Join
|
||||
"
|
||||
|
||||
[node name="BackContainer" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="BackButton" type="Button" parent="VBoxContainer/BackContainer"]
|
||||
layout_mode = 2
|
||||
text = "Back"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HostContainer/HostButton" to="." method="_on_host_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/JoinContainer/JoinButton" to="." method="_on_join_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/BackContainer/BackButton" to="." method="_on_back_button_pressed"]
|
||||
7
scenes/GUI/main.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
extends Control
|
||||
|
||||
signal start_game;
|
||||
|
||||
func _on_start_pressed():
|
||||
start_game.emit()
|
||||
hide()
|
||||
27
scenes/GUI/start_game.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Control
|
||||
|
||||
@onready var IPAdress_Field = $VBoxContainer/JoinContainer/IPAdress as TextEdit
|
||||
signal start_game
|
||||
signal back
|
||||
|
||||
func _on_join_button_pressed():
|
||||
if not try_connection():
|
||||
return
|
||||
Network.start_network(false, IPAdress_Field.text)
|
||||
start_game.emit()
|
||||
|
||||
|
||||
func try_connection():
|
||||
if IPAdress_Field.text.is_empty():
|
||||
return false
|
||||
return true
|
||||
|
||||
|
||||
func _on_host_button_pressed():
|
||||
Network.start_network(true)
|
||||
start_game.emit()
|
||||
|
||||
|
||||
func _on_back_button_pressed():
|
||||
hide()
|
||||
back.emit()
|
||||
5
scenes/map/EntitySpawner.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends MultiplayerSpawner
|
||||
|
||||
|
||||
func _spawn_custom(data):
|
||||
return
|
||||
39
scenes/map/Game.tscn
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://8g7w4uv2xsck"]
|
||||
|
||||
[ext_resource type="Script" path="res://Game.gd" id="1_71dcv"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsnlwjofq6psf" path="res://scenes/GUI/Main Menu.tscn" id="2_448f8"]
|
||||
|
||||
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_2n8qo"]
|
||||
|
||||
[sub_resource type="Sky" id="Sky_ybtis"]
|
||||
sky_material = SubResource("PhysicalSkyMaterial_2n8qo")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_oqaam"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_ybtis")
|
||||
ambient_light_source = 3
|
||||
reflected_light_source = 2
|
||||
tonemap_mode = 2
|
||||
tonemap_exposure = 2.0
|
||||
ssao_enabled = true
|
||||
volumetric_fog_density = 0.02
|
||||
adjustment_enabled = true
|
||||
adjustment_saturation = 1.27
|
||||
|
||||
[node name="Game" type="Node3D"]
|
||||
script = ExtResource("1_71dcv")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.92272, 0.189417, -0.335722, 0.371956, -0.208918, 0.904435, 0.101177, -0.959414, -0.263228, 13.9136, 14.2605, -2.0311)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_oqaam")
|
||||
|
||||
[node name="Main Menu" parent="." instance=ExtResource("2_448f8")]
|
||||
|
||||
[node name="Networking" type="Node" parent="."]
|
||||
|
||||
[node name="PlayerSpawner" type="MultiplayerSpawner" parent="Networking"]
|
||||
_spawnable_scenes = PackedStringArray("res://entities/Player.tscn")
|
||||
spawn_path = NodePath("..")
|
||||
129
scenes/map/Map_TB.tscn
Normal file
193
scenes/map/test.map
Normal file
@@ -0,0 +1,193 @@
|
||||
// Game: Godot
|
||||
// Format: Standard
|
||||
// entity 0
|
||||
{
|
||||
"classname" "worldspawn"
|
||||
"_tb_textures" "textures"
|
||||
// brush 0
|
||||
{
|
||||
( -800 -272 -32 ) ( -800 -264.875 -32 ) ( -800 -272 -31 ) concrete_15 0 0 0 1 1
|
||||
( -816 0 -32 ) ( -816 0 -31 ) ( -808.625 0 -32 ) concrete_15 0 0 0 1 1
|
||||
( -816 -272 -32 ) ( -808.625 -272 -32 ) ( -816 -264.875 -32 ) concrete_15 0 0 0 1 1
|
||||
( 128 640 0 ) ( 128 647.125 0 ) ( 135.375 640 0 ) concrete_15 0 0 0 1 1
|
||||
( 128 1344 0 ) ( 135.375 1344 0 ) ( 128 1344 1 ) concrete_15 0 0 0 1 1
|
||||
( 0 640 0 ) ( 0 640 1 ) ( 0 647.125 0 ) concrete_15 0 0 0 1 1
|
||||
}
|
||||
// brush 1
|
||||
{
|
||||
( -800 0 80 ) ( -800 1 80 ) ( -800 0 81 ) dark 0 512 0 0.015625 0.015625
|
||||
( -800 0 80 ) ( -800 0 81 ) ( -799 0 80 ) dark 0 512 0 0.015625 0.015625
|
||||
( -800 0 0 ) ( -799 0 0 ) ( -800 1 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -736 144 208 ) ( -736 145 208 ) ( -735 144 208 ) dark 0 512 0 0.015625 0.015625
|
||||
( -736 1344 96 ) ( -735 1344 96 ) ( -736 1344 97 ) dark 0 512 0 0.015625 0.015625
|
||||
( -784 144 96 ) ( -784 144 97 ) ( -784 145 96 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 2
|
||||
{
|
||||
( -784 0 208 ) ( -784 1 208 ) ( -784 0 209 ) dark 0 512 180 0.015625 0.015625
|
||||
( -80 0 208 ) ( -80 0 209 ) ( -79 0 208 ) dark 0 512 180 0.015625 0.015625
|
||||
( -80 0 0 ) ( -79 0 0 ) ( -80 1 0 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 16 208 ) ( 0 17 208 ) ( 1 16 208 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 16 224 ) ( 1 16 224 ) ( 0 16 225 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 16 224 ) ( 0 16 225 ) ( 0 17 224 ) dark 0 512 180 0.015625 0.015625
|
||||
}
|
||||
// brush 3
|
||||
{
|
||||
( -16 496 0 ) ( -16 497 0 ) ( -16 496 1 ) dark 0 512 180 0.015625 0.015625
|
||||
( -32 16 0 ) ( -32 16 1 ) ( -31 16 0 ) dark 0 512 180 0.015625 0.015625
|
||||
( -32 496 0 ) ( -31 496 0 ) ( -32 497 0 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 624 208 ) ( 0 625 208 ) ( 1 624 208 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 1344 16 ) ( 1 1344 16 ) ( 0 1344 17 ) dark 0 512 180 0.015625 0.015625
|
||||
( 0 624 16 ) ( 0 624 17 ) ( 0 625 16 ) dark 0 512 180 0.015625 0.015625
|
||||
}
|
||||
// brush 4
|
||||
{
|
||||
( -784 1328 0 ) ( -784 1329 0 ) ( -784 1328 1 ) dark 0 512 0 0.015625 0.015625
|
||||
( -576 1328 0 ) ( -576 1328 1 ) ( -575 1328 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -576 1328 0 ) ( -575 1328 0 ) ( -576 1329 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 1344 208 ) ( -16 1345 208 ) ( -15 1344 208 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 1344 16 ) ( -15 1344 16 ) ( -16 1344 17 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 1344 16 ) ( -16 1344 17 ) ( -16 1345 16 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 5
|
||||
{
|
||||
( -784 752 0 ) ( -784 752 96 ) ( -784 432 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -784 752 96 ) ( -592 752 96 ) ( -592 432 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -592 432 0 ) ( -592 752 0 ) ( -784 752 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -592 752 0 ) ( -592 752 96 ) ( -784 752 96 ) dark 0 512 0 0.015625 0.015625
|
||||
( -592 432 0 ) ( -592 752 96 ) ( -592 752 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 6
|
||||
{
|
||||
( -80 256 0 ) ( -16 256 72 ) ( -16 208 72 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 208 0 ) ( -16 208 72 ) ( -16 208 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 208 0 ) ( -16 256 0 ) ( -80 256 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 256 0 ) ( -16 256 72 ) ( -80 256 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 208 72 ) ( -16 256 72 ) ( -16 256 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 7
|
||||
{
|
||||
( -80 336 0 ) ( -16 336 80 ) ( -16 288 80 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 288 0 ) ( -16 288 80 ) ( -16 288 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 288 0 ) ( -16 336 0 ) ( -80 336 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 336 0 ) ( -16 336 80 ) ( -80 336 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 288 80 ) ( -16 336 80 ) ( -16 336 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 8
|
||||
{
|
||||
( -80 416 16 ) ( -80 368 16 ) ( -80 368 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 368 16 ) ( -16 368 16 ) ( -16 368 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 368 0 ) ( -16 416 0 ) ( -80 416 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 416 16 ) ( -16 416 16 ) ( -16 368 16 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 416 0 ) ( -16 416 16 ) ( -80 416 16 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 368 16 ) ( -16 416 16 ) ( -16 416 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 9
|
||||
{
|
||||
( -80 544 32 ) ( -80 496 32 ) ( -80 496 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 496 32 ) ( -16 496 32 ) ( -16 496 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 496 0 ) ( -16 544 0 ) ( -80 544 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 544 32 ) ( -16 544 32 ) ( -16 496 32 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 544 0 ) ( -16 544 32 ) ( -80 544 32 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 496 32 ) ( -16 544 32 ) ( -16 544 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 10
|
||||
{
|
||||
( -80 480 24 ) ( -80 432 24 ) ( -80 432 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 432 24 ) ( -16 432 24 ) ( -16 432 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 432 0 ) ( -16 480 0 ) ( -80 480 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 480 24 ) ( -16 480 24 ) ( -16 432 24 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 480 0 ) ( -16 480 24 ) ( -80 480 24 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 432 24 ) ( -16 480 24 ) ( -16 480 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 11
|
||||
{
|
||||
( -80 608 40 ) ( -80 560 40 ) ( -80 560 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 560 40 ) ( -16 560 40 ) ( -16 560 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 560 0 ) ( -16 608 0 ) ( -80 608 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 608 40 ) ( -16 608 40 ) ( -16 560 40 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 608 0 ) ( -16 608 40 ) ( -80 608 40 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 560 40 ) ( -16 608 40 ) ( -16 608 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 12
|
||||
{
|
||||
( -80 176 0 ) ( -16 176 64 ) ( -16 128 64 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 128 0 ) ( -16 128 64 ) ( -16 128 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 128 0 ) ( -16 176 0 ) ( -80 176 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 176 0 ) ( -16 176 64 ) ( -80 176 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 128 64 ) ( -16 176 64 ) ( -16 176 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 13
|
||||
{
|
||||
( -80 96 56 ) ( -80 80 56 ) ( -80 80 40 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 80 56 ) ( -64 80 56 ) ( -64 80 40 ) dark 0 512 0 0.015625 0.015625
|
||||
( -64 80 40 ) ( -64 96 40 ) ( -80 96 40 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 96 56 ) ( -64 96 56 ) ( -64 80 56 ) dark 0 512 0 0.015625 0.015625
|
||||
( -64 96 40 ) ( -64 96 56 ) ( -80 96 56 ) dark 0 512 0 0.015625 0.015625
|
||||
( -64 80 56 ) ( -64 96 56 ) ( -64 96 40 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 14
|
||||
{
|
||||
( -80 672 48 ) ( -80 624 48 ) ( -80 624 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 624 48 ) ( -16 624 48 ) ( -16 624 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 624 0 ) ( -16 672 0 ) ( -80 672 0 ) dark 0 512 0 0.015625 0.015625
|
||||
( -80 672 48 ) ( -16 672 48 ) ( -16 624 48 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 672 0 ) ( -16 672 48 ) ( -80 672 48 ) dark 0 512 0 0.015625 0.015625
|
||||
( -16 624 48 ) ( -16 672 48 ) ( -16 672 0 ) dark 0 512 0 0.015625 0.015625
|
||||
}
|
||||
// brush 15
|
||||
{
|
||||
( -467.7128129211019 637.2820323027552 64 ) ( -383.712812921102 491.7897644669695 64 ) ( -383.712812921102 491.7897644669695 0 ) shipping_container_01_side -175.73987 0 0 0.4330127 0.5
|
||||
( -412.2871870788979 669.2820323027552 0 ) ( -412.2871870788979 669.2820323027552 64 ) ( -467.7128129211019 637.2820323027552 64 ) shipping_container_01_front 63.30011 1.3402672 0 0.42977914 0.49051714
|
||||
( -328.2871870788979 523.7897644669695 0 ) ( -412.2871870788979 669.2820323027552 0 ) ( -467.7128129211019 637.2820323027552 0 ) shipping_container_01_side -38.589844 9.75885 30 1 1
|
||||
( -467.7128129211019 637.2820323027552 64 ) ( -412.2871870788979 669.2820323027552 64 ) ( -328.2871870788979 523.7897644669695 64 ) shipping_container_01_front -75.654724 84.19873 30 0.4645997 1.319437
|
||||
( -383.712812921102 491.7897644669695 64 ) ( -328.2871870788979 523.7897644669695 64 ) ( -328.2871870788979 523.7897644669695 0 ) shipping_container_01_front 1.0908203 0 0 0.426851 0.49832597
|
||||
( -328.2871870788979 523.7897644669695 64 ) ( -412.2871870788979 669.2820323027552 64 ) ( -412.2871870788979 669.2820323027552 0 ) shipping_container_01_side -249.64062 0 0 0.4330127 0.5
|
||||
}
|
||||
// brush 16
|
||||
{
|
||||
( -784 1120 80 ) ( -784 1121 80 ) ( -784 1120 81 ) __TB_empty 0 0 0 1 1
|
||||
( -784 1120 80 ) ( -784 1120 81 ) ( -783 1120 80 ) __TB_empty 0 0 0 1 1
|
||||
( -784 1120 80 ) ( -783 1120 80 ) ( -784 1121 80 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 96 ) ( -640 1345 96 ) ( -639 1344 96 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 96 ) ( -639 1344 96 ) ( -640 1344 97 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 96 ) ( -640 1344 97 ) ( -640 1345 96 ) __TB_empty 0 0 0 1 1
|
||||
}
|
||||
// brush 17
|
||||
{
|
||||
( -784 1120 0 ) ( -784 1121 0 ) ( -784 1120 1 ) __TB_empty 0 0 0 1 1
|
||||
( -784 1120 0 ) ( -784 1120 1 ) ( -783 1120 0 ) __TB_empty 0 0 0 1 1
|
||||
( -784 1120 0 ) ( -783 1120 0 ) ( -784 1121 0 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1136 80 ) ( -640 1137 80 ) ( -639 1136 80 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1136 80 ) ( -639 1136 80 ) ( -640 1136 81 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1136 80 ) ( -640 1136 81 ) ( -640 1137 80 ) __TB_empty 0 0 0 1 1
|
||||
}
|
||||
// brush 18
|
||||
{
|
||||
( -656 1168 0 ) ( -656 1169 0 ) ( -656 1168 1 ) __TB_empty 0 0 0 1 1
|
||||
( -656 1168 0 ) ( -656 1168 1 ) ( -655 1168 0 ) __TB_empty 0 0 0 1 1
|
||||
( -656 1168 0 ) ( -655 1168 0 ) ( -656 1169 0 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 80 ) ( -640 1345 80 ) ( -639 1344 80 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 80 ) ( -639 1344 80 ) ( -640 1344 81 ) __TB_empty 0 0 0 1 1
|
||||
( -640 1344 80 ) ( -640 1344 81 ) ( -640 1345 80 ) __TB_empty 0 0 0 1 1
|
||||
}
|
||||
// brush 19
|
||||
{
|
||||
( -736 1232 0 ) ( -736 1233 0 ) ( -736 1232 1 ) __TB_empty 0 0 0 1 1
|
||||
( -736 1232 0 ) ( -736 1232 1 ) ( -735 1232 0 ) __TB_empty 0 0 0 1 1
|
||||
( -736 1232 0 ) ( -735 1232 0 ) ( -736 1233 0 ) __TB_empty 0 0 0 1 1
|
||||
( -704 1264 32 ) ( -704 1265 32 ) ( -703 1264 32 ) __TB_empty 0 0 0 1 1
|
||||
( -704 1264 32 ) ( -703 1264 32 ) ( -704 1264 33 ) __TB_empty 0 0 0 1 1
|
||||
( -704 1264 32 ) ( -704 1264 33 ) ( -704 1265 32 ) __TB_empty 0 0 0 1 1
|
||||
}
|
||||
}
|
||||
// entity 1
|
||||
{
|
||||
"classname" "light"
|
||||
"origin" "-724 1324 44"
|
||||
}
|
||||
// entity 2
|
||||
{
|
||||
"classname" "Player"
|
||||
"origin" "-560 304 16"
|
||||
}
|
||||
15
scenes/map/test.mtl
Normal file
@@ -0,0 +1,15 @@
|
||||
newmtl __TB_empty
|
||||
map_Kd textures/__TB_empty.png
|
||||
|
||||
newmtl concrete_15
|
||||
map_Kd textures/concrete_15.jpg
|
||||
|
||||
newmtl dark
|
||||
map_Kd textures/dark.png
|
||||
|
||||
newmtl shipping_container_01_front
|
||||
map_Kd textures/shipping_container_01_front.jpg
|
||||
|
||||
newmtl shipping_container_01_side
|
||||
map_Kd textures/shipping_container_01_side.jpg
|
||||
|
||||
21
scenes/map/test.obj.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wavefront_obj"
|
||||
importer_version=1
|
||||
type="Mesh"
|
||||
uid="uid://dp182aa7i4tc2"
|
||||
path="res://.godot/imported/test.obj-d0933098473ad0b52c714a3e29132649.mesh"
|
||||
|
||||
[deps]
|
||||
|
||||
files=["res://.godot/imported/test.obj-d0933098473ad0b52c714a3e29132649.mesh"]
|
||||
|
||||
source_file="res://scenes/map/test.obj"
|
||||
dest_files=["res://.godot/imported/test.obj-d0933098473ad0b52c714a3e29132649.mesh", "res://.godot/imported/test.obj-d0933098473ad0b52c714a3e29132649.mesh"]
|
||||
|
||||
[params]
|
||||
|
||||
generate_tangents=true
|
||||
scale_mesh=Vector3(1, 1, 1)
|
||||
offset_mesh=Vector3(0, 0, 0)
|
||||
optimize_mesh=true
|
||||
83
scenes/map/test_map_gd.tscn
Normal file
@@ -1,52 +0,0 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bl7jynld7s25o"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/player/PlayerQ3.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scripts/player/Weapons.gd" id="2_dl1i1"]
|
||||
[ext_resource type="Shader" path="res://assets/shader/crosshair.gdshader" id="3_3vnqi"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="1"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mqdp4"]
|
||||
shader = ExtResource("3_3vnqi")
|
||||
shader_parameter/center_enabled = null
|
||||
shader_parameter/center_radius = null
|
||||
shader_parameter/color_0 = null
|
||||
shader_parameter/color_1 = null
|
||||
shader_parameter/color_2 = null
|
||||
shader_parameter/color_id = null
|
||||
shader_parameter/inverted = null
|
||||
shader_parameter/legs_enabled = null
|
||||
shader_parameter/len = null
|
||||
shader_parameter/spacing = null
|
||||
shader_parameter/spread = null
|
||||
shader_parameter/width = null
|
||||
|
||||
[node name="PlayerQ3" type="CharacterBody3D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("1")
|
||||
|
||||
[node name="Body" type="Node3D" parent="."]
|
||||
|
||||
[node name="Head" type="Node3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.75, 0)
|
||||
|
||||
[node name="Hand" type="Node3D" parent="Body/Head"]
|
||||
script = ExtResource("2_dl1i1")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Body/Head/Hand"]
|
||||
material = SubResource("ShaderMaterial_mqdp4")
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Body/Head"]
|
||||
current = true
|
||||
|
||||
[node name="AimCast" type="RayCast3D" parent="Body/Head/Camera3D"]
|
||||
target_position = Vector3(0, 0, -1)
|
||||
collision_mask = 512
|
||||
@@ -1,11 +0,0 @@
|
||||
extends Node3D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
@@ -1,5 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://p3r1q0d3ibmj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d3sl3ypfxbfmw" path="res://assets/Weapons/Revolver/Revolver.glb" id="1_8hkoy"]
|
||||
|
||||
[node name="Revolver" instance=ExtResource("1_8hkoy")]
|
||||
@@ -1,8 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://qc35m1a5gq81" path="res://assets/Weapons/Uzi/Uzi.glb" id="1_np5ff"]
|
||||
|
||||
[node name="Uzi" instance=ExtResource("1_np5ff")]
|
||||
|
||||
[node name="Cube024" parent="." index="0"]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, 0)
|
||||
1
scoom
Submodule
@@ -1,5 +1,10 @@
|
||||
extends Node
|
||||
class_name Hitable
|
||||
|
||||
func Hit():
|
||||
print("Got hit")
|
||||
var health = 200
|
||||
|
||||
func Hit(dmg):
|
||||
#var tween = create_tween()
|
||||
health -= dmg
|
||||
if(health <= 0):
|
||||
queue_free()
|
||||
|
||||
@@ -2,6 +2,9 @@ extends CharacterBody3D
|
||||
|
||||
const DIST_FLOOR_SNAP := Vector3.DOWN * 0.2
|
||||
|
||||
@onready var label : Label = $CanvasLayer/Label
|
||||
@onready var networking = $Networking
|
||||
|
||||
@onready var body : Node3D = $Body
|
||||
@onready var head : Node3D = $Body/Head
|
||||
@onready var cam : Camera3D = $Body/Head/Camera3D
|
||||
@@ -26,9 +29,27 @@ const DIST_FLOOR_SNAP := Vector3.DOWN * 0.2
|
||||
|
||||
var floor_snap := Vector3.ZERO
|
||||
|
||||
func _enter_tree():
|
||||
$Networking/MultiplayerSynchronizer.set_multiplayer_authority(str(name).to_int())
|
||||
$Body/Head/Camera3D.current = is_local_authority()
|
||||
if is_local_authority():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
func init():
|
||||
$Body/Head/Hand.set_weapons()
|
||||
|
||||
func is_local_authority():
|
||||
return $Networking/MultiplayerSynchronizer.get_multiplayer_authority() == multiplayer.get_unique_id()
|
||||
|
||||
func _process(_delta):
|
||||
if not is_local_authority():
|
||||
return
|
||||
label.text = "H Velocity: %3.2f" % [Vector2(velocity.x, velocity.z).length()]
|
||||
label.text += "\nV Velocity: %3.2f" % [velocity.y]
|
||||
label.text += "\nOn floor: %s" % is_on_floor()
|
||||
label.text += "\nNetwork ID: %d" % multiplayer.get_unique_id()
|
||||
|
||||
func get_move_direction() -> Vector3:
|
||||
|
||||
var input_dir := Vector2(
|
||||
Input.get_action_strength("move_backward") - Input.get_action_strength("move_forward"),
|
||||
Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
|
||||
@@ -36,18 +57,24 @@ func get_move_direction() -> Vector3:
|
||||
|
||||
return input_dir.x * body.global_transform.basis.z + input_dir.y * body.global_transform.basis.x
|
||||
|
||||
|
||||
func _input(event):
|
||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED and event is InputEventMouseMotion:
|
||||
rotate_look(event.relative * 0.001 * mouse_sensitivity)
|
||||
|
||||
if is_local_authority():
|
||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED and event is InputEventMouseMotion:
|
||||
rotate_look(event.relative * 0.001 * mouse_sensitivity)
|
||||
|
||||
func rotate_look(amount : Vector2) -> void:
|
||||
body.rotation.y -= amount.x
|
||||
head.rotation.x = clamp(head.rotation.x - amount.y, -PI * 0.5, PI * 0.5)
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if !is_local_authority():
|
||||
if not networking.processed_position:
|
||||
position = networking.sync_position
|
||||
networking.processed_position = true
|
||||
velocity = networking.sync_velocity
|
||||
move_and_slide()
|
||||
return
|
||||
|
||||
|
||||
var was_on_floor : bool = is_on_floor()
|
||||
var h_target_dir : Vector3 = get_move_direction()
|
||||
@@ -78,7 +105,9 @@ func _physics_process(delta):
|
||||
floor_snap = DIST_FLOOR_SNAP
|
||||
elif was_on_floor and !is_on_floor():
|
||||
floor_snap = Vector3.ZERO
|
||||
|
||||
|
||||
networking.sync_position = position
|
||||
networking.sync_velocity = velocity
|
||||
|
||||
func accelerate(delta : float, p_target_dir : Vector3, p_target_speed : float, p_accel : float):
|
||||
var current_speed : float = velocity.dot(p_target_dir)
|
||||
@@ -87,10 +116,9 @@ func accelerate(delta : float, p_target_dir : Vector3, p_target_speed : float, p
|
||||
var accel_speed : float = min(add_speed, p_accel * delta * p_target_speed)
|
||||
velocity += p_target_dir * accel_speed
|
||||
|
||||
|
||||
func apply_friction(delta : float):
|
||||
|
||||
var vec : Vector3 = velocity
|
||||
#var vec : Vector3 = velocity
|
||||
var speed : float = velocity.length()
|
||||
if is_zero_approx(speed):
|
||||
velocity = Vector3.ZERO
|
||||
|
||||
@@ -8,6 +8,7 @@ const RELOAD = 3
|
||||
|
||||
const DRAW_TIME = 0.35
|
||||
|
||||
var MELEE : bool
|
||||
var MAX_CLIP : int
|
||||
var DAMAGE : float
|
||||
var MOMENTUM : Vector2
|
||||
@@ -28,53 +29,68 @@ var SHOOTING_SPEED: float
|
||||
var can_shoot : bool
|
||||
var clip : int
|
||||
var state = DEFAULT
|
||||
var tween : Tween
|
||||
|
||||
func stop_tween():
|
||||
if(tween.is_running()):
|
||||
tween.stop()
|
||||
|
||||
func init():
|
||||
visible = true
|
||||
state = DEFAULT
|
||||
SHOOTING_SPEED = 60.0 / RPM
|
||||
var tween = create_tween()
|
||||
if(tween != null && tween.is_running()):
|
||||
tween.stop()
|
||||
|
||||
MODEL.position = DRAW_POS
|
||||
MODEL.rotation = DRAW_ROT
|
||||
|
||||
|
||||
can_shoot = true
|
||||
tween.tween_callback(InitialPos).set_delay(DRAW_TIME)
|
||||
InitialPos(DRAW_TIME, DRAW_TIME)
|
||||
|
||||
|
||||
|
||||
|
||||
func InitialPos():
|
||||
var tween = create_tween()
|
||||
func InitialPos(draw_time, ready_time):
|
||||
tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_QUAD)
|
||||
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property(MODEL, "position", Vector3.ZERO, RECOIL_COOLDOWN / 2)
|
||||
tween.tween_property(MODEL, "rotation", Vector3.ZERO, RECOIL_COOLDOWN / 2)
|
||||
tween.tween_callback(func(): state = INITIAL).set_delay(SHOOTING_SPEED / 2)
|
||||
|
||||
|
||||
tween.tween_property(MODEL, "position", Vector3.ZERO, draw_time)
|
||||
tween.tween_property(MODEL, "rotation", Vector3.ZERO, draw_time)
|
||||
tween.tween_callback(func(): state = INITIAL).set_delay(ready_time)
|
||||
|
||||
@rpc
|
||||
func Shoot():
|
||||
if CanShoot():
|
||||
if !FIREMODE:
|
||||
if not FIREMODE:
|
||||
can_shoot = false
|
||||
clip -= 1
|
||||
state = SHOOT;
|
||||
var tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_ELASTIC)
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property(MODEL, "position", Vector3(.0, MOMENTUM.x, MOMENTUM.y), RECOIL_COOLDOWN / 2)
|
||||
var rand_rot_y = randi_range(-ANGULAR_MOMENTUM.y,ANGULAR_MOMENTUM.y)
|
||||
var rand_rot_z = randi_range(-ANGULAR_MOMENTUM.z,ANGULAR_MOMENTUM.z)
|
||||
tween.tween_property(MODEL, "rotation", Vector3(deg_to_rad(ANGULAR_MOMENTUM.x),deg_to_rad(rand_rot_y),deg_to_rad(rand_rot_z)),RECOIL_COOLDOWN /2)
|
||||
tween.tween_callback(InitialPos).set_delay(SHOOTING_SPEED / 2)
|
||||
if not MELEE:
|
||||
clip -= 1
|
||||
rpc("rpc_AnimShoot")
|
||||
return true
|
||||
return false
|
||||
|
||||
@rpc(call_local, any_peer)
|
||||
func rpc_AnimShoot():
|
||||
state = SHOOT;
|
||||
tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_ELASTIC)
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property(MODEL, "position", Vector3(.0, MOMENTUM.x, MOMENTUM.y), RECOIL_COOLDOWN / 2)
|
||||
var rand_rot_y = randf_range(-ANGULAR_MOMENTUM.y,ANGULAR_MOMENTUM.y)
|
||||
var rand_rot_z = randf_range(-ANGULAR_MOMENTUM.z,ANGULAR_MOMENTUM.z)
|
||||
tween.tween_property(MODEL, "rotation", Vector3(deg_to_rad(ANGULAR_MOMENTUM.x),deg_to_rad(rand_rot_y),deg_to_rad(rand_rot_z)),RECOIL_COOLDOWN /2)
|
||||
tween.tween_callback(func(): InitialPos(RECOIL_COOLDOWN / 2, SHOOTING_SPEED / 2)).set_delay(SHOOTING_SPEED / 2)
|
||||
|
||||
func CanShoot():
|
||||
return clip > 0 && state == INITIAL && can_shoot
|
||||
|
||||
|
||||
@rpc
|
||||
func Release():
|
||||
rpc("rpc_Release")
|
||||
|
||||
@rpc(call_local, any_peer)
|
||||
func rpc_Release():
|
||||
if !FIREMODE:
|
||||
can_shoot = true
|
||||
|
||||
@@ -82,7 +98,7 @@ func Release():
|
||||
func Reload():
|
||||
if(clip < MAX_CLIP && state == INITIAL):
|
||||
state = RELOAD
|
||||
var tween = create_tween()
|
||||
tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_CIRC)
|
||||
tween.set_ease(Tween.EASE_IN)
|
||||
tween.set_parallel(true)
|
||||
|
||||
@@ -1,146 +1,117 @@
|
||||
extends Node3D
|
||||
|
||||
const CONFIG_PATH = "user://weapons.scoom"
|
||||
const REVOLVER = 0
|
||||
const UZI = 1
|
||||
const WEAPON_SCENE = preload("res://entities/Weapon.scn")
|
||||
|
||||
|
||||
const REST = 0
|
||||
const BOB = 1
|
||||
|
||||
var state = 0
|
||||
@onready var player_root = get_node("../../../../PlayerQ3") as CharacterBody3D
|
||||
@onready var player_root = get_node("../../..")
|
||||
@onready var raycast = get_node("../Camera3D/AimCast") as RayCast3D
|
||||
#@onready var crosshair = $Crosshair
|
||||
|
||||
var ALL_WEAPONS = []
|
||||
var weapons = []
|
||||
|
||||
var current_weapon = 0
|
||||
var current_weapon_index = 0
|
||||
var current_weapon = null
|
||||
|
||||
var file_data = {
|
||||
REVOLVER:
|
||||
{
|
||||
"HAND_POS": Vector3(0.4,-0.45,-1),
|
||||
"HAND_ROT": Vector3(0,PI,0),
|
||||
"MODEL": "Revolver",
|
||||
"MAX_CLIP": 5,
|
||||
"DAMAGE": 25,
|
||||
"MOMENTUM": Vector2(0.3, -0.25),
|
||||
"ANGULAR_MOMENTUM": Vector3(-60, 7, 10),
|
||||
"RECOIL_COOLDOWN": 0.35,
|
||||
"RPM": 120,
|
||||
"DRAW_POS": Vector3(0,-0.5,-0.3),
|
||||
"DRAW_ROT": Vector3(1.3, 0, 0),
|
||||
"RELOAD_MOMENTUM": Vector3(-5, -9, 7),
|
||||
"RELOAD_ANGULAR_MOMENTUM": Vector3(deg_to_rad(600), deg_to_rad(-800), deg_to_rad(-1000)),
|
||||
"RELOAD_TIME": 0.35,
|
||||
"FIREMODE": 0,
|
||||
"HITSCAN": true
|
||||
},
|
||||
UZI:
|
||||
{
|
||||
"HAND_POS": Vector3(0.4,-0.45,-1),
|
||||
"HAND_ROT": Vector3(0,PI,0),
|
||||
"MODEL": "Uzi",
|
||||
"MAX_CLIP": 30,
|
||||
"DAMAGE": 25,
|
||||
"MOMENTUM": Vector2(0.05, -0.15),
|
||||
"ANGULAR_MOMENTUM": Vector3(-4, 1, 2),
|
||||
"RECOIL_COOLDOWN": 0.35,
|
||||
"RPM": 600,
|
||||
"DRAW_POS": Vector3(0,-0.5,-0.3),
|
||||
"DRAW_ROT": Vector3(1.3, 0, 0),
|
||||
"RELOAD_MOMENTUM": Vector3(-7, -9, 7),
|
||||
"RELOAD_ANGULAR_MOMENTUM": Vector3(deg_to_rad(600), deg_to_rad(-800), deg_to_rad(-1000)),
|
||||
"RELOAD_TIME": 0.35,
|
||||
"FIREMODE": 1,
|
||||
"HITSCAN": true
|
||||
}
|
||||
}
|
||||
|
||||
var mouse_mov : Vector3
|
||||
var sway_lerp = 5
|
||||
@onready var game = get_node("/root/Game") as Game
|
||||
|
||||
func _ready():
|
||||
save_data(file_data)
|
||||
load_data()
|
||||
|
||||
for i in range(0, file_data.size()):
|
||||
var root = Weapon.new()
|
||||
root.name = str(i)
|
||||
var resource = "res://scenes/weapons/" + file_data[i].MODEL + ".tscn"
|
||||
var weapon_model_resource = load(resource)
|
||||
var weapon_model = weapon_model_resource.instantiate()
|
||||
|
||||
#Set Weapon nodes
|
||||
root.add_child(weapon_model)
|
||||
root.position = file_data[i].HAND_POS
|
||||
root.rotation = file_data[i].HAND_ROT
|
||||
root.hide()
|
||||
add_child(root)
|
||||
|
||||
#Set Weapon Data
|
||||
root.MAX_CLIP = file_data[i].MAX_CLIP
|
||||
root.clip = root.MAX_CLIP
|
||||
root.DAMAGE = file_data[i].DAMAGE
|
||||
root.MOMENTUM = file_data[i].MOMENTUM
|
||||
root.ANGULAR_MOMENTUM = file_data[i].ANGULAR_MOMENTUM
|
||||
root.RECOIL_COOLDOWN = file_data[i].RECOIL_COOLDOWN
|
||||
root.RELOAD_MOMENTUM = file_data[i].RELOAD_MOMENTUM
|
||||
root.RELOAD_ANGULAR_MOMENTUM = file_data[i].RELOAD_ANGULAR_MOMENTUM
|
||||
root.RELOAD_TIME = file_data[i].RELOAD_TIME
|
||||
root.RPM = file_data[i].RPM
|
||||
root.MODEL = root.get_node(file_data[i].MODEL)
|
||||
root.DRAW_POS = file_data[i].DRAW_POS
|
||||
root.DRAW_ROT = file_data[i].DRAW_ROT
|
||||
root.HITSCAN = file_data[i].HITSCAN
|
||||
root.FIREMODE = file_data[i].FIREMODE
|
||||
if(not root.HITSCAN):
|
||||
print("Projectile stats")
|
||||
|
||||
weapons.append(root)
|
||||
weapons[current_weapon].init()
|
||||
raycast.target_position.z = -weapons[current_weapon].RAY_LEN
|
||||
Init_Config(game.weapon_config)
|
||||
if not player_root.is_local_authority():
|
||||
for w_name in game.init_config.get_value("PLAYER", "starting_weapons"):
|
||||
GiveWeapon(w_name)
|
||||
|
||||
func set_weapons():
|
||||
for w_name in game.init_config.get_value("PLAYER", "starting_weapons"):
|
||||
rpc("GiveWeapon",w_name)
|
||||
|
||||
@rpc(call_local, any_peer)
|
||||
func GiveWeapon(weapon_name):
|
||||
for i in ALL_WEAPONS.size():
|
||||
if(ALL_WEAPONS[i].name != weapon_name):
|
||||
continue
|
||||
if(weapons.has(i)):
|
||||
return
|
||||
|
||||
weapons.append(i)
|
||||
if(current_weapon == null):
|
||||
rpc("ChangeWeapon", ((posmod(current_weapon_index, weapons.size()))))
|
||||
return
|
||||
|
||||
@rpc(call_local, any_peer)
|
||||
func TakeWeapon(weapon_name):
|
||||
for i in ALL_WEAPONS.size():
|
||||
if(ALL_WEAPONS[i].name != weapon_name):
|
||||
continue
|
||||
weapons.erase(i)
|
||||
if(current_weapon == ALL_WEAPONS[i]):
|
||||
rpc("ChangeWeapon", ((posmod(current_weapon_index, weapons.size()))))
|
||||
|
||||
func _input(event):
|
||||
if not player_root.is_local_authority():
|
||||
return
|
||||
if event is InputEventMouseMotion:
|
||||
mouse_mov.y = clampf(-event.relative.x, -0.1, 0.1)
|
||||
mouse_mov.x = clampf(event.relative.y, -0.1, 0.1)
|
||||
|
||||
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if event.keycode == KEY_T:
|
||||
rpc("GiveWeapon","CHAINSAW")
|
||||
|
||||
func _unhandled_input(_event):
|
||||
if not player_root.is_local_authority():
|
||||
return
|
||||
|
||||
if(weapons.size() == 0):
|
||||
return
|
||||
|
||||
if weapons.size() > 1 && Input.is_action_just_released("wheel_up"):
|
||||
ChangeWeapon((current_weapon + 1) % weapons.size())
|
||||
rpc("ChangeWeapon", (posmod((current_weapon_index + 1),weapons.size())))
|
||||
if weapons.size() > 1 && Input.is_action_just_released("wheel_down"):
|
||||
ChangeWeapon((current_weapon - 1) % weapons.size())
|
||||
rpc("ChangeWeapon", (posmod((current_weapon_index - 1),weapons.size())))
|
||||
|
||||
if Input.is_action_just_pressed("reload"):
|
||||
weapons[current_weapon].Reload()
|
||||
|
||||
current_weapon.Reload()
|
||||
@rpc(call_local, any_peer)
|
||||
func ChangeWeapon(i):
|
||||
weapons[current_weapon].hide()
|
||||
current_weapon = i
|
||||
weapons[current_weapon].init()
|
||||
raycast.target_position.z = -weapons[current_weapon].RAY_LEN
|
||||
if(current_weapon):
|
||||
current_weapon.hide()
|
||||
|
||||
if(weapons.size() == 0):
|
||||
current_weapon = null
|
||||
return
|
||||
|
||||
current_weapon_index = i
|
||||
var w_index = weapons[current_weapon_index]
|
||||
current_weapon = ALL_WEAPONS[w_index]
|
||||
current_weapon.show()
|
||||
current_weapon.init()
|
||||
raycast.target_position.z = -current_weapon.RAY_LEN
|
||||
|
||||
var time = 0
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_pressed("shoot") && weapons[current_weapon].Shoot():
|
||||
if(weapons[current_weapon].HITSCAN):
|
||||
if not player_root.is_local_authority():
|
||||
return
|
||||
if(current_weapon == null):
|
||||
return
|
||||
|
||||
if Input.is_action_pressed("shoot") && current_weapon.Shoot():
|
||||
if(current_weapon.HITSCAN):
|
||||
HitScan()
|
||||
else:
|
||||
Projectile()
|
||||
|
||||
if Input.is_action_just_released("shoot"):
|
||||
weapons[current_weapon].Release()
|
||||
current_weapon.Release()
|
||||
|
||||
|
||||
#SWAY
|
||||
if mouse_mov != null && mouse_mov.length() > 0:
|
||||
weapons[current_weapon].MODEL.rotation = weapons[current_weapon].MODEL.rotation.lerp(mouse_mov, sway_lerp * delta)
|
||||
current_weapon.MODEL.rotation = current_weapon.MODEL.rotation.lerp(mouse_mov, sway_lerp * delta)
|
||||
mouse_mov = Vector3.ZERO
|
||||
else:
|
||||
weapons[current_weapon].MODEL.rotation = weapons[current_weapon].MODEL.rotation.lerp(Vector3.ZERO, sway_lerp * delta)
|
||||
current_weapon.MODEL.rotation = current_weapon.MODEL.rotation.lerp(Vector3.ZERO, sway_lerp * delta)
|
||||
|
||||
#BOB
|
||||
if player_root.velocity.length() > 0:
|
||||
@@ -150,25 +121,63 @@ func _process(delta):
|
||||
bobOscillate = sin(time * 4 * (PI) + PI/4) * 0.015
|
||||
position.x = bobOscillate
|
||||
|
||||
|
||||
@rpc(call_local, any_peer)
|
||||
func HitScan():
|
||||
if(raycast.is_colliding()):
|
||||
var target = raycast.get_collider()
|
||||
print_debug("Hit target ", target.name, " with ", weapons[current_weapon].MODEL.name, " ",current_weapon, ". Dealt damage ", weapons[current_weapon].DAMAGE)
|
||||
print_debug("Hit target ", target.name, " with ", current_weapon.name, " ",current_weapon_index, ". Dealt damage ", current_weapon.DAMAGE)
|
||||
if(raycast.get_collision_mask_value(10)):
|
||||
if(target is Hitable):
|
||||
target.Hit()
|
||||
target.Hit(current_weapon.DAMAGE)
|
||||
|
||||
|
||||
func Projectile():
|
||||
pass
|
||||
|
||||
func save_data(data):
|
||||
var file = FileAccess.open(CONFIG_PATH, FileAccess.WRITE)
|
||||
file.store_var(data)
|
||||
|
||||
func load_data():
|
||||
var file = FileAccess.open(CONFIG_PATH, FileAccess.READ)
|
||||
var data = file.get_var()
|
||||
file_data = data
|
||||
func Init_Config(config):
|
||||
for weapon in config.get_sections():
|
||||
var root = WEAPON_SCENE.instantiate()
|
||||
root.name = weapon
|
||||
|
||||
var model_path = config.get_value(weapon, "MODEL") as String
|
||||
var weapon_model
|
||||
if(model_path.ends_with(".glb") or model_path.ends_with(".gltf")):
|
||||
weapon_model = Runtimeloader.load_gltf(model_path, root) as Node3D
|
||||
elif(model_path.ends_with(".tscn") or model_path.ends_with(".scn")):
|
||||
weapon_model = Runtimeloader.loadScene(model_path, root)
|
||||
else:
|
||||
printerr("Invalid file extension for "+ model_path)
|
||||
continue
|
||||
|
||||
|
||||
root.position = config.get_value(weapon, "HAND_POS")
|
||||
root.rotation = config.get_value(weapon, "HAND_ROT")
|
||||
root.hide()
|
||||
add_child(root)
|
||||
|
||||
#Set Weapon Data
|
||||
root.MELEE = config.get_value(weapon, "MELEE")
|
||||
root.MAX_CLIP = config.get_value(weapon, "MAX_CLIP")
|
||||
root.clip = root.MAX_CLIP
|
||||
root.DAMAGE = config.get_value(weapon, "DAMAGE")
|
||||
root.RPM = config.get_value(weapon, "RPM")
|
||||
root.FIREMODE = config.get_value(weapon, "FIREMODE")
|
||||
root.HITSCAN = config.get_value(weapon, "HITSCAN")
|
||||
if(not root.HITSCAN):
|
||||
print("Projectile stats")
|
||||
else:
|
||||
root.RAY_LEN = config.get_value(weapon, "RAY_LEN")
|
||||
|
||||
#Set Anim Data
|
||||
root.MODEL = weapon_model
|
||||
root.DRAW_POS = config.get_value(weapon, "DRAW_POS")
|
||||
root.DRAW_ROT = config.get_value(weapon, "DRAW_ROT")
|
||||
root.MOMENTUM = config.get_value(weapon, "MOMENTUM")
|
||||
root.ANGULAR_MOMENTUM = config.get_value(weapon, "ANGULAR_MOMENTUM")
|
||||
root.RECOIL_COOLDOWN = config.get_value(weapon, "RECOIL_COOLDOWN")
|
||||
root.RELOAD_MOMENTUM = config.get_value(weapon, "RELOAD_MOMENTUM")
|
||||
root.RELOAD_ANGULAR_MOMENTUM = config.get_value(weapon, "RELOAD_ANGULAR_MOMENTUM")
|
||||
root.RELOAD_TIME = config.get_value(weapon, "RELOAD_TIME")
|
||||
|
||||
ALL_WEAPONS.append(root)
|
||||
|
||||
45
scripts/utils/network.gd
Normal file
@@ -0,0 +1,45 @@
|
||||
extends Node
|
||||
|
||||
|
||||
signal player_spawn
|
||||
# The player scene (which we want to configure for replication).
|
||||
const Player = preload("res://entities/Player.tscn")
|
||||
@onready var NetworkingRoot = get_node("/root/Game/Networking")
|
||||
|
||||
|
||||
func start_network(server: bool, ip="localhost"):
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
if server:
|
||||
peer.create_server(27015)
|
||||
# Listen to peer connections, and create new player for them
|
||||
multiplayer.peer_connected.connect(create_player)
|
||||
# Listen to peer disconnections, and destroy their players
|
||||
multiplayer.peer_disconnected.connect(destroy_player)
|
||||
multiplayer.set_multiplayer_peer(peer)
|
||||
create_player()
|
||||
else:
|
||||
peer.create_client(ip, 27015)
|
||||
multiplayer.set_multiplayer_peer(peer)
|
||||
|
||||
func add_network_entity(path):
|
||||
var spawner = NetworkingRoot.get_node("Networking") as MultiplayerSpawner
|
||||
spawner.add_spawnable_scene(path)
|
||||
|
||||
|
||||
func create_player(id=1):
|
||||
# Instantiate a new player for this client.
|
||||
var p = Player.instantiate()
|
||||
# Sets the player name (only sent during spawn).
|
||||
#p.player_name = "Player %d" % id
|
||||
# Set a random position (sent on every replicator update).
|
||||
#p.position = Vector2(randi() % 500, randi() % 500)
|
||||
# Add it to the "Players" node.
|
||||
# We give the new Node a name for easy retrieval, but that's not necessary.
|
||||
p.name = str(id)
|
||||
#p.set_multiplayer_authority(id)
|
||||
NetworkingRoot.add_child(p)
|
||||
p.init()
|
||||
|
||||
func destroy_player(id):
|
||||
# Delete this peer's node.
|
||||
NetworkingRoot.get_node(str(id)).queue_free()
|
||||
107
scripts/utils/runtimeloader.gd
Normal file
@@ -0,0 +1,107 @@
|
||||
extends Node
|
||||
var PATH = "res://scoom/"
|
||||
var EXTERNAL_PATH = "res://scoom/"
|
||||
const ENTITY_CONFIG = "entity.cfg"
|
||||
|
||||
func _ready():
|
||||
if(not OS.has_feature("editor")):
|
||||
EXTERNAL_PATH = OS.get_executable_path().get_base_dir() + "/scoom/"
|
||||
|
||||
|
||||
func get_all_children(in_node, arr = []):
|
||||
arr.push_back(in_node)
|
||||
for child in in_node.get_children():
|
||||
arr = get_all_children(child,arr)
|
||||
return arr
|
||||
|
||||
func load_gltf(file, parent = self, hasCollision = false, trimesh = false):
|
||||
if(file == null):
|
||||
printerr("No model provided to load")
|
||||
return
|
||||
|
||||
var gltf := GLTFDocument.new()
|
||||
var gltf_state := GLTFState.new()
|
||||
|
||||
var snd_file = FileAccess.open(EXTERNAL_PATH + file, FileAccess.READ)
|
||||
|
||||
var fileBytes = PackedByteArray()
|
||||
fileBytes = snd_file.get_buffer(snd_file.get_length())
|
||||
|
||||
gltf.append_from_buffer(fileBytes, "", gltf_state)
|
||||
|
||||
print("Loading ", EXTERNAL_PATH + file)
|
||||
var node = gltf.generate_scene(gltf_state) as Node
|
||||
|
||||
parent.add_child(node)
|
||||
get_all_entities(node)
|
||||
|
||||
|
||||
if not hasCollision:
|
||||
return node
|
||||
|
||||
for o in get_all_children(node):
|
||||
if o is MeshInstance3D:
|
||||
if(trimesh):
|
||||
o.create_trimesh_collision()
|
||||
else:
|
||||
o.create_convex_collision()
|
||||
return node
|
||||
|
||||
func get_all_entities(at_node):
|
||||
var entity_count = 0
|
||||
for o in get_all_children(at_node):
|
||||
if o.name.begins_with("entity_"):
|
||||
print("Loading entity ", o.name)
|
||||
if loadEntity(o):
|
||||
entity_count += 1;
|
||||
if(entity_count > 0):
|
||||
print("Loaded ", entity_count, " entities.")
|
||||
|
||||
func loadEntity(node):
|
||||
var config = ConfigFile.new()
|
||||
var err = config.load(PATH + ENTITY_CONFIG)
|
||||
|
||||
if err != OK:
|
||||
printerr("COULD NOT LOAD ENTITY : ", node.name)
|
||||
return false
|
||||
|
||||
if(not config.has_section(node.name)):
|
||||
printerr("NO CONFIG FOUND FOR ENTITY : ", node.name)
|
||||
return false
|
||||
|
||||
var model = config.get_value(node.name, "model")
|
||||
var has_collision = config.get_value(node.name, "has_collision")
|
||||
var has_trimesh_col = config.get_value(node.name, "has_trimesh_col")
|
||||
|
||||
var entity = load_gltf(model, node.get_parent(), has_collision, has_trimesh_col) as Node3D
|
||||
|
||||
if(entity == null):
|
||||
printerr("ENTITY COULD NOT BE CREATED : ", node.name)
|
||||
return false
|
||||
|
||||
entity.transform.origin = node.transform.origin
|
||||
entity.scale = config.get_value(node.name, "scale")
|
||||
node.queue_free()
|
||||
return true
|
||||
|
||||
func loadPCK(file):
|
||||
var success = ProjectSettings.load_resource_pack(EXTERNAL_PATH + file)
|
||||
|
||||
if success:
|
||||
print("Resource pack loaded ", EXTERNAL_PATH + file)
|
||||
|
||||
func loadConfig(file):
|
||||
var config = ConfigFile.new()
|
||||
var err = config.load(EXTERNAL_PATH + file)
|
||||
|
||||
if err != OK:
|
||||
printerr("FAILED LOADING CONFIG DATA @ ",EXTERNAL_PATH + file)
|
||||
|
||||
return config
|
||||
|
||||
func loadScene(file, parent = self):
|
||||
var res = load(PATH + file) as PackedScene
|
||||
var scene = res.instantiate()
|
||||
get_all_entities(scene)
|
||||
parent.add_child(scene)
|
||||
return scene
|
||||
BIN
textures/concrete_15.jpg
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
36
textures/concrete_15.jpg.import
Normal file
@@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bx4pdgghucl4k"
|
||||
path.s3tc="res://.godot/imported/concrete_15.jpg-42bf7bde5374d09a0bcdd2247a5e3ed8.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/concrete_15.jpg-42bf7bde5374d09a0bcdd2247a5e3ed8.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc", "etc2"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/concrete_15.jpg"
|
||||
dest_files=["res://.godot/imported/concrete_15.jpg-42bf7bde5374d09a0bcdd2247a5e3ed8.s3tc.ctex", "res://.godot/imported/concrete_15.jpg-42bf7bde5374d09a0bcdd2247a5e3ed8.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
textures/concrete_floor_01.jpg
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
36
textures/concrete_floor_01.jpg.import
Normal file
@@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dpbikwjv4uetu"
|
||||
path.s3tc="res://.godot/imported/concrete_floor_01.jpg-d3402f38e00e3b9e2ee61f78df3279e4.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/concrete_floor_01.jpg-d3402f38e00e3b9e2ee61f78df3279e4.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc", "etc2"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/concrete_floor_01.jpg"
|
||||
dest_files=["res://.godot/imported/concrete_floor_01.jpg-d3402f38e00e3b9e2ee61f78df3279e4.s3tc.ctex", "res://.godot/imported/concrete_floor_01.jpg-d3402f38e00e3b9e2ee61f78df3279e4.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
textures/shipping_container_01_front.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
36
textures/shipping_container_01_front.jpg.import
Normal file
@@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c52qu6ad3taix"
|
||||
path.s3tc="res://.godot/imported/shipping_container_01_front.jpg-6818bcd06a43db2b17373db471516d58.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/shipping_container_01_front.jpg-6818bcd06a43db2b17373db471516d58.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc", "etc2"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/shipping_container_01_front.jpg"
|
||||
dest_files=["res://.godot/imported/shipping_container_01_front.jpg-6818bcd06a43db2b17373db471516d58.s3tc.ctex", "res://.godot/imported/shipping_container_01_front.jpg-6818bcd06a43db2b17373db471516d58.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
textures/shipping_container_01_side.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
36
textures/shipping_container_01_side.jpg.import
Normal file
@@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bt671xkej3a2s"
|
||||
path.s3tc="res://.godot/imported/shipping_container_01_side.jpg-9d52ac7e86de9e14fde2e6a8a43fe4af.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/shipping_container_01_side.jpg-9d52ac7e86de9e14fde2e6a8a43fe4af.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc", "etc2"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://textures/shipping_container_01_side.jpg"
|
||||
dest_files=["res://.godot/imported/shipping_container_01_side.jpg-9d52ac7e86de9e14fde2e6a8a43fe4af.s3tc.ctex", "res://.godot/imported/shipping_container_01_side.jpg-9d52ac7e86de9e14fde2e6a8a43fe4af.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||