How can we get a value from another class?
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
Test := class<unique>(creative_device):
var PlayerIntMap : [player]int = map{}
TestClass2 : Test2 = Test2{}
OnBegin<override>()<suspends>:void=
if:
Player := GetPlayspace().GetPlayers()[0]
set PlayerIntMap[Player] = 777
then:
#sucess set
TestClass2.A(Player) #success call
ReturnMap():[player]int=
return PlayerIntMap
ReturnInt(Player : player):int=
var IntValue : int = 0
if:
PlayerInt := PlayerIntMap[Player]
set IntValue = PlayerInt
return IntValue
Test2 := class(): #not creative_device
@editable TestClass : Test = Test{}
A(Player : player):void=
if(PlayerInt := TestClass.PlayerIntMap[Player]):
#nothing
if(PlayerInt := Test{}.PlayerIntMap[Player]):
#nothing
TestInstance := Test{}
if(PlayerInt := TestInstance.PlayerIntMap[Player]):
#nothing
NewInstanceMap := TestClass.PlayerIntMap
if(PlayerInt := NewInstanceMap[Player]):
#nothing
NewInstanceMap2 := TestClass.ReturnMap()
if(PlayerInt := NewInstanceMap2[Player]):
#nothing
PlayerIntF := TestClass.ReturnInt(Player)
Print("{PlayerIntF}")
#nothing