Game Development Community

Network Transfer of a sceneObject ID

by Ronald J Nelson · in Torque Game Engine Advanced · 04/14/2009 (12:33 am) · 3 replies

I need to know how to transfer a SceneObject through packs and unPacks so that the client will beable to call functions as in transform information.

Here is how it needs to work, I raycast an object and make SceneObject * sObject = rInfo.object. Ok I want to be able to pass sObject through the network so a function can be run both client and server side based upon sObject.

I thought I knew how, but I have been getting alot of broken streams or NULL values for sObject on the client-side.

I imaginge I must be doing it wrong therefore I am hoping someone can tell me where to see a working method or can provide me with one.

#1
04/14/2009 (1:05 am)
Hi Ron - on the server side you'll have to get the ghost index of the sceneobject id, then send the ghost index through the network then client side when it arrives translate the ghost id into the client side sceneobject id.

From memory these are done with getGhostID() and resolveGhostId() but I haven't got the engine source with me right now, have a hunt in the engine if you get stuck I'll have a look later for you
#2
04/15/2009 (8:49 am)
Thanks Andy I was doing that but not using the network connection to do it and that was the problem. I was using something like getNetIndex or something at it really does not work.
#3
04/15/2009 (9:17 am)
Glad to see you've got it working :)