thisbecasper, on 28 October 2017 - 01:40 AM, said:
I would have no trouble in handling the data once I've got them, It's just a matter of how I can view another aplayer actor's gamevar's value in realtime (once I've got the ID of the player I'm hitting, or whatever) - I'm working on some multiplayer stuff and I'm using the eduke32-oldmp build, idk if that's make a difference. I will try look at your code and see if it works the same way for players, thanks!
For damage data, you have to look at the player's
sprite, not the player number. The sprite number of a player is the value of player[THISACTOR].i
When you are accessing a player via their player number, but you want information about their sprite, you can grab that sprite ID and then dig into the sprite data.
You could try using this code to populate an array with the player health values:
gamearray playerhealth 8
gamevar temp 0 0
gamevar temp2 0 0
appendevent EVENT_GAME
ifactor APLAYER
{
getactor[THISACTOR].yvel temp
getactor[THISACTOR].extra temp2
setarray playerhealth[temp] temp2
}
endevent
And then at any point in your code, you can setvarvar <varname> playerhealth[PLAYER#]
Alternatively, you can skip the new array, and at any time use:
getplayer[PLAYER#].i temp
getactor[temp].extra temp2 // where temp2 is the health value