It returns error This function parameter expects a value of type ?agent->void, but this argument is an incompatible value of type type{_(:[]char)<suspends>:void}.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
# A Verse-authored creative device that can be placed in a level
MapLoader := class(creative_device):
@editable
CC:trigger_device = trigger_device{}
@editable
MapText:billboard_device = billboard_device{}
@editable
DifficultyText:billboard_device = billboard_device{}
var initseconds : int = 0
@editable
StartTimer:billboard_device = billboard_device{}
@editable
RNG:rng_device = rng_device{}
@editable
InitTimerInit:trigger_device = trigger_device{}
StringToMessage<localizes>(value:string)<computes> : message = "{value}"
OnBegin<override>()<suspends>:void=
Print("Script started")
MapText.SetText(StringToMessage("Waiting for player(s).."))
DifficultyText.SetText(StringToMessage(" "))
StartTimer.SetText(StringToMessage("{initseconds}s"))
Print("Defaults set")
InitTimerInit.TriggeredEvent.Await()
Print("I saw a TriggeredEvent")
set initseconds = 10
Print("initseconds set")
loop:
if (initseconds > 0):
set initseconds = initseconds - 1
Sleep(1.0)
StartTimer.SetText(StringToMessage("{initseconds}s"))
Print("{initseconds}")
else:
StartTimer.SetText(StringToMessage("{initseconds}s"))
Print("Done")
RNG.Activate()
CC.TriggeredEvent.Subscribe(OnTriggeredEvent)
break
OnTriggeredEvent<private>(Reading : string)<suspends>:void=
MapText.SetText(StringToMessage("Castaway Castles"))
DifficultyText.SetText(StringToMessage("EASY"))