Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Verse
Summary
It seems weak_map does not allow to save things containing a class. It yields this error LogVerse: Error: VerseRuntimeErrors: Internal error encountered. This happens when pushing verse changes, and not when pushing all changes. The problem happens when I try to acces the Team in playerdata as it prints “a” but never “b” see video. For now I would have to use a workaround that does not use the playerdata class but rather a build in datatype like int, to save my team
Steps to Reproduce
- Use this code in a verse file:
using { /Verse.org/Simulation }
playerdata := class():
var Team:int = -1
var<public> PlayerData:weak_map(session,[agent]playerdata) = map{}
UpdateTeam(Agent:agent,Team:int):void={
if (var Current:[agent]playerdata = PlayerData[GetSession()]):
Print("a")
if(set Current[Agent].Team = Team){
Print("b")}
else:
Print("c")
if(set Current[Agent] = playerdata{Team:=Team}){}
if(set PlayerData[GetSession()] = Current){}
else:
if(set PlayerData[GetSession()] = map{Agent => playerdata{Team:=Team}}){}
}
- Create a verse device with this code:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
testdevice := class(creative_device):
OnBegin<override>()<suspends>:void=
Print(" ")
Print(" NEW ROUND ")
Print(" ")
for(Agent:Self.GetPlayspace().GetPlayers()):
Print("Attempt update team")
UpdateTeam(Agent,2)
Print("Updated team")
- Link a button to end the round via round settings device
- In island settings change round limit to anything higher than 1, for example 2.
- Push changes and go in live edit
- Build verse code and PUSH VERSE CHANGES
- Start game
- End the round via button
- In the new round verse crashes at this part:
if(set Current[Agent].Team = Team)
Expected Result
Verse does not crash
Observed Result
Verse crashes
Platform(s)
PC
Additional Notes
There were no compile errors or anything
Repro:
Please look into this, took me half a day to find what was wrong and make this bug report