Add a first-view controller and a bunch of things

1. Replace 4k models with low-poly once
2. Use bare mixamo for testing
3. Add a basic menu
4. Add a map with collisions and spawn areas
This commit is contained in:
2025-01-16 18:17:06 +01:00
parent 34e019f40a
commit b214f8d278
798 changed files with 24962 additions and 465 deletions

22
scenes/maps/el_test.gd Normal file
View File

@ -0,0 +1,22 @@
extends Node3D
var player_side: String
@onready var intro_camera = $Intro/CameraMount/IntroCamera
@onready var intro_view_port = $Intro/CameraMount/IntroCamera/SubViewportContainer/SubViewport
@onready var spawns = $Spawns
@onready var root = $'.'
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var char : Node3D = null
var red_spawn: Node3D = $Spawns/Blue/SpawnArea
var position := red_spawn.global_position
char = ResourceLoader.load("res://scenes/utils/character.tscn").instantiate()
char.global_position = position
root.add_child(char)
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

26
scenes/maps/el_test.tscn Normal file
View File

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://c1v6kb00y77ij"]
[ext_resource type="Script" path="res://scenes/maps/el_test.gd" id="1_d5e7i"]
[ext_resource type="PackedScene" uid="uid://clp0pm3nxovxc" path="res://assets/models/maps/el_test.glb" id="2_cnkr5"]
[node name="ElTest" type="Node3D"]
script = ExtResource("1_d5e7i")
[node name="Light" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.508004, 0.861354, 0, -0.861354, 0.508004, 0, 2.97783, 2.62213)
[node name="Map" parent="." instance=ExtResource("2_cnkr5")]
[node name="Spawns" type="Node3D" parent="."]
[node name="Red" type="Node3D" parent="Spawns"]
[node name="SpawnArea" type="CSGBox3D" parent="Spawns/Red"]
transform = Transform3D(12.6683, 0, 0, 0, 1.0986, 0, 0, 0, 7.83287, -24.5455, 1.59351, 1.14462)
size = Vector3(0.100647, 1, 6.02112)
[node name="Blue" type="Node3D" parent="Spawns"]
[node name="SpawnArea" type="CSGBox3D" parent="Spawns/Blue"]
transform = Transform3D(5.70162, 0, 0, 0, 1, 0, 0, 0, 7.97817, 21.2099, 1.78438, 1.23551)
size = Vector3(0.484497, 1, 5.99213)

View File

@ -0,0 +1,24 @@
extends Node3D
var target_node_name: String = "TargetNode" # Name of the Node3D to detect
@onready var raycast : RayCast3D = $CameraMount/Camera3D/RayCast3D
@onready var camera : Camera3D = $CameraMount/Camera3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var blue := $ChooseTeam/Blue
var red := $ChooseTeam/Read
if
if raycast.is_colliding():
var collider = raycast.get_collider()
if collider and collider.name == target_node_name:
print("Mouse is pointing at:", collider.name)
else:
print("Mouse is not pointing at the target node.")
else:
print("Mouse is not pointing at anything.")

View File

@ -1,23 +1,40 @@
[gd_scene load_steps=9 format=3 uid="uid://hivk5ek6u887"]
[gd_scene load_steps=14 format=3 uid="uid://hivk5ek6u887"]
[ext_resource type="Texture2D" uid="uid://c5uytbu1wc1bq" path="res://addons/kenney_prototype_textures/orange/texture_09.png" id="1_llm1c"]
[ext_resource type="Texture2D" uid="uid://e4nd8b6f0tw7" path="res://addons/kenney_prototype_textures/dark/texture_04.png" id="2_k2arh"]
[ext_resource type="Texture2D" uid="uid://du0f7hc4skged" path="res://addons/kenney_prototype_textures/dark/texture_06.png" id="1_lae2b"]
[ext_resource type="Texture2D" uid="uid://dmge3tk7w0b1n" path="res://addons/kenney_prototype_textures/dark/texture_01.png" id="2_7newm"]
[ext_resource type="PackedScene" uid="uid://cn7ty4xcbiqaf" path="res://assets/models/character/character.glb" id="3_exa4b"]
[ext_resource type="PackedScene" uid="uid://ccm77j5rkh21w" path="res://scenes/utils/character.tscn" id="3_omcjn"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_llvtk"]
albedo_texture = ExtResource("1_llm1c")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bcdcw"]
albedo_texture = ExtResource("1_lae2b")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_50gm5"]
albedo_texture = ExtResource("2_k2arh")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p4psn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_c334k"]
albedo_texture = ExtResource("2_k2arh")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0jiki"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nlanx"]
albedo_texture = ExtResource("2_k2arh")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1pwnn"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cjh6x"]
albedo_texture = ExtResource("2_k2arh")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1yo6k"]
albedo_texture = ExtResource("2_7newm")
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_3aaun"]
[sub_resource type="Sky" id="Sky_xco2g"]
sky_material = SubResource("ProceduralSkyMaterial_3aaun")
[sub_resource type="Environment" id="Environment_5t2t5"]
background_mode = 2
sky = SubResource("Sky_xco2g")
sdfgi_enabled = true
fog_light_energy = 0.52
fog_density = 0.1387
volumetric_fog_enabled = true
volumetric_fog_density = 0.0
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_32hnm"]
[node name="TestMap" type="Node3D"]
@ -28,33 +45,72 @@ shadow_enabled = true
[node name="Base" type="Node3D" parent="."]
[node name="Floor" type="CSGBox3D" parent="Base"]
material_override = SubResource("StandardMaterial3D_llvtk")
material_override = SubResource("StandardMaterial3D_bcdcw")
use_collision = true
size = Vector3(100, 1, 100)
[node name="Wall_1" type="CSGBox3D" parent="Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 50, 0, 0)
material_override = SubResource("StandardMaterial3D_50gm5")
material_override = SubResource("StandardMaterial3D_p4psn")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_2" type="CSGBox3D" parent="Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -50, 0, 0)
material_override = SubResource("StandardMaterial3D_c334k")
material_override = SubResource("StandardMaterial3D_0jiki")
use_collision = true
size = Vector3(1, 20, 100)
[node name="Wall_3" type="CSGBox3D" parent="Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 50)
material_override = SubResource("StandardMaterial3D_nlanx")
material_override = SubResource("StandardMaterial3D_1pwnn")
use_collision = true
size = Vector3(100, 20, 1)
[node name="Wall_4" type="CSGBox3D" parent="Base"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -50)
material_override = SubResource("StandardMaterial3D_cjh6x")
material_override = SubResource("StandardMaterial3D_1yo6k")
use_collision = true
size = Vector3(100, 20, 1)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_5t2t5")
camera_attributes = SubResource("CameraAttributesPractical_32hnm")
[node name="Room" type="Node3D" parent="."]
[node name="Roof" type="CSGBox3D" parent="Room"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 10, 40)
use_collision = true
size = Vector3(20, 1, 20)
[node name="Box2" type="CSGBox3D" parent="Room"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 31.4113, -0.977205, 30.1989)
use_collision = true
size = Vector3(15, 4, 5)
[node name="Box2" type="CSGBox3D" parent="Room/Box2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.808781, 0.545475, -9.7784)
use_collision = true
size = Vector3(15, 4, 5)
[node name="Box" type="CSGBox3D" parent="Room"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45.354, 2, 30)
use_collision = true
size = Vector3(15, 4, 5)
[node name="Box3" type="CSGBox3D" parent="Room"]
transform = Transform3D(0.919513, -0.393059, 0, 0.393059, 0.919513, 0, 0, 0, 1, -1.57507, -0.966964, 27.4611)
use_collision = true
size = Vector3(15, 4, 5)
[node name="Box4" type="CSGBox3D" parent="Room"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.9181, -1.39989, 28.83)
use_collision = true
size = Vector3(15, 4, 5)
[node name="character" parent="Room" instance=ExtResource("3_exa4b")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15.2581, 0.499998, 16.9319)
[node name="Character" parent="." instance=ExtResource("3_omcjn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 17.9816, 0, 28.0621)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)