Hey!
I’m 3 weeks into learning UEFN and Verse - so far I’ve made a Gun Game mode and box fight mode.
I’m trying to make an Arena-based FFA game where 16 players are randomly assigned loadouts. I tried using the class device + item granter device in UEFN but faced issues (spawn pads set to random, but when playtesting with 1 other we always landed on pad 1 and 2; therefore only receiving the first 2 of 16 possible loadouts)
I’m trying to create this in Verse where the item granter index is shuffled and then re-assigned to the spawning player. At the moment, I’m consistently spawning in with item granter at first index
Here is my code:
game_manager := class(creative_device):
var PlayerMap : [player]int = map {}
@editable
var WeaponGranters : []item_granter_device = array{}
OnBegin<override>()<suspends>:void=
InitPlayers()
#Randomise order of weapon granters
set WeaponGranters = Shuffle(WeaponGranters)
InitPlayers() : void=
AllPlayers := GetPlayspace().GetPlayers()
for (Player : AllPlayers, FortCharacter := Player.GetFortCharacter[]):
if (set PlayerMap[Player] = 0, WeaponTier := PlayerMap[Player]):
GrantWeapon(Player, WeaponTier)
GrantWeapon(Player : player, WeaponTier: int) : void=
# Print("Attempting to grant weapon")
if (ItemGranter := WeaponGranters[WeaponTier]):
# Print("Granted item to player")
ItemGranter.GrantItem(Player)
Please help! I’ve spent hours trying to fix this and will deeply appreciate any solutions