Feat/11 adding better fundamental weapon models and some textures #16

Merged
Dotts merged 5 commits from feat/11-adding-better-fundamental-weapon-models-and-some-textures into main 2026-06-09 19:14:25 -07:00
50 changed files with 5372 additions and 437 deletions
Showing only changes of commit 4bb867a6f2 - Show all commits
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
Model Information:
* title: Low-Poly AK-74
* source: https://sketchfab.com/3d-models/low-poly-ak-74-b27f9003622a4c7499bfd8d2a06dc47b
* author: TastyTony (https://sketchfab.com/TastyTony)
Model License:
* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
* requirements: Author must be credited. Commercial use is allowed.
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
This work is based on "Low-Poly AK-74" (https://sketchfab.com/3d-models/low-poly-ak-74-b27f9003622a4c7499bfd8d2a06dc47b) by TastyTony (https://sketchfab.com/TastyTony) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
Model Information:
* title: Modular Shotgun
* source: https://sketchfab.com/3d-models/modular-shotgun-5c04438b213648ea83007858e2b8c162
* author: Somersby (https://sketchfab.com/Somersby)
Model License:
* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
* requirements: Author must be credited. Commercial use is allowed.
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
This work is based on "Modular Shotgun" (https://sketchfab.com/3d-models/modular-shotgun-5c04438b213648ea83007858e2b8c162) by Somersby (https://sketchfab.com/Somersby) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

+5 -5
View File
@@ -20,8 +20,8 @@ func _ready() -> void:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
camera = get_node_or_null("Camera3D") camera = get_node_or_null("Camera3D")
if camera and params: if camera and params:
camera.fov = params.base_fov camera.fov = SettingsManager.world_fov
_target_fov = params.base_fov _target_fov = SettingsManager.world_fov
# Explicitly enable callbacks — set_script() at runtime doesn't auto-register them # Explicitly enable callbacks — set_script() at runtime doesn't auto-register them
set_process_input(true) set_process_input(true)
set_process(true) set_process(true)
@@ -29,7 +29,7 @@ func _ready() -> void:
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
var is_ads = camera and camera.fov < params.base_fov - 5.0 var is_ads = camera and camera.fov < SettingsManager.world_fov - 5.0
var sens = SettingsManager.ads_sensitivity if is_ads else SettingsManager.mouse_sensitivity var sens = SettingsManager.ads_sensitivity if is_ads else SettingsManager.mouse_sensitivity
# Yaw: rotate the player (parent) # Yaw: rotate the player (parent)
get_parent().rotate_y(-event.relative.x * sens) get_parent().rotate_y(-event.relative.x * sens)
@@ -53,12 +53,12 @@ func _process(delta: float) -> void:
return return
# ── FOV kick ────────────────────────────────────────────────────────── # ── FOV kick ──────────────────────────────────────────────────────────
_target_fov = params.base_fov _target_fov = SettingsManager.world_fov
var hspeed := Vector2(player.velocity.x, player.velocity.z).length() var hspeed := Vector2(player.velocity.x, player.velocity.z).length()
# Smoothly scale FOV based on speed above walking speed # Smoothly scale FOV based on speed above walking speed
var speed_factor = clampf((hspeed - params.walk_speed) / (params.walk_speed * 0.5), 0.0, 1.0) var speed_factor = clampf((hspeed - params.walk_speed) / (params.walk_speed * 0.5), 0.0, 1.0)
_target_fov = lerpf(params.base_fov, params.dash_fov, speed_factor) _target_fov = lerpf(SettingsManager.world_fov, SettingsManager.world_fov + 20.0, speed_factor)
if _weapon_fov_override > 0.0: if _weapon_fov_override > 0.0:
_target_fov = _weapon_fov_override _target_fov = _weapon_fov_override
+3
View File
@@ -29,6 +29,7 @@ var show_debug_ui: bool = false
var username: String = "Player" var username: String = "Player"
var mouse_sensitivity: float = 0.002 var mouse_sensitivity: float = 0.002
var ads_sensitivity: float = 0.001 var ads_sensitivity: float = 0.001
var world_fov: float = 90.0
# Video Settings # Video Settings
var display_mode: int = DisplayServer.WINDOW_MODE_WINDOWED var display_mode: int = DisplayServer.WINDOW_MODE_WINDOWED
@@ -135,6 +136,7 @@ func _save_settings() -> void:
"username": username, "username": username,
"mouse_sensitivity": mouse_sensitivity, "mouse_sensitivity": mouse_sensitivity,
"ads_sensitivity": ads_sensitivity, "ads_sensitivity": ads_sensitivity,
"world_fov": world_fov,
"display_mode": display_mode, "display_mode": display_mode,
"resolution_index": resolution_index, "resolution_index": resolution_index,
"fps_cap": fps_cap, "fps_cap": fps_cap,
@@ -171,6 +173,7 @@ func _load_settings() -> void:
if data.has("show_debug_ui"): show_debug_ui = data["show_debug_ui"] if data.has("show_debug_ui"): show_debug_ui = data["show_debug_ui"]
if data.has("mouse_sensitivity"): mouse_sensitivity = data["mouse_sensitivity"] if data.has("mouse_sensitivity"): mouse_sensitivity = data["mouse_sensitivity"]
if data.has("ads_sensitivity"): ads_sensitivity = data["ads_sensitivity"] if data.has("ads_sensitivity"): ads_sensitivity = data["ads_sensitivity"]
if data.has("world_fov"): world_fov = data["world_fov"]
if data.has("display_mode"): display_mode = data["display_mode"] if data.has("display_mode"): display_mode = data["display_mode"]
if data.has("resolution_index"): resolution_index = data["resolution_index"] if data.has("resolution_index"): resolution_index = data["resolution_index"]
if data.has("fps_cap"): fps_cap = data["fps_cap"] if data.has("fps_cap"): fps_cap = data["fps_cap"]
+1
View File
@@ -0,0 +1 @@
uid://bsgjg5nrt43vu
+45 -1
View File
@@ -25,6 +25,8 @@ var editing_index: int = -1
# Settings UI # Settings UI
var settings_editor: Control var settings_editor: Control
var settings_back_btn: Button var settings_back_btn: Button
var _world_fov_slider: HSlider
var _world_fov_input: LineEdit
var _debug_ui_checkbox: CheckButton var _debug_ui_checkbox: CheckButton
var _mouse_sens_slider: HSlider var _mouse_sens_slider: HSlider
var _mouse_sens_input: LineEdit var _mouse_sens_input: LineEdit
@@ -279,6 +281,43 @@ func _build_ui() -> void:
) )
user_hbox.add_child(user_save) user_hbox.add_child(user_save)
var fov_hbox = HBoxContainer.new()
general_tab.add_child(fov_hbox)
var fov_lbl = Label.new()
fov_lbl.text = "World FOV"
fov_lbl.custom_minimum_size = Vector2(150, 0)
fov_hbox.add_child(fov_lbl)
_world_fov_slider = HSlider.new()
_world_fov_slider.min_value = 70.0
_world_fov_slider.max_value = 120.0
_world_fov_slider.step = 1.0
_world_fov_slider.value = SettingsManager.world_fov
_world_fov_slider.custom_minimum_size = Vector2(200, 0)
_world_fov_slider.size_flags_vertical = Control.SIZE_SHRINK_CENTER
fov_hbox.add_child(_world_fov_slider)
_world_fov_input = LineEdit.new()
_world_fov_input.text = str(round(SettingsManager.world_fov))
_world_fov_input.custom_minimum_size = Vector2(60, 0)
fov_hbox.add_child(_world_fov_input)
_world_fov_slider.value_changed.connect(func(value: float):
_world_fov_input.text = str(round(value))
SettingsManager.world_fov = value
SettingsManager._save_settings()
)
_world_fov_input.text_submitted.connect(func(new_text: String):
var val = new_text.to_float()
val = clampf(val, 70.0, 120.0)
_world_fov_slider.value = val
_world_fov_input.text = str(round(val))
SettingsManager.world_fov = val
SettingsManager._save_settings()
)
var spacer_gen = Control.new() var spacer_gen = Control.new()
spacer_gen.size_flags_vertical = Control.SIZE_EXPAND_FILL spacer_gen.size_flags_vertical = Control.SIZE_EXPAND_FILL
general_tab.add_child(spacer_gen) general_tab.add_child(spacer_gen)
@@ -286,7 +325,9 @@ func _build_ui() -> void:
var reset_gen_btn = Button.new() var reset_gen_btn = Button.new()
reset_gen_btn.text = "Reset to Defaults" reset_gen_btn.text = "Reset to Defaults"
reset_gen_btn.pressed.connect(func(): reset_gen_btn.pressed.connect(func():
pass # No settings yet _world_fov_slider.value = 90.0
SettingsManager.world_fov = 90.0
SettingsManager._save_settings()
) )
general_tab.add_child(reset_gen_btn) general_tab.add_child(reset_gen_btn)
@@ -743,6 +784,9 @@ func _show_settings() -> void:
_debug_ui_checkbox.button_pressed = SettingsManager.show_debug_ui _debug_ui_checkbox.button_pressed = SettingsManager.show_debug_ui
if _show_fps_checkbox: if _show_fps_checkbox:
_show_fps_checkbox.button_pressed = SettingsManager.show_fps _show_fps_checkbox.button_pressed = SettingsManager.show_fps
if _world_fov_slider:
_world_fov_slider.value = SettingsManager.world_fov
_world_fov_input.text = str(round(SettingsManager.world_fov))
if _mouse_sens_slider: if _mouse_sens_slider:
var display_val = round(SettingsManager.mouse_sensitivity * 10000.0) var display_val = round(SettingsManager.mouse_sensitivity * 10000.0)
_mouse_sens_slider.value = display_val _mouse_sens_slider.value = display_val
+10 -46
View File
@@ -14,52 +14,16 @@ func _init() -> void:
spread_angle = 0.015 spread_angle = 0.015
func _build_model() -> void: func _build_model() -> void:
# Position position = Vector3(0.3, -0.3, -0.590)
position = Vector3(0.3, -0.3, -0.6)
var model_scene = load("res://assets/weapons/ak47/source/scene.gltf")
# Receiver if model_scene:
var receiver = MeshInstance3D.new() var model = model_scene.instantiate()
var rec_mesh = BoxMesh.new() model_root.add_child(model)
rec_mesh.size = Vector3(0.06, 0.12, 0.3) model.scale = Vector3(0.00125, 0.00125, 0.00125)
var rec_mat = StandardMaterial3D.new() model.rotation_degrees.y = 90
rec_mat.albedo_color = Color(0.2, 0.2, 0.2) for light in model.find_children("*", "Light3D", true, false):
rec_mesh.material = rec_mat light.queue_free()
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0.1)
model_root.add_child(receiver)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.015
b_mesh.bottom_radius = 0.015
b_mesh.height = 0.45
b_mesh.material = rec_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.03, -0.2)
model_root.add_child(barrel)
# Wood Handguard
var guard = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.08, 0.08, 0.2)
var wood_mat = StandardMaterial3D.new()
wood_mat.albedo_color = Color(0.5, 0.25, 0.1)
g_mesh.material = wood_mat
guard.mesh = g_mesh
guard.position = Vector3(0, 0, -0.1)
model_root.add_child(guard)
# Wood Stock
var stock = MeshInstance3D.new()
var s_mesh = BoxMesh.new()
s_mesh.size = Vector3(0.06, 0.1, 0.25)
s_mesh.material = wood_mat
stock.mesh = s_mesh
stock.position = Vector3(0, -0.02, 0.35)
model_root.add_child(stock)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.7, 0.2) muzzle_flash.light_color = Color(1.0, 0.7, 0.2)
+12 -41
View File
@@ -21,45 +21,16 @@ func _init() -> void:
penetration_damage_penalty = 0.5 penetration_damage_penalty = 0.5
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.8) position = Vector3(0.3, -0.3, -0.729)
var mat_green = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/awp/source/L118a1.fbx")
mat_green.albedo_color = Color(0.1, 0.4, 0.1) if model_scene:
var mat_black = StandardMaterial3D.new() var model = model_scene.instantiate()
mat_black.albedo_color = Color(0.1, 0.1, 0.1) model_root.add_child(model)
model.scale = Vector3(0.275, 0.275, 0.275)
# Body model.rotation_degrees.y = 90
var body = MeshInstance3D.new() for light in model.find_children("*", "Light3D", true, false):
var b_mesh = BoxMesh.new() light.queue_free()
b_mesh.size = Vector3(0.06, 0.12, 0.6)
b_mesh.material = mat_green
body.mesh = b_mesh
model_root.add_child(body)
# Scope
var scope = MeshInstance3D.new()
var s_mesh = CylinderMesh.new()
s_mesh.top_radius = 0.03
s_mesh.bottom_radius = 0.03
s_mesh.height = 0.25
s_mesh.material = mat_black
scope.mesh = s_mesh
scope.rotation.x = deg_to_rad(90)
scope.position = Vector3(0, 0.09, -0.1)
model_root.add_child(scope)
# Long Barrel
var barrel = MeshInstance3D.new()
var bar_mesh = CylinderMesh.new()
bar_mesh.top_radius = 0.015
bar_mesh.bottom_radius = 0.02
bar_mesh.height = 0.6
bar_mesh.material = mat_black
barrel.mesh = bar_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.04, -0.6)
model_root.add_child(barrel)
# Audio # Audio
fire_sound = AudioStreamPlayer3D.new() fire_sound = AudioStreamPlayer3D.new()
fire_sound.bus = "SFX" fire_sound.bus = "SFX"
@@ -85,7 +56,7 @@ func _process(delta: float) -> void:
rig.set_weapon_fov(ads_fov if is_ads else -1.0) rig.set_weapon_fov(ads_fov if is_ads else -1.0)
# Move model slightly based on ADS # Move model slightly based on ADS
var target_pos = Vector3(0.0, -0.15, -0.6) if is_ads else Vector3(0.3, -0.3, -0.8) var target_pos = Vector3(0.0, -0.15, -0.608) if is_ads else Vector3(0.3, -0.3, -0.729)
position = position.lerp(target_pos, 15.0 * delta) position = position.lerp(target_pos, 15.0 * delta)
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
@@ -110,4 +81,4 @@ func unequip() -> void:
if rig and rig.has_method("set_weapon_fov"): if rig and rig.has_method("set_weapon_fov"):
rig.set_weapon_fov(-1.0) rig.set_weapon_fov(-1.0)
target_fov = default_fov target_fov = default_fov
position = Vector3(0.3, -0.3, -0.8) position = Vector3(0.3, -0.3, -0.729)
+11 -41
View File
@@ -23,46 +23,16 @@ func _ready() -> void:
default_fov = camera.fov default_fov = camera.fov
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.7) position = Vector3(0.3, -0.3, -0.49)
var body_mat = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/dmr/source/M14 .blend")
body_mat.albedo_color = Color(0.15, 0.25, 0.15) # Olive drab if model_scene:
var black_mat = StandardMaterial3D.new() var model = model_scene.instantiate()
black_mat.albedo_color = Color(0.05, 0.05, 0.05) model_root.add_child(model)
model.scale = Vector3(0.1875, 0.1875, 0.1875)
# Receiver model.rotation_degrees.y = 90
var receiver = MeshInstance3D.new() for light in model.find_children("*", "Light3D", true, false):
var rec_mesh = BoxMesh.new() light.queue_free()
rec_mesh.size = Vector3(0.05, 0.12, 0.4)
rec_mesh.material = body_mat
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0.1)
model_root.add_child(receiver)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.01
b_mesh.bottom_radius = 0.01
b_mesh.height = 0.6
b_mesh.material = black_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.03, -0.3)
model_root.add_child(barrel)
# Scope
var scope = MeshInstance3D.new()
var scope_mesh = CylinderMesh.new()
scope_mesh.top_radius = 0.02
scope_mesh.bottom_radius = 0.02
scope_mesh.height = 0.2
scope_mesh.material = black_mat
scope.mesh = scope_mesh
scope.rotation.x = deg_to_rad(90)
scope.position = Vector3(0, 0.08, 0.05)
model_root.add_child(scope)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.8, 0.4) muzzle_flash.light_color = Color(1.0, 0.8, 0.4)
@@ -125,4 +95,4 @@ func unequip() -> void:
var rig = camera.get_parent() var rig = camera.get_parent()
if rig and rig.has_method("set_weapon_fov"): if rig and rig.has_method("set_weapon_fov"):
rig.set_weapon_fov(-1.0) rig.set_weapon_fov(-1.0)
position = Vector3(0.3, -0.3, -0.7) position = Vector3(0.3, -0.3, -0.49)
+14 -41
View File
@@ -20,46 +20,19 @@ func _ready() -> void:
_build_model() _build_model()
func _build_model() -> void: func _build_model() -> void:
# Simple FPS weapon placement (bottom right) if not model_root:
position = Vector3(0.3, -0.3, -0.6) model_root = Node3D.new()
add_child(model_root)
model_root = Node3D.new() position = Vector3(0.3, -0.3, -0.690)
add_child(model_root)
var model_scene = load("res://assets/weapons/double barrel/source/Double Deuce.fbx")
# Stock if model_scene:
var stock = MeshInstance3D.new() var model = model_scene.instantiate()
var stock_mesh = BoxMesh.new() model_root.add_child(model)
stock_mesh.size = Vector3(0.1, 0.1, 0.4) model.scale = Vector3(0.275, 0.275, 0.275)
var stock_mat = StandardMaterial3D.new() model.rotation_degrees.y = 90
stock_mat.albedo_color = Color(0.4, 0.2, 0.1) # Brown wood for light in model.find_children("*", "Light3D", true, false):
stock_mesh.material = stock_mat light.queue_free()
stock.mesh = stock_mesh
stock.position = Vector3(0, 0, 0.2)
model_root.add_child(stock)
# Left Barrel
var barrel_l = MeshInstance3D.new()
var barrel_mesh = CylinderMesh.new()
barrel_mesh.top_radius = 0.03
barrel_mesh.bottom_radius = 0.03
barrel_mesh.height = 0.6
var barrel_mat = StandardMaterial3D.new()
barrel_mat.albedo_color = Color(0.2, 0.2, 0.2) # Dark grey metal
barrel_mat.metallic = 0.8
barrel_mat.roughness = 0.4
barrel_mesh.material = barrel_mat
barrel_l.mesh = barrel_mesh
barrel_l.rotation.x = deg_to_rad(90)
barrel_l.position = Vector3(-0.04, 0.03, -0.1)
model_root.add_child(barrel_l)
# Right Barrel
var barrel_r = MeshInstance3D.new()
barrel_r.mesh = barrel_mesh
barrel_r.rotation.x = deg_to_rad(90)
barrel_r.position = Vector3(0.04, 0.03, -0.1)
model_root.add_child(barrel_r)
# Muzzle Flash Light # Muzzle Flash Light
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.8, 0.3) muzzle_flash.light_color = Color(1.0, 0.8, 0.3)
@@ -222,7 +195,7 @@ func _shoot_hitscan() -> void:
t_mesh_inst.mesh = t_mesh t_mesh_inst.mesh = t_mesh
t_mesh_inst.rotation.x = deg_to_rad(90) t_mesh_inst.rotation.x = deg_to_rad(90)
t_mesh_inst.position = Vector3(0, 0, -0.5) t_mesh_inst.position = Vector3(0, 0, -0.719)
tracer.add_child(t_mesh_inst) tracer.add_child(t_mesh_inst)
tracer.target_position = final_target tracer.target_position = final_target
+18 -41
View File
@@ -13,7 +13,7 @@ var model_root: Node3D
var auto_switch_slot: int = -1 var auto_switch_slot: int = -1
var is_swinging: bool = false var is_swinging: bool = false
var default_pos: Vector3 = Vector3(0.3, -0.3, -0.6) var default_pos: Vector3 = Vector3(0.3, -0.3, -0.945)
var fire_sound: AudioStreamPlayer3D var fire_sound: AudioStreamPlayer3D
@@ -26,44 +26,21 @@ func _ready() -> void:
position = default_pos position = default_pos
func _build_model() -> void: func _build_model() -> void:
var mat_handle = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/knife/source/Knife.fbx")
mat_handle.albedo_color = Color(0.1, 0.1, 0.1) if model_scene:
var model = model_scene.instantiate()
var mat_blade = StandardMaterial3D.new() model_root.add_child(model)
mat_blade.albedo_color = Color(0.8, 0.8, 0.8) model.scale = Vector3(0.125, 0.125, 0.125)
mat_blade.metallic = 0.8 model.rotation_degrees.y = 270
mat_blade.roughness = 0.2 for light in model.find_children("*", "Light3D", true, false):
light.queue_free()
# Handle
var handle = MeshInstance3D.new() var mat = StandardMaterial3D.new()
var h_mesh = CylinderMesh.new() mat.albedo_texture = load("res://assets/weapons/knife/textures/Color Palette.png")
h_mesh.top_radius = 0.02
h_mesh.bottom_radius = 0.02 for child in model.find_children("*", "MeshInstance3D", true, false):
h_mesh.height = 0.15 child.set_surface_override_material(0, mat)
h_mesh.material = mat_handle
handle.mesh = h_mesh
handle.rotation.x = deg_to_rad(90)
handle.position = Vector3(0, 0, 0)
model_root.add_child(handle)
# Blade
var blade = MeshInstance3D.new()
var b_mesh = BoxMesh.new()
b_mesh.size = Vector3(0.01, 0.04, 0.25)
b_mesh.material = mat_blade
blade.mesh = b_mesh
blade.position = Vector3(0, 0, -0.2)
model_root.add_child(blade)
# Guard
var guard = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.06, 0.05, 0.01)
g_mesh.material = mat_handle
guard.mesh = g_mesh
guard.position = Vector3(0, 0, -0.075)
model_root.add_child(guard)
# Audio (reusing shotgun reload or something generic for now, ideally a swish) # Audio (reusing shotgun reload or something generic for now, ideally a swish)
fire_sound = AudioStreamPlayer3D.new() fire_sound = AudioStreamPlayer3D.new()
fire_sound.bus = "SFX" fire_sound.bus = "SFX"
@@ -106,11 +83,11 @@ func _swing() -> void:
var tween = create_tween() var tween = create_tween()
# Windup: Move to the right, point the blade left and tilt it # Windup: Move to the right, point the blade left and tilt it
tween.tween_property(self, "position", Vector3(0.6, -0.2, -0.4), 0.1) tween.tween_property(self, "position", Vector3(0.6, -0.2, -0.630), 0.1)
tween.parallel().tween_property(self, "rotation", Vector3(deg_to_rad(10), deg_to_rad(80), deg_to_rad(-40)), 0.1) tween.parallel().tween_property(self, "rotation", Vector3(deg_to_rad(10), deg_to_rad(80), deg_to_rad(-40)), 0.1)
# Swipe: Move across the screen to the left quickly # Swipe: Move across the screen to the left quickly
tween.tween_property(self, "position", Vector3(-0.6, -0.3, -0.5), 0.1) tween.tween_property(self, "position", Vector3(-0.6, -0.3, -0.788), 0.1)
tween.parallel().tween_property(self, "rotation", Vector3(deg_to_rad(10), deg_to_rad(110), deg_to_rad(-60)), 0.1) tween.parallel().tween_property(self, "rotation", Vector3(deg_to_rad(10), deg_to_rad(110), deg_to_rad(-60)), 0.1)
# Return to idle # Return to idle
+10 -37
View File
@@ -14,43 +14,16 @@ func _init() -> void:
spread_angle = 0.01 spread_angle = 0.01
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.6) position = Vector3(0.3, -0.3, -0.656)
var grey_mat = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/m4/source/M4a4.fbx")
grey_mat.albedo_color = Color(0.25, 0.25, 0.25) if model_scene:
var dark_mat = StandardMaterial3D.new() var model = model_scene.instantiate()
dark_mat.albedo_color = Color(0.1, 0.1, 0.1) model_root.add_child(model)
model.scale = Vector3(0.275, 0.275, 0.275)
# Receiver model.rotation_degrees.y = 90
var receiver = MeshInstance3D.new() for light in model.find_children("*", "Light3D", true, false):
var rec_mesh = BoxMesh.new() light.queue_free()
rec_mesh.size = Vector3(0.05, 0.14, 0.25)
rec_mesh.material = grey_mat
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0.1)
model_root.add_child(receiver)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.012
b_mesh.bottom_radius = 0.012
b_mesh.height = 0.4
b_mesh.material = dark_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.04, -0.2)
model_root.add_child(barrel)
# Handguard
var guard = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.06, 0.07, 0.22)
g_mesh.material = dark_mat
guard.mesh = g_mesh
guard.position = Vector3(0, 0.04, -0.1)
model_root.add_child(guard)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.8, 0.4) muzzle_flash.light_color = Color(1.0, 0.8, 0.4)
+16 -16
View File
@@ -17,22 +17,22 @@ func _init() -> void:
projectile_gravity = 15.0 # Heavy drop projectile_gravity = 15.0 # Heavy drop
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.4, -0.5) position = Vector3(0.5, -0.4, -0.8)
var mat_olive = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/mortar/source/scene.gltf")
mat_olive.albedo_color = Color(0.2, 0.3, 0.1) if model_scene:
var model = model_scene.instantiate()
# Thick short tube model_root.add_child(model)
var body = MeshInstance3D.new() model.scale = Vector3(0.0025, 0.0025, 0.0025)
var b_mesh = CylinderMesh.new() model.rotation_degrees.y = -90
b_mesh.top_radius = 0.12 model.position.y -= 0.2
b_mesh.bottom_radius = 0.12
b_mesh.height = 0.5 # Aggressively strip any rogue nodes from the GLTF that could ruin the scene
b_mesh.material = mat_olive for node in model.find_children("*", "", true, false):
body.mesh = b_mesh if node is Light3D or node is Camera3D or node is WorldEnvironment or node is ReflectionProbe:
body.rotation.x = deg_to_rad(90) if node is Node3D: node.visible = false
model_root.add_child(body) node.queue_free()
# Audio # Audio
fire_sound = AudioStreamPlayer3D.new() fire_sound = AudioStreamPlayer3D.new()
fire_sound.bus = "SFX" fire_sound.bus = "SFX"
+10 -46
View File
@@ -14,52 +14,16 @@ func _init() -> void:
spread_angle = 0.025 spread_angle = 0.025
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.25, -0.25, -0.5) position = Vector3(0.25, -0.25, -0.35)
var black_mat = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/mp7/source/HK MP7.fbx")
black_mat.albedo_color = Color(0.05, 0.05, 0.05) if model_scene:
var model = model_scene.instantiate()
# Receiver model_root.add_child(model)
var receiver = MeshInstance3D.new() model.scale = Vector3(0.08, 0.08, 0.08)
var rec_mesh = BoxMesh.new() model.rotation_degrees.y = 90
rec_mesh.size = Vector3(0.04, 0.1, 0.2) for light in model.find_children("*", "Light3D", true, false):
rec_mesh.material = black_mat light.queue_free()
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0)
model_root.add_child(receiver)
# Grip
var grip = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.03, 0.12, 0.04)
g_mesh.material = black_mat
grip.mesh = g_mesh
grip.position = Vector3(0, -0.06, 0.08)
grip.rotation.x = deg_to_rad(10)
model_root.add_child(grip)
# Foregrip
var fgrip = MeshInstance3D.new()
var fg_mesh = BoxMesh.new()
fg_mesh.size = Vector3(0.03, 0.08, 0.03)
fg_mesh.material = black_mat
fgrip.mesh = fg_mesh
fgrip.position = Vector3(0, -0.05, -0.06)
fgrip.rotation.x = deg_to_rad(-10)
model_root.add_child(fgrip)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.008
b_mesh.bottom_radius = 0.008
b_mesh.height = 0.1
b_mesh.material = black_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.02, -0.15)
model_root.add_child(barrel)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.9, 0.5) muzzle_flash.light_color = Color(1.0, 0.9, 0.5)
+24 -49
View File
@@ -16,55 +16,30 @@ func _init() -> void:
projectile_gravity = 5.0 # Slight drop projectile_gravity = 5.0 # Slight drop
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.6) position = Vector3(0.3, -0.3, -0.604)
var yellow_mat = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/nailgun/source/Sopra.fbx")
yellow_mat.albedo_color = Color(0.8, 0.7, 0.1) # Construction yellow if model_scene:
var dark_mat = StandardMaterial3D.new() var model = model_scene.instantiate()
dark_mat.albedo_color = Color(0.2, 0.2, 0.2) model_root.add_child(model)
model.scale = Vector3(0.06, 0.06, 0.06)
# Body model.rotation_degrees.y = 180
var body = MeshInstance3D.new() for light in model.find_children("*", "Light3D", true, false):
var b_mesh = BoxMesh.new() light.queue_free()
b_mesh.size = Vector3(0.06, 0.16, 0.25)
b_mesh.material = yellow_mat var mat = StandardMaterial3D.new()
body.mesh = b_mesh mat.albedo_texture = load("res://assets/weapons/nailgun/textures/Base_texture.png")
body.position = Vector3(0, 0.02, 0) mat.normal_enabled = true
model_root.add_child(body) mat.normal_texture = load("res://assets/weapons/nailgun/textures/Normal_texture.png")
mat.metallic = 1.0
# Handle mat.metallic_texture = load("res://assets/weapons/nailgun/textures/Metallic_texture.png")
var handle = MeshInstance3D.new() mat.roughness_texture = load("res://assets/weapons/nailgun/textures/Roughness_texture.png")
var h_mesh = BoxMesh.new() mat.ao_enabled = true
h_mesh.size = Vector3(0.04, 0.1, 0.04) mat.ao_texture = load("res://assets/weapons/nailgun/textures/internal_ground_ao_texture.jpeg")
h_mesh.material = dark_mat
handle.mesh = h_mesh for child in model.find_children("*", "MeshInstance3D", true, false):
handle.position = Vector3(0, -0.1, 0.05) child.set_surface_override_material(0, mat)
model_root.add_child(handle)
# Mag (Nail Drum)
var drum = MeshInstance3D.new()
var d_mesh = CylinderMesh.new()
d_mesh.top_radius = 0.05
d_mesh.bottom_radius = 0.05
d_mesh.height = 0.1
d_mesh.material = dark_mat
drum.mesh = d_mesh
drum.rotation.z = deg_to_rad(90)
drum.position = Vector3(0, -0.06, -0.05)
model_root.add_child(drum)
# Barrel
var barrel = MeshInstance3D.new()
var bar_mesh = CylinderMesh.new()
bar_mesh.top_radius = 0.01
bar_mesh.bottom_radius = 0.01
bar_mesh.height = 0.15
bar_mesh.material = dark_mat
barrel.mesh = bar_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.05, -0.2)
model_root.add_child(barrel)
# Muzzle Flash (Sparks) # Muzzle Flash (Sparks)
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.9, 0.6) muzzle_flash.light_color = Color(1.0, 0.9, 0.6)
+17 -31
View File
@@ -17,37 +17,23 @@ func _init() -> void:
projectile_gravity = 0.0 projectile_gravity = 0.0
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.6) position = Vector3(0.3, -0.3, -0.656)
var white_mat = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/plasmagun/source/Plasma rifle.fbx")
white_mat.albedo_color = Color(0.8, 0.8, 0.9) if model_scene:
var glow_mat = StandardMaterial3D.new() var model = model_scene.instantiate()
glow_mat.albedo_color = Color(0.2, 0.5, 1.0) model_root.add_child(model)
glow_mat.emission_enabled = true model.scale = Vector3(1.0, 1.0, 1.0)
glow_mat.emission = Color(0.2, 0.5, 1.0) model.rotation_degrees.y = 180
glow_mat.emission_energy_multiplier = 4.0 for light in model.find_children("*", "Light3D", true, false):
light.queue_free()
# Body
var body = MeshInstance3D.new() var mat = StandardMaterial3D.new()
var b_mesh = BoxMesh.new() mat.albedo_texture = load("res://assets/weapons/plasmagun/textures/Plasma_rifle.png")
b_mesh.size = Vector3(0.08, 0.14, 0.35)
b_mesh.material = white_mat for child in model.find_children("*", "MeshInstance3D", true, false):
body.mesh = b_mesh child.set_surface_override_material(0, mat)
body.position = Vector3(0, 0, 0.05)
model_root.add_child(body)
# Glow Core
var core = MeshInstance3D.new()
var c_mesh = CylinderMesh.new()
c_mesh.top_radius = 0.02
c_mesh.bottom_radius = 0.02
c_mesh.height = 0.4
c_mesh.material = glow_mat
core.mesh = c_mesh
core.rotation.x = deg_to_rad(90)
core.position = Vector3(0, 0.02, -0.15)
model_root.add_child(core)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(0.2, 0.5, 1.0) muzzle_flash.light_color = Color(0.2, 0.5, 1.0)
+10 -28
View File
@@ -17,34 +17,16 @@ func _init() -> void:
projectile_gravity = 0.0 # Flies straight projectile_gravity = 0.0 # Flies straight
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.4, -0.4, -0.6) position = Vector3(0.4, -0.4, -0.945)
var mat_grey = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/rocket launcher/source/Law72.fbx")
mat_grey.albedo_color = Color(0.3, 0.3, 0.3) if model_scene:
var model = model_scene.instantiate()
# Main Tube model_root.add_child(model)
var body = MeshInstance3D.new() model.scale = Vector3(0.25, 0.25, 0.25)
var b_mesh = CylinderMesh.new() model.rotation_degrees.y = 90
b_mesh.top_radius = 0.08 for light in model.find_children("*", "Light3D", true, false):
b_mesh.bottom_radius = 0.08 light.queue_free()
b_mesh.height = 0.8
b_mesh.material = mat_grey
body.mesh = b_mesh
body.rotation.x = deg_to_rad(90)
model_root.add_child(body)
# Back cone
var cone = MeshInstance3D.new()
var c_mesh = CylinderMesh.new()
c_mesh.top_radius = 0.08
c_mesh.bottom_radius = 0.04
c_mesh.height = 0.2
c_mesh.material = mat_grey
cone.mesh = c_mesh
cone.rotation.x = deg_to_rad(90)
cone.position = Vector3(0, 0, 0.5)
model_root.add_child(cone)
# Muzzle Flash # Muzzle Flash
muzzle_flash = OmniLight3D.new() muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.6, 0.2) muzzle_flash.light_color = Color(1.0, 0.6, 0.2)
+14 -13
View File
@@ -20,18 +20,19 @@ func _init() -> void:
projectile_speed = 25.0 # Slower so they have time to home projectile_speed = 25.0 # Slower so they have time to home
func _build_model() -> void: func _build_model() -> void:
position = Vector3(0.4, -0.4, -0.6) position = Vector3(0.4, -0.4, -0.656)
var mat_box = StandardMaterial3D.new() var model_scene = load("res://assets/weapons/swarm launcher/source/LOD_0.fbx")
mat_box.albedo_color = Color(0.2, 0.4, 0.5) if model_scene:
var model = model_scene.instantiate()
# Box launcher model_root.add_child(model)
var body = MeshInstance3D.new() model.scale = Vector3(1.0, 1.0, 1.0)
var b_mesh = BoxMesh.new() model.rotation_degrees.y = -90
b_mesh.size = Vector3(0.2, 0.2, 0.4) model.position.y -= 0.6 # Move model down without moving arms
b_mesh.material = mat_box
body.mesh = b_mesh # Strip lights
model_root.add_child(body) for child in model.find_children("*", "Light3D", true, false):
child.queue_free()
# Laser # Laser
targeting_laser = MeshInstance3D.new() targeting_laser = MeshInstance3D.new()
@@ -46,7 +47,7 @@ func _build_model() -> void:
l_mesh.material = l_mat l_mesh.material = l_mat
targeting_laser.mesh = l_mesh targeting_laser.mesh = l_mesh
targeting_laser.rotation.x = deg_to_rad(90) targeting_laser.rotation.x = deg_to_rad(90)
targeting_laser.position = Vector3(0, 0, -150.0) targeting_laser.position = Vector3(0, 0, -234.375)
targeting_laser.visible = false targeting_laser.visible = false
model_root.add_child(targeting_laser) model_root.add_child(targeting_laser)
@@ -123,7 +124,7 @@ func _fire() -> void:
var tween = create_tween() var tween = create_tween()
tween.tween_property(muzzle_flash, "light_energy", 0.0, 0.1) tween.tween_property(muzzle_flash, "light_energy", 0.0, 0.1)
var _origin = camera.global_position + camera.global_transform.basis * Vector3(0.4, -0.2, -0.6) var _origin = camera.global_position + camera.global_transform.basis * Vector3(0.4, -0.2, -0.938)
var base_dir = -camera.global_transform.basis.z var base_dir = -camera.global_transform.basis.z
_current_aim_dir = base_dir _current_aim_dir = base_dir
+12 -1
View File
@@ -58,7 +58,18 @@ func _setup_viewmodel_viewport() -> void:
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
if is_instance_valid(vm_camera) and is_instance_valid(camera): if is_instance_valid(vm_camera) and is_instance_valid(camera):
vm_camera.global_transform = camera.global_transform vm_camera.global_transform = camera.global_transform
vm_camera.fov = camera.fov
var target_fov = 70.0
if is_instance_valid(player) and "velocity" in player:
var hspeed = Vector2(player.velocity.x, player.velocity.z).length()
if hspeed <= 11.0:
var speed_factor = hspeed / 11.0
target_fov = lerpf(70.0, 72.0, speed_factor)
else:
var over_speed_factor = clampf((hspeed - 11.0) / 19.0, 0.0, 1.0) # maxes out at 30 m/s
target_fov = lerpf(72.0, 80.0, over_speed_factor)
vm_camera.fov = lerpf(vm_camera.fov, target_fov, 10.0 * _delta)
func _build_loadout() -> void: func _build_loadout() -> void:
var is_auth = false var is_auth = false