Add Ground Zero map boundary
This commit is contained in:
@@ -112,6 +112,15 @@ SAFE_SPAWN_CONFIG = {
|
||||
],
|
||||
}
|
||||
|
||||
MAP_BOUNDARY_CONFIG = {
|
||||
"label": "AGR_GroundZeroMapBoundary",
|
||||
"boundary_id": "ground_zero_mvp_tile",
|
||||
"location": unreal.Vector(0.0, 0.0, 10000.0),
|
||||
"extent": unreal.Vector(50000.0, 50000.0, 25000.0),
|
||||
"padding_cm": 250.0,
|
||||
"warning_distance_cm": 3000.0,
|
||||
}
|
||||
|
||||
|
||||
DEMO_ACTORS = [
|
||||
{
|
||||
@@ -880,6 +889,29 @@ def spawn_weather_exposure_zone(spec, height_values):
|
||||
return actor
|
||||
|
||||
|
||||
def spawn_map_boundary_volume():
|
||||
actor = unreal.AgrarianEditorAutomationLibrary.spawn_actor_in_editor_world(
|
||||
unreal.AgrarianMapBoundaryVolume,
|
||||
MAP_BOUNDARY_CONFIG["location"],
|
||||
unreal.Rotator(0.0, 0.0, 0.0),
|
||||
MAP_BOUNDARY_CONFIG["label"],
|
||||
)
|
||||
if not actor:
|
||||
raise RuntimeError(f"Could not spawn {MAP_BOUNDARY_CONFIG['label']}")
|
||||
|
||||
set_actor_label(actor, MAP_BOUNDARY_CONFIG["label"])
|
||||
actor.set_editor_property("boundary_id", MAP_BOUNDARY_CONFIG["boundary_id"])
|
||||
actor.set_editor_property("boundary_padding_cm", MAP_BOUNDARY_CONFIG["padding_cm"])
|
||||
actor.set_editor_property("warning_distance_cm", MAP_BOUNDARY_CONFIG["warning_distance_cm"])
|
||||
actor.set_editor_property("clamp_players_at_boundary", True)
|
||||
actor.boundary_volume.set_box_extent(MAP_BOUNDARY_CONFIG["extent"], True)
|
||||
unreal.log(
|
||||
f"Placed {MAP_BOUNDARY_CONFIG['label']} at {actor.get_actor_location()} "
|
||||
f"extent {MAP_BOUNDARY_CONFIG['extent']}"
|
||||
)
|
||||
return actor
|
||||
|
||||
|
||||
def main():
|
||||
if not unreal.EditorLevelLibrary.load_level(MAP_PATH):
|
||||
raise RuntimeError(f"Could not load map: {MAP_PATH}")
|
||||
@@ -894,6 +926,7 @@ def main():
|
||||
labels.update(spec["label"] for spec in ENVIRONMENT_VARIATION_ACTORS)
|
||||
labels.update(spec["label"] for spec in RUIN_PLACEHOLDER_ACTORS)
|
||||
labels.add(FOLIAGE_LABEL)
|
||||
labels.add(MAP_BOUNDARY_CONFIG["label"])
|
||||
remove_existing_demo_actors(labels)
|
||||
|
||||
materials = ensure_environment_materials()
|
||||
@@ -911,6 +944,7 @@ def main():
|
||||
spawn_environment_variation_actor(spec, height_values, materials)
|
||||
for spec in RUIN_PLACEHOLDER_ACTORS:
|
||||
spawn_environment_variation_actor(spec, height_values, materials)
|
||||
spawn_map_boundary_volume()
|
||||
for spec in DEMO_ACTORS:
|
||||
spawn_demo_actor(spec, height_values, materials, safe_spawn_location_xy)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user