I want to set to state of a specific agent to true, but don’t know how.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
game_manager := class(creative_device):
@editable ChooseStartingWeaponDialog : popup_dialog_device = popup_dialog_device{}
@editable HasPlayerChosenStartingWeapon : switch_device = switch_device{}
@editable PlayerSpawners : []player_spawner_device = array{}
OnBegin<override>()<suspends>:void=
for (PlayerSpawner : PlayerSpawners):
PlayerSpawner.SpawnedEvent.Subscribe(OnPlayerSpawned)
ChooseStartingWeaponDialog.RespondingButtonEvent.Subscribe(PlayerHasChosenStartingWeapon)
OnPlayerSpawned(Agent:agent):void=
HasPlayerChosenStartingWeapon.LoadState(Agent)
HasPlayerJoinedBefore(Agent)
HasPlayerJoinedBefore(Agent:agent):void=
if (HasPlayerChosenStartingWeapon.GetCurrentState[Agent]):
else:
ChooseStartingWeaponDialog.Show(Agent)
PlayerHasChosenStartingWeapon(Agent:agent, State:logic):void=
if (HasPlayerChosenStartingWeapon.SetState[Agent] = true): #I want this switch device to set the state of Agent to true
I cannot use the ToggleState function, because I want to use this code for other parts of my game where that isn’t possible. Thanks in advance for any help!