hi @GraemeBB ,
The way around this problem is to use the
<decides><transacts>
In your function with an
if (conditions) { … }
#this sort of persistence code is replaced by the <decides><transacts> below
var PlayerProfileDataMap:weak_map(player, player_profile_data) = map{}
# This code checks the variable using rollback
IsPuzzleSolved()<decides><transacts> : void =
CurrentState = PlayerProfileDataMap
# succeeds if CurrentState is equal to PuzzleSolution, and fails if not
if (IsPuzzleSolved()) { … }
This is template code made from the Verse Persistence documentation where
Inside the block is the code for accessing the persistence weak_map variable.
<decides><transacts>
prevents the Verse runtime error
This code comes from
Verse Failure Contexts
Dealing with VersePersistence weak_map
Previously posted about this in another post
I want to know under what conditions this error occurs in Verse
This another post that may be useful
What happens when verse runtime error occurs