Verse Library verse

01 Snippet

Base class ensuring devices wait for initialization before executing logic.

extracted-snippets/community/snippets/90Em/fortnite-ensure-onbegin-execution-order/01-snippet.verse

# Source URL: https://dev.epicgames.com/community/snippets/90Em/fortnite-ensure-onbegin-execution-order
# Local doc:  epic-docs/community/snippets/90Em/fortnite-ensure-onbegin-execution-order.md
  using { /Fortnite.com/Devices }
  awaitable_creative_device<public> := class(creative_device):
  ReadyEvent<private> : event() = event(){}
  var IsReady<private> : logic = false
  OnBegin<override>()<suspends>:void=
  defer:
  Ready()
  OnAwaitableBegin()
  OnAwaitableBegin<public>()<suspends>:void=
  block{}
  Ready<protected>():void=
  set IsReady = true
  ReadyEvent.Signal()
  AwaitBegin<public>()<suspends>:void=
  if (not IsReady?):
  ReadyEvent.Await()

  Expand code  Copy full snippet(23 lines long)
* ```
  using { /Fortnite.com/Devices }
  using { /Verse.org/Simulation }
  
  vehicle_manager_device := class(awaitable_creative_device):
  
      @editable
      DirtbikeSpawners<private> : []vehicle_spawner_dirtbike_device = array{}
  
      @editable

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