James, on Oct 10 2009, 04:37 AM, said:
I mean I've coded in a computer system that reads saved gamevars and displays them onscreen as a status thing. When I press K to see my ally's stuff it just reads the gamevars in my config file rather than his; but of course from his point of view it's displaying his stuff and pressing K when I'm using the PC displays his again as well. When I try and read if the weapon is unlocked, since it's unlocked for me it works ok but since it's still locked on his system it comes out negative and so desyncs since the game doesn't understand that our configs would have different saved vars or something.
What if you did something like this:
gamevar initplayer NO 1 gamearray weapmods 8 // each element is a bitfield storing all weapon mods for a player gamevar myweapmods 0 1 // this is what is saved to the ini file gamevar temp 0 0 state initp setvar initplayer YES readgamevar myweapmods getactor[THISACTOR].yvel temp setarray weapmods[temp] myweapmods ends actor APLAYER MAXPLAYERHEALTH PSTAND 0 0 ifvare initp NO state initp
So what you do is read the array element corresponding to the player number, rather than reading the gamevar from the file. Then you can display each player's stuff separately. When you get a new weapon mod, you add that to myweapmods, save that gamevar, and then update the array accordingly.
EDIT: It would make things messy if players changed their IDs in mid-game, but the basic concept seems sound.