Class array variable with creative_prop breaks session unexpectedly

Summary

There is some sort of creative_prop error when an arrayed class containing creative_props are intially assigned.
When creative props are initialized in a class array everything clears to a session build but I receive multiple
“LogVerse: Warning: Game_teleport_to_debug_log: (Rolling Back) TeleportTo error: The specified object has been disposed or is otherwise invalid.”
errors. I must manually assign the creative_props in a loop to avoid this error. Given how the working code functions, this seems to be a bug.

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

For the following defined class:
SlotPropsAndIDs := class:
PropSlot : creative_prop = creative_prop{}
CardID : string = “”

If I init by calling the following values:

        var PropsAndIDs : []SlotPropsAndIDs = array{
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot1.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot2.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot3.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot4.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot5.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot6.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot7.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot8.CardBack, CardID:=""}
            }

and run the following code,

        for (Index := 0..PropsAndIDs.Length-1):
            RandomCard := GetRandomInt(0, ShuffledDeck.Length-1)
                if (RandomCardID := ShuffledDeck[RandomCard]):
                    if (set PropsAndIDs[Index] = SlotPropsAndIDs{CardID:=RandomCardID}):

When the session is loaded I get multiple unexpected errors with the TeleportTo function when I extract the creative_props from the array to move around the board.

Expected Result

While the code above does not work, the following does work:

        HandSlotArray : []creative_prop = array{Hand_Slots.HandSlot1.CardBack, Hand_Slots.HandSlot2.CardBack, Hand_Slots.HandSlot3.CardBack, Hand_Slots.HandSlot4.CardBack, Hand_Slots.HandSlot5.CardBack, Hand_Slots.HandSlot6.CardBack, Hand_Slots.HandSlot7.CardBack, Hand_Slots.HandSlot8.CardBack}

        var PropsAndIDs : []SlotPropsAndIDs = array{
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot1.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot2.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot3.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot4.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot5.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot6.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot7.CardBack, CardID:=""},
            SlotPropsAndIDs{PropSlot:=Hand_Slots.HandSlot8.CardBack, CardID:=""}
            }

        for (Index := 0..PropsAndIDs.Length-1):
            RandomCard := GetRandomInt(0, ShuffledDeck.Length-1)
            if (ASlot := HandSlotArray[Index]):
                if (RandomCardID := ShuffledDeck[RandomCard]):
                    if (set PropsAndIDs[Index] = SlotPropsAndIDs{PropSlot:=ASlot,CardID:=RandomCardID}):

I’ve simply written over the init of the var with the same info from a defined array. Everything works as intended with my arrayed class in all functions at that point and I receive no TeleportTo errors.

Observed Result

Compiler and all other signs point to the first bit of code working as well as the second bit of code, though the first bit breaks my island/session in unexpected and major ways.

Platform(s)

UEFN / Windows

Upload an image

In the erring code, you are resetting all elements of PropsAndIDs with PropSlots all being creative_prop{}, rather than the original PropSlot from Hand_Slots. TeleportTo called on such creative_props is expected to warn.

2 Likes

Ah I think I get it - thanks and apologies for the false flag!

1 Like

This topic was automatically closed after 180 days. New replies are no longer allowed.