Game Development Community

Ghost from Server Object

by Luigi Rosso · in Torque Game Engine · 01/28/2002 (8:30 am) · 8 replies

I'm able to get the server object from the ghost through a dynamic_cast as follows (in this case for a server projectile from the ghost one)

Projectile *serverProj = dynamic_cast ((NetObject *)this);

How would I go about doing the opposite? Getting the ghost from the server object.

Thanks,

Luigi

#1
01/30/2003 (4:33 am)
This is something I would like to know as well.. does it have anything to do with this:

connection->getGhostIndex(mControlObject);

in the packet functions in the player.cc file? I tried this but i dont think it worked.
#2
01/30/2003 (10:06 am)
You shouldn't be able to get the ghost as it wouldn't exist on the server.
#3
01/30/2003 (10:09 pm)
actually, with a bit of playing around I did get it to work... I dont really know how it works, but it does...
#4
01/31/2003 (12:54 am)
Were you testing this with a dedicated server running on one PC and the client running on another PC?
#5
01/31/2003 (2:11 am)
uhh.. no, but this is how the engine does it so I'm assuming its correct...

Well we will see when i test it..
#6
01/31/2003 (4:38 am)
If you really want to test your game, I suggest that you run a dedicated server, and then start a client that will connect on this dedicated server. You can do it on the same computer, you do not need to have two computers. This is how i debug our game and it solves many problems. If you run at the same time the client/server (with one exec), then it will hide some possible bug as the client is aware of some 'variables' that should be available on the server.
#7
01/31/2003 (4:40 am)
cool.. will do ;) thanks for the early tip off... that could have been messy.
#8
01/31/2003 (7:16 am)
ok.. I tried it over the internet and it worked perfectly. So it seems that function is the right way after all.