diff --git a/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd new file mode 100644 index 0000000..fb5e5b7 --- /dev/null +++ b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd @@ -0,0 +1,13 @@ +extends FloorSpawner +## Floor spawner that gets removed when the player degrunks it +## We can use this to ensure the beast only gets spawned on heavily-grunked parts of the floor. + + +func serialize() -> Dictionary: + # Nothing to serialize, but we need a placeholder value to show we haven't been destroyed. + return {} + + +func deserialize(_state: Dictionary) -> void: + # Nothing to deserialize, but we won't be freed! + pass diff --git a/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd.uid b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd.uid new file mode 100644 index 0000000..fb65ec8 --- /dev/null +++ b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd.uid @@ -0,0 +1 @@ +uid://b7wejb2uwu43a diff --git a/src/world/grunk_beast/beast_spawner/transient_floor_spawner.tscn b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.tscn index b3aae01..52ee727 100644 --- a/src/world/grunk_beast/beast_spawner/transient_floor_spawner.tscn +++ b/src/world/grunk_beast/beast_spawner/transient_floor_spawner.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://5vh7mnjavlle"] -[ext_resource type="Script" uid="uid://cqildi0gndwp2" path="res://src/world/grunk_beast/beast_spawner/floor_spawner.gd" id="1_42oks"] +[ext_resource type="Script" uid="uid://b7wejb2uwu43a" path="res://src/world/grunk_beast/beast_spawner/transient_floor_spawner.gd" id="1_42oks"] [ext_resource type="PackedScene" uid="uid://ehf5sg3ahvbf" path="res://src/world/grunk_beast/grunk_beast.tscn" id="2_e5rh0"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_42oks"] @@ -16,10 +16,9 @@ height = 0.02 height = 0.1 radius = 1.2 -[node name="TransientFloorSpawner" type="Node3D" node_paths=PackedStringArray("spawn_exclusion_area") groups=["BeastSpawnPoint"]] +[node name="TransientFloorSpawner" type="Node3D" groups=["BeastSpawnPoint", "Persistent"]] script = ExtResource("1_42oks") beast_scene = ExtResource("2_e5rh0") -spawn_exclusion_area = NodePath("SpawnExclusionArea") spawn_priority = 10 metadata/_custom_type_script = "uid://cqildi0gndwp2"