Hi there. When using the direct tag examples from the docs I get the following errors: Data definitions at file scope must specify their value domain. (3547)
and Module-scoped 'var' 'weak_map' type must have 'session' key type. (3502)
Relevant code is below, I eventually want to get all objects with those tags, randomly pair and teleport them together, then remove the indexed item from the array, and loop. This means the array needs to be a var
as it needs to be changed (have items removed), right?
New to Verse, a tad confused about this one…
using { /Fortnite.com/Devices }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags}
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/Diagnostics }
room_entrance_tags := class(tag) {}
room_exit_tags := class(tag) {}
var Room_Entrances := GetCreativeObjectsWithTag(room_entrance_tags{})
var Room_Exits := GetCreativeObjectsWithTag(room_exit_tags{})
# AllCreativeObjects : []creative_object_interface := GetCreativeObjectsWithTag(room_entrance_tags{}) # From the docs example, not used, but still errors.
Something sort of along the lines of
RandomiseRooms()<suspends> : void=
for (Exit := Room_Exits):
Index := Random(0, room_entrances.length)
SelectedEntrance = room_entrances[Index]
SelectedEntrance.TeleportTo(Exit)
# Remove the already chosen exit from the array
if (Removed_Exit := Room_Exits.RemoveElement[Exit.Index]): # Does array.Index exist?
set Room_Exits = Removed_Exit
# And the entrance too
if (Removed_Entrance := Room_Entrances.RemoveElement[Index]):
set Room_Exits = Removed_Exit
return
If this is the wrong way to pursue this idea, please point me in the direction of alternatives, or if I should split this post into two separate questions/topics, thanks!