Verse Library verse

01 Snippet

Defines room classes and a component to spawn dungeon rooms dynamically using the Unreal Scene Graph.

extracted-snippets/community/snippets/GwWz/fortnite-random-room-spawning-using-scene-graph/01-snippet.verse

# Source URL: https://dev.epicgames.com/community/snippets/GwWz/fortnite-random-room-spawning-using-scene-graph
# Local doc:  epic-docs/community/snippets/GwWz/fortnite-random-room-spawning-using-scene-graph.md
  using { /Fortnite.com/Devices }
  using { /Verse.org/SceneGraph }
  using { /Verse.org/Simulation }
  using { /Verse.org/SpatialMath }
  # Defines a room in the dungeon.
  dungeon_room := class<abstract>:
  # Whether or not the room contains enemies.
  @editable
  ContainsEnemies:logic = false
  # The physical bounds of the room. Defaults to double the fortnite tile size of 512cm x 384cm x 512cm to represent a 2x2 tile room.
  @editable_vector_number(float):
  ToolTip := RoomBoundsTip
  RoomBounds:vector3 = vector3{Left := 512.0, Up := 256.0, Forward := 512.0}
  # What enemies should spawn in the room.
  @editable
  EnemySpawners:[]guard_spawner_device = array{}
  # Constructs the entity prefab associated with this dungeon room.
  ConstructRoomPrefab()<transacts>:?entity = false
  <#
  simple_dungeon_room := class<concrete>(dungeon_room):
  # Constructs the entity prefab associated with this dungeon room.
  ConstructRoomPrefab<override>()<transacts>:?entity=
  NewRoom := DungeonCrawler.Prefabs.Prefab_FortSizeRoom{}
  option{NewRoom}
  #>

  Expand code  Copy full snippet(32 lines long)
* ```

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in