Persistent Player Object
Hordy last edited by
Does anyone know how to get a Kismet-reference to a player which remains the same even when the player reconnects to the server? Obviously there is sth like that because the player score is preserved even when the game was restarted to reconnect to the server.
Maybe it is possible to get it from the PlayerController with the correct value specified in the ‘Get Property’ node.
I’m trying to award some extra score for late joiners, but for each client only once. A steam ID would do the job as well.
Ok, I got a lead on this: I found the PlayerReplicationInfo class in the Chiv folder. However, there are 2 IDs to use:
/** Unique id number. */ var int PlayerID; /** The id used by the network to uniquely identify a player. * NOTE: this property should *never* be exposed to the player as it's transient * and opaque in meaning (ie it might mean date/time followed by something else) */ var repnotify UniqueNetId UniqueId;
Which one to use? None of them is the steam id.
An other problem appears: since the IDs are returned as an int and a string and NOT as an object, how to store and test them?
Doesn’t seem to be fixed that easily. I had to implement my own ‘string list’, ‘modify string list’ and ‘find in string list’ node for Kismet by using Unrealscript. They are used to store the above mentioned UniqueId to test if a freshly connected player joins for the first time on the server. However, I don’t know much about this UniqueId but it seems to stay the same for a player. I get it by using the ‘Get Property’ node on the PlayerController with the value 'PlayerReplicationInfo’. On the returned object I get the property: 'UniqueID’