Since it is not possible to convert text to string, i'm trying to Player Name by taking it from data table. So if I have
General - Pick each integer from 1 to 8, and do (Actions) Actions Data Table - Save (Name of player (Picked integer)) as PlayerName in the Local data table s)
Variable - Set Player[(Picked integer)] (this is string var) = ("PlayerName" from the Local data table)
and later if I want to use the Player[(Picked integer)] as a string for anything later, it returns "" meaning empty string! *yes I could replace the PlayerName with var so it takes different name of every player if the rest worked tho)
Data tables cannot be used to type cast. You cannot get the name of a player account as a string. Do not even waste time trying, it is not possible.
I think data tables work by having a separate entry for each type. Even if the same key path is used, storing text in them will use an unrelated storage location to the string you are trying to read. This is to prevent typecasting, as strings and text might represent different internal structures so cannot be type cast to each other. Typecasting text to string is not allowed because the value of text is local to each client so doing so would cause an out of sync error as strings have to be synchronized across all clients at all times.
The solution is to use the player account handle (for internal use, eg bank signing) or to substitute in the player name (eg for displaying them in game messages). Account handles are unique strings for each player account, they are the same for the same player between games. Most string operations like concatenation still work on text so you can append a player name to any of the text sent to be displayed to the player.
Tables are meant to be used to store values in a named way. Instead of having a linked in variable, tables are dynamic. Through clever use of key string generation one can use them to dynamically make structures like lists which have a huge maximum size.
Since it is not possible to convert text to string, i'm trying to Player Name by taking it from data table. So if I have
General - Pick each integer from 1 to 8, and do (Actions)
Actions
Data Table - Save (Name of player (Picked integer)) as PlayerName in the Local data table
s)
Variable - Set Player[(Picked integer)] (this is string var) = ("PlayerName" from the Local data table)
and later if I want to use the Player[(Picked integer)] as a string for anything later, it returns "" meaning empty string! *yes I could replace the PlayerName with var so it takes different name of every player if the rest worked tho)
How do I use data tables then?
Data tables cannot be used to type cast. You cannot get the name of a player account as a string. Do not even waste time trying, it is not possible.
I think data tables work by having a separate entry for each type. Even if the same key path is used, storing text in them will use an unrelated storage location to the string you are trying to read. This is to prevent typecasting, as strings and text might represent different internal structures so cannot be type cast to each other. Typecasting text to string is not allowed because the value of text is local to each client so doing so would cause an out of sync error as strings have to be synchronized across all clients at all times.
The solution is to use the player account handle (for internal use, eg bank signing) or to substitute in the player name (eg for displaying them in game messages). Account handles are unique strings for each player account, they are the same for the same player between games. Most string operations like concatenation still work on text so you can append a player name to any of the text sent to be displayed to the player.
Tables are meant to be used to store values in a named way. Instead of having a linked in variable, tables are dynamic. Through clever use of key string generation one can use them to dynamically make structures like lists which have a huge maximum size.
Okay, I will stick to Handle of Player like so far, thanks for the details.