update biome generator to support new ai
This commit was merged in pull request #34.
This commit is contained in:
@@ -4,11 +4,6 @@ extends Node3D
|
||||
const CHUNK_TYPE_BIOME: int = 0
|
||||
const CHUNK_TYPE_STRAIGHT_TRACK: int = 1
|
||||
const CHUNK_TYPE_CURVED_TRACK: int = 2
|
||||
const ENTITY_TYPE_HUMANOID: int = 0
|
||||
const ENTITY_TYPE_ANIMAL: int = 1
|
||||
const ENTITY_SPAWN_ANY: int = 0
|
||||
const ENTITY_SPAWN_HUMANOID_ONLY: int = 1
|
||||
const ENTITY_SPAWN_ANIMAL_ONLY: int = 2
|
||||
|
||||
const CHUNK_GENERATION_FRAME_BUDGET_USEC: int = 1000 #2 ms/frame to generate chunks
|
||||
const CHUNK_CLEANUP_FRAME_BUDGET_USEC: int = 1000 #1 ms/frame per cleanup
|
||||
@@ -922,11 +917,10 @@ func _spawn_entities_for_chunk(root: Node, biome_name: String) -> void:
|
||||
|
||||
func _get_spawn_point_type_filter(spawn_point: Node) -> int:
|
||||
if "allowed_type" in spawn_point:
|
||||
match spawn_point.allowed_type:
|
||||
ENTITY_SPAWN_HUMANOID_ONLY:
|
||||
return ENTITY_TYPE_HUMANOID
|
||||
ENTITY_SPAWN_ANIMAL_ONLY:
|
||||
return ENTITY_TYPE_ANIMAL
|
||||
if spawn_point.allowed_type == 0:
|
||||
return -1
|
||||
else:
|
||||
return spawn_point.allowed_type - 1
|
||||
return -1
|
||||
|
||||
func _pick_compatible_entity(biome_name: String, type_filter: int) -> PackedScene:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends Marker3D
|
||||
class_name EntitySpawnPoint
|
||||
|
||||
enum AllowedType { ANY, HUMANOID_ONLY, ANIMAL_ONLY }
|
||||
enum AllowedType { ANY, FARMER, CITIZEN_WALKER, CITIZEN_SITTER, CAT, CROW, FOX, GOAT, RACOON, WAGYU }
|
||||
|
||||
@export var allowed_type: AllowedType = AllowedType.ANY
|
||||
@export_range(0.0, 1.0, 0.01) var spawn_chance: float = 1.0
|
||||
|
||||
Reference in New Issue
Block a user