Geting a list of all the other clients from a given client?
by Joy Box · in Torque Game Engine · 11/13/2005 (12:29 pm) · 3 replies
Ok, i'm building a guicontrol which shows the map of a racing road with the points on it that represents the player car with other players cars.
i.e like a radar.
so i need a list of the other clients who have joined the game.
i've tried the the function Sim::getClientGroup() but it seems to work only on the hoster of the game, so the hoster sees other players cars on his map, but the other clients have their map empty.
help!????????
i.e like a radar.
so i need a list of the other clients who have joined the game.
i've tried the the function Sim::getClientGroup() but it seems to work only on the hoster of the game, so the hoster sees other players cars on his map, but the other clients have their map empty.
help!????????
#2
What you 'could' do is that for each client request positions from the server every second or so and the server replies and you would off that. This is a very simple approach and not the 'best' but it should work for what your talking about.
11/13/2005 (12:49 pm)
You have to realize (you might already know but I didn't know how else to start this reply :D) is that the 'hoster' runs both the server and client on it together. only the server knows there the players car are, and when you run the 'hoster' you can get the positions because the client and server are like one (very general but I hope it gives a clear understanding).What you 'could' do is that for each client request positions from the server every second or so and the server replies and you would off that. This is a very simple approach and not the 'best' but it should work for what your talking about.
#3
11/18/2005 (10:46 am)
You could also have all client cars marked as ScopeAlways on creation, and then on the client keep a separate SimSet that keeps track of all other clients. That would allow you to iterate over those objects whenever necessary and grab their current positions.
Torque Owner Chris Byars
Ion Productions