IDs on server and client and how to map them?
by Igor G · in Torque Game Engine · 05/08/2007 (7:21 am) · 4 replies
Hello,
I want to highlight certain objects in the world, but I don't want all clients to see my highlighted objects. For example - my server will tell client A and B to highlight object Z. But I don't want clients C and D to see object Z as highlighted. So this highlight attribute is dynamic and different for each client. Therefore, I can't pack it in the updates.
So, this is a question about how I can map the object IDs on the server to a client. I want to be able to do a commandToClient('SetHighlight', %object), and somehow each client will know this server %object maps to ID ##### locally.
Can this be done, and how can I do this?
Thanks!
I want to highlight certain objects in the world, but I don't want all clients to see my highlighted objects. For example - my server will tell client A and B to highlight object Z. But I don't want clients C and D to see object Z as highlighted. So this highlight attribute is dynamic and different for each client. Therefore, I can't pack it in the updates.
So, this is a question about how I can map the object IDs on the server to a client. I want to be able to do a commandToClient('SetHighlight', %object), and somehow each client will know this server %object maps to ID ##### locally.
Can this be done, and how can I do this?
Thanks!
#2
05/08/2007 (8:37 am)
Is there a simpler way of doing this without using a GameConnection? If I do this, then I'd have to add a list of objects that are highlighted per GameConnection, and it seems like extra overhead.
#3
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4852
05/08/2007 (8:57 am)
Check out this resource:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4852
#4
05/08/2007 (9:11 am)
Peter - thanks a lot! that solved my problem. Great resource.
Torque 3D Owner Peter Simard
Default Studio Name
Example:
stream->writeFlag(GameConnection->isObjectHighlighted(this));