CRASH: Verse Code Crashed UEFN Editor Upon Opening Map

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

This code crashed Verse editing and UEFN editor when typed

Steps to Reproduce

Type in the code provided

Expected Result

No crashes

Observed Result

Editor crashes with Unhandled Exception: 0x80000003

Platform(s)

PC

teleport.verse (1.8 KB)

`
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/UI }
using { /Verse.org/Simulation }
using { /Verse.org/Colors }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/UI }

teleport := class(creative_device):

@editable
TeleporterDevice: teleporter_device = teleporter_device{}
@editable
TeleporterRoot: creative_prop = creative_prop{}

OnBegin<override>()<suspends>:void=
    AllPlayers := GetPlayspace().GetPlayers()

    for(Player : AllPlayers):
        if(FortCharacter := Player.GetFortCharacter[]):
            
            FortCharacter.CrouchedEvent().Subscribe(OnCrouched)


OnCrouched(FortCharacter:= Agent.GetFortCharacter, IsCrouching:logic):void=
    if(IsCrouching?):
        DistanceX := FortCharacter.GetTransform().Translation.X
        DistanceY := FortCharacter.GetTransform().Translation.Y
        DistanceZ := FortCharacter.GetTransform().Translation.Z

        PlayerPosition : rotation= FortCharacter.GetTransform().Rotation
        
        if (DistanceZ > 0):
            TeleportPos : vector3 = vector3 {X:= DistanceX * 1, Y:= DistanceY * 1, Z:= DistanceZ - 5000.0}
        else:
            TeleportPos : vector3 = vector3 {X:= DistanceX * 1, Y:= DistanceY * 1, Z:= DistanceZ + 5000.0}
        
        TeleportAgentTo(FortCharacter, TeleportPos, PlayerPosition)
        
        
    else:
TeleportAgentTo(Agent: agent, Translation: vector3, Rotation: rotation):void =

    if(TeleporterRoot.TeleportTo[Translation, Rotation]):
        TeleporterDevice.Teleport(Agent)

    else:`

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/UI }
using { /Verse.org/Simulation }
using { /Verse.org/Colors }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/UI }

teleport := class(creative_device):

    @editable
    TeleporterDevice: teleporter_device = teleporter_device{}
    @editable
    TeleporterRoot: creative_prop = creative_prop{}
 
    OnBegin<override>()<suspends>:void=
        AllPlayers := GetPlayspace().GetPlayers()
 
        for(Player : AllPlayers):
            if(FortCharacter := Player.GetFortCharacter[]):
                
                FortCharacter.CrouchedEvent().Subscribe(OnCrouched)
 
   
    OnCrouched(FortCharacter: fort_character, IsCrouching:logic):void=
        if(IsCrouching?):
            DistanceX := FortCharacter.GetTransform().Translation.X
            DistanceY := FortCharacter.GetTransform().Translation.Y
            DistanceZ := FortCharacter.GetTransform().Translation.Z
            var TeleportPos : vector3 = vector3{X:=0.0,Y:=0.0,Z:=0.0}
            PlayerPosition : rotation= FortCharacter.GetTransform().Rotation
            
            if (DistanceZ > 0.0):
                set TeleportPos = vector3 {X:= DistanceX * 1.0, Y:= DistanceY * 1.0, Z:= DistanceZ - 5000.0}
            else:
                set TeleportPos = vector3 {X:= DistanceX * 1.0, Y:= DistanceY * 1.0, Z:= DistanceZ + 5000.0}
            
            if(Agent:=FortCharacter.GetAgent[]):
                TeleportAgentTo(Agent, TeleportPos, PlayerPosition)
            
            
        else:
    TeleportAgentTo(Agent: agent, Translation: vector3, Rotation: rotation):void =

        if(TeleporterRoot.TeleportTo[Translation, Rotation]):
            TeleporterDevice.Teleport(Agent)

        else:

Here is your fixed code. Your OnCrouched Function was incorrect since you cant do FortCharacter:= Agent.GetFortCharacter, in the parameters and also I made all the numbers floats by adding .0 at then end and some other minor mistakes.

This still doesnt really explain why uefn kept crashing instead of showing you your errors and letting you rebuild. Most of the mistakes I found by rebooting uefn many times and looking at the log the verse build errors.

Heres the fixed code I found out. but yeah no why on crashing

OnCrouched(FortCharacter: fort_character, Crouching: logic):void=
    if (Crouching?):
            
        DistanceX := FortCharacter.GetTransform().Translation.X
        DistanceY := FortCharacter.GetTransform().Translation.Y
        DistanceZ := FortCharacter.GetTransform().Translation.Z

        PlayerRotation : rotation= FortCharacter.GetViewRotation()
        
        if (DistanceZ > 0.0):
            TeleportPos : vector3 = vector3 {X:= DistanceX * 1, Y:= DistanceY * 1, Z:= DistanceZ - 5000.0}
            if:
                FortCharacter.TeleportTo[TeleportPos, PlayerRotation]
                
        else:
            TeleportPos : vector3 = vector3 {X:= DistanceX * 1, Y:= DistanceY * 1, Z:= DistanceZ + 5000.0}
            if:
                FortCharacter.TeleportTo[TeleportPos, PlayerRotation]`
1 Like