Game Development Community

TSStatic, datablocks and networking!

by Alessandro · in General Discussion · 08/31/2011 (2:34 pm) · 1 replies

Hello,

I wanted to use datablocks since they are the best way to send info from server to client about the meshes.
But the problem is I need to create some objects at runtime. Those objects are static, so I use the code:

%obj = new TSStatic() {
internalName = "myCube" @ %x;
shapeName = "art/shapes/station/station01.dts";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
collisionType = "Visible Mesh";
decalType = "Visible Mesh";
allowPlayerStep = "1";
renderNormals = "0";
forceDetail = "-1";
position = %myPos;
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "0";
canSaveDynamicFields = "0";
};

Since the objects are created at runtime, I need to create an unique name also.
But... is there any way to send only once those data from server to client, and then send only info about objects creation regarding internal name, coordinates, etc..? Is it a good way to send other info using a datablock to send common data only once?

Thank you for your help!

#1
09/01/2011 (8:33 pm)
You've discovered why datablocks are great ;). Unfortunately, the TSStatic class doesn't use them. Which means, yes, the 'static' data such as collisionType will be sent uniquely for each one you create.

The StaticShape class uses a datablock, and is a static shape - see if it fits your needs!