Game Development Community

Noob quiestion about client variables

by Alejandro Lopez · in General Discussion · 05/30/2008 (4:57 pm) · 3 replies

2 simple question

- where should i store the client variables, like "score" and how can i acces if every player have his own scores , i was putting in the server, but i think maybe it is in the client.

- i have a datablock , and a function of that datablock, how can i get the client variable , like %this.client ?

#1
05/30/2008 (5:15 pm)
I believe you do.. (probably has typos)
%gid = %serverObj.getGhostId()
%clientObj = ClientConnection.resolveGhostId( %gid );

Depending on what you are trying to accomplish ... you might also use a commandToClient.
#2
05/30/2008 (6:13 pm)
The variables like points and items, should stay in the server, or in the client side ?
#3
05/30/2008 (7:20 pm)
Design your games as if they will be multi-player. Keep your player stats on the server side. If later you decide to reuse your code or make your single player game into a multi-player, then you won't have to change mountains of errors later on.