Verse Issue

I am experiencing an “unknown identifier” error in-between the asterisks (Bold and italicized). Could somebody please help me fix this bug?

using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/FortPlayerUtilities }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

See Create Your Own Device Using Verse | Unreal Editor For Fortnite Documentation | Epic Developer Community for how to create a verse device.

A Verse-authored creative device that can be placed in a level

game_manager := class(creative_device):
@editable PlayerStatsManager : player_stats_manager = player_stats_manager{}
@editable RankManager : rank_manager = rank_manager{}
@editable UIManager : user_interface_manager = user_interface_manager{}

@editable       GuardSpawner : guard_spawner_device = guard_spawner_device{}
@editable       PlayerSpawners : []player_spawner_device = array{}

var Players : []player = array{}

# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
    set Players = GetPlayspace().GetPlayers()
    PlayerStatsManager.Init(Players)
    UIManager.Init(Players)
    RankManager.Init(Players)
    for ( PlayerSpawner : PlayerSpawners):
        PlayerSpawner.SpawnedEvent.Subscribe(OnPlayerSpawn)
    spawn{GuardLoop()}
    Update()

# ONLY FOR GUARD TESTING PURPOSES 
GuardLoop()<suspends> : void =
    loop:
        A := GuardSpawner.SpawnedEvent.Await()
        if ( F := A.GetFortCharacter[]):
            spawn{AwaitElimination(F)}

Update()<suspends> : void =
    sync:
        loop:
            Player := GetPlayspace().PlayerAddedEvent().Await()
            if ( not Players.Find[Player]):
                set Players += array{Player}
                PlayerStatsManager.InitializePlayersStats(Player)
                UIManager.InitializePlayerUI(Player)
                RankManager.InitializePlayerRank(Player)
        loop:
            Player := GetPlayspace().PlayerRemovedEvent().Await()
            set Players = for(CurrentPlayer : Players, CurrentPlayer <> Player) { CurrentPlayer }

OnPlayerSpawn(Agent : agent) : void =
    if ( FortCharacter := Agent.GetFortCharacter[]):
        spawn{AwaitElimination(FortCharacter)}

AwaitElimination(FortCharacter : fort_character)<suspends> : void =
    Result := FortCharacter.EliminatedEvent().Await()
    RankManager.HandleElimination(Result)

Hi.
It is hard to tell what’s going on with this. But the unknown identifier simply means that the program can’t find or see what it is looking for. What is UIManager.Init()? If that’s a method or function within a class, then the main program is saying it can’t find or see it. Where exactly is Init? Is it a class? If so, it needs to be a part of this file or there needs to be a reference to that class somewhere. It is hard to tell from what’s here.

Hope that helps a little.

You need to define user_interface_manager class.
Please use quotes when pasting code.
You should also append a compile error message.

1 Like

hi @deskyze
Looks like you need to add

using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/UI }

the text for formatting is `and` and ` so you have three reverse apostrophe together at
the beginning of of the block of text you want to format and at the end

the documentation is at
User Interface Settings | Fortnite Creative Documentation

2 Likes