I noticed that if (set some_trigger_device.Enable()){} does not throw any errors but crashes UE when building the verse script. The project will continue to crash every time you open it up until I remove this line.

This is the correct code by the way

Hi @FinestCreative would you mind trying to repro this crash once again and send us UEFN logs? Thanks a bunch!
Note that
if (TriggersOut[WinningVoteIndex].Enable()) {}
should work - I’m guessing the issue is the use of set. EDIT: Nevermind - it has no_rollback effect. Are you able to share the definition of TriggersOut? I’m guessing it’s something like []trigger_device. I’m having trouble producing a reduced example that causes a crash.
TriggersOut is indeed of type []trigger_device. While I was working on another project I pasted in this bugged line and it crashed like I reported. Here is the verse
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /EpicGames.com/Temporary/Diagnostics }
event_handler := class:
Index:int
Main:main
HandlerRoundStart():void=
Main.RoundStart(Index)
# A Verse-authored creative device that can be placed in a level
main := class(creative_device):
@editable var TriggersOut:[]trigger_device = array{}
# Only enabled in round 1
@editable Rounds:[]round_settings_device = array{}
OnBegin<override>()<suspends>:void=
Print("Hello, world!")
if (set TriggersOut[0].Enable()){}
# Everything that subscribes goes here
SubscribeAll()<suspends>:void=
Self.GetPlayspace().PlayerAddedEvent().Subscribe(OnPlayerAdded)
Self.GetPlayspace().PlayerRemovedEvent().Subscribe(OnPlayerRemoved)
for(X -> CurrentRound:Rounds){
Handler := event_handler{Index := X,Main := Self}
CurrentRound.RoundBeginEvent.Subscribe(Handler.HandlerRoundStart)
}
# Handle player joining the island
OnPlayerAdded(Agent:agent):void=
{}
# Handle player joining the island
OnPlayerRemoved(Agent:agent):void={}
RoundStart(RoundNumber:int):void={}
Thank you! Used this to successfully reproduce.
1 Like