Add DeployToSteamOS and Procedural Dungeon Generation addons
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cq6rrn2gpph6y"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_i6opq"]
|
||||
[ext_resource type="Texture2D" uid="uid://i7rtr0ewxm5j" path="res://addons/SimpleDungeons/sample_assets/blue-checkerboard-cc0.png" id="2_6nsgb"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_b5q7u"]
|
||||
albedo_texture = ExtResource("2_6nsgb")
|
||||
uv1_triplanar = true
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_3qcmr"]
|
||||
script/source = "@tool
|
||||
extends Node
|
||||
|
||||
func remove_unused_doors():
|
||||
for door in $\"..\".get_doors():
|
||||
if door.get_room_leads_to() == null:
|
||||
door.door_node.queue_free()
|
||||
|
||||
func _on_dungeon_done_generating():
|
||||
remove_unused_doors()
|
||||
"
|
||||
|
||||
[node name="BlueRoom" type="Node3D"]
|
||||
script = ExtResource("1_i6opq")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.68248e-07, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_b5q7u")
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
size = Vector3(9.5, 9.5, 9.5)
|
||||
|
||||
[node name="DOOR?_F_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, -5.25)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_R_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_L_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_B_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, 5)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = SubResource("GDScript_3qcmr")
|
||||
|
||||
[node name="PlayerSpawnPoint" type="Node3D" parent="." groups=["player_spawn_point"]]
|
||||
|
||||
[connection signal="dungeon_done_generating" from="." to="RemoveUnusedDoors" method="_on_dungeon_done_generating"]
|
||||
@@ -0,0 +1,59 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b2t06bycrtldn"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_qqrlr"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqvyc0ok7chld" path="res://addons/SimpleDungeons/sample_assets/kenney-grey-checkerboard-cc0.png" id="2_jdiqu"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oj2cm"]
|
||||
albedo_texture = ExtResource("2_jdiqu")
|
||||
uv1_triplanar = true
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ldqn2"]
|
||||
script/source = "@tool
|
||||
extends Node
|
||||
|
||||
func remove_unused_doors():
|
||||
for door in $\"..\".get_doors():
|
||||
if door.get_room_leads_to() == null:
|
||||
door.door_node.queue_free()
|
||||
|
||||
func _on_dungeon_done_generating():
|
||||
remove_unused_doors()
|
||||
"
|
||||
|
||||
[node name="Corridor" type="Node3D"]
|
||||
script = ExtResource("1_qqrlr")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.68248e-07, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_oj2cm")
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
size = Vector3(9.5, 9.5, 9.5)
|
||||
|
||||
[node name="DOOR?_F_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, -5.25)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_R_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_L_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_B_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, 5)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = SubResource("GDScript_ldqn2")
|
||||
|
||||
[connection signal="dungeon_done_generating" from="." to="RemoveUnusedDoors" method="_on_dungeon_done_generating"]
|
||||
@@ -0,0 +1,39 @@
|
||||
@tool
|
||||
extends DungeonGenerator3D
|
||||
|
||||
func _ready():
|
||||
self.custom_get_rooms_function = custom_get_rand_rooms
|
||||
super._ready()
|
||||
|
||||
func _process(delta):
|
||||
super._process(delta)
|
||||
|
||||
func custom_get_rand_rooms(room_instances : Array[DungeonRoom3D], rng_seeded : RandomNumberGenerator) -> Array[DungeonRoom3D]:
|
||||
var num_blue_rooms : int = 30
|
||||
var num_red_rooms : int = 30
|
||||
var blue_room = room_instances.filter(func(r): return r.name == "BlueRoom")[0]
|
||||
var red_room = room_instances.filter(func(r): return r.name == "RedRoom")[0]
|
||||
var rooms : Array[DungeonRoom3D] = []
|
||||
while num_red_rooms > 0:
|
||||
var inst = red_room.create_clone_and_make_virtual_unless_visualizing()
|
||||
rooms.push_back(inst)
|
||||
# Set room_rotations before set_position_by_grid_pos as it is set by AABB positon. May change when rotated.
|
||||
inst.room_rotations = rng_seeded.randi()
|
||||
inst.set_position_by_grid_pos(
|
||||
Vector3i(
|
||||
(rng_seeded.randi() % dungeon_size.x) / 2,
|
||||
rng_seeded.randi() % dungeon_size.y,
|
||||
rng_seeded.randi() % dungeon_size.z))
|
||||
num_red_rooms -= 1
|
||||
while num_blue_rooms > 0:
|
||||
var inst = blue_room.create_clone_and_make_virtual_unless_visualizing()
|
||||
rooms.push_back(inst)
|
||||
# Set room_rotations before set_position_by_grid_pos as it is set by AABB positon. May change when rotated.
|
||||
inst.room_rotations = rng_seeded.randi()
|
||||
inst.set_position_by_grid_pos(
|
||||
Vector3i(
|
||||
(rng_seeded.randi() % dungeon_size.x) / 2 + dungeon_size.x / 2,
|
||||
rng_seeded.randi() % dungeon_size.y,
|
||||
rng_seeded.randi() % dungeon_size.z))
|
||||
num_blue_rooms -= 1
|
||||
return rooms
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d1k8jtivamexj"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/sample_dungeons/custom_random_room_function_example/dungeon_generator_3d_custom.gd" id="1_smyj4"]
|
||||
[ext_resource type="PackedScene" uid="uid://cq6rrn2gpph6y" path="res://addons/SimpleDungeons/sample_dungeons/custom_random_room_function_example/blue_room.tscn" id="2_rfqbn"]
|
||||
[ext_resource type="PackedScene" uid="uid://dh2i3dk3g0icv" path="res://addons/SimpleDungeons/sample_dungeons/custom_random_room_function_example/red_room.tscn" id="3_hfdry"]
|
||||
[ext_resource type="PackedScene" uid="uid://br3pjd5mcjj11" path="res://addons/SimpleDungeons/sample_dungeons/custom_random_room_function_example/stairs.tscn" id="4_2jnyt"]
|
||||
[ext_resource type="PackedScene" uid="uid://b2t06bycrtldn" path="res://addons/SimpleDungeons/sample_dungeons/custom_random_room_function_example/corridor.tscn" id="5_5efio"]
|
||||
|
||||
[node name="DungeonGenerator3dInheritedClass" type="Node3D"]
|
||||
script = ExtResource("1_smyj4")
|
||||
room_scenes = Array[PackedScene]([ExtResource("2_rfqbn"), ExtResource("3_hfdry"), ExtResource("4_2jnyt")])
|
||||
corridor_room_scene = ExtResource("5_5efio")
|
||||
@@ -0,0 +1,59 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dh2i3dk3g0icv"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ruwq1"]
|
||||
[ext_resource type="Texture2D" uid="uid://dydd6x64uxryr" path="res://addons/SimpleDungeons/sample_assets/kenney-red-checkerboard-cc0.png" id="2_270m7"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yl5wx"]
|
||||
albedo_texture = ExtResource("2_270m7")
|
||||
uv1_triplanar = true
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_mnevw"]
|
||||
script/source = "@tool
|
||||
extends Node
|
||||
|
||||
func remove_unused_doors():
|
||||
for door in $\"..\".get_doors():
|
||||
if door.get_room_leads_to() == null:
|
||||
door.door_node.queue_free()
|
||||
|
||||
func _on_dungeon_done_generating():
|
||||
remove_unused_doors()
|
||||
"
|
||||
|
||||
[node name="RedRoom" type="Node3D"]
|
||||
script = ExtResource("1_ruwq1")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.68248e-07, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_yl5wx")
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
size = Vector3(9.5, 9.5, 9.5)
|
||||
|
||||
[node name="DOOR?_F_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, -5.25)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_R_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_L_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5, -2.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_B_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.75, 5)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = SubResource("GDScript_mnevw")
|
||||
|
||||
[connection signal="dungeon_done_generating" from="." to="RemoveUnusedDoors" method="_on_dungeon_done_generating"]
|
||||
@@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://br3pjd5mcjj11"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_pixse"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqvyc0ok7chld" path="res://addons/SimpleDungeons/sample_assets/kenney-grey-checkerboard-cc0.png" id="2_bdw51"]
|
||||
[ext_resource type="PackedScene" uid="uid://bak8ltrhbmlv5" path="res://addons/SimpleDungeons/utils/CSGStairMaker3D.tscn" id="3_dobr2"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6cnww"]
|
||||
albedo_texture = ExtResource("2_bdw51")
|
||||
uv1_triplanar = true
|
||||
uv1_world_triplanar = true
|
||||
|
||||
[node name="Stairs" type="Node3D"]
|
||||
script = ExtResource("1_pixse")
|
||||
size_in_voxels = Vector3i(2, 2, 1)
|
||||
max_count = 20
|
||||
is_stair_room = true
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_6cnww")
|
||||
use_collision = true
|
||||
size = Vector3(20, 20, 10)
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
operation = 2
|
||||
size = Vector3(19.5, 19.5, 9.5)
|
||||
|
||||
[node name="DOOR?_R_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 9.8, -7.75, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="DOOR?_L_CUT" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -9.9, 2.25, 0)
|
||||
operation = 2
|
||||
size = Vector3(2, 4, 1)
|
||||
|
||||
[node name="CSGStairMaker3D" parent="." instance=ExtResource("3_dobr2")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.75, -4.75, 0)
|
||||
use_collision = true
|
||||
size = Vector3(14, 10, 9.5)
|
||||
num_stairs = 32
|
||||
Reference in New Issue
Block a user