Decal Datablock not getting transfered in multiplayer.
by Lukas Joergensen · in Torque 3D Professional · 04/07/2012 (6:50 pm) · 4 replies
So i tried to open my game running dedicated server, but for some reason a pretty crucial decal datablock is not getting transfered.
I can read it and access it from the server, if i eg. bind a key to this command:
function serverCmdDecalTest(%client)
{
echo(NewDecalData.Material);
}
It works fine, but if i call it from the client it says the datablock is invalid.
Not sure what is the cause of this.
I read somewhere that the server have to use the datablock or else it wont get transfered, but i got the decal in the mission. So it should be used, and the datablock must be transfered in some way.
Seems like it is the datablock name that doesn't get transfered actually.
datablock DecalData(NewDecalData)
{
Material = "newMaterial";
textureCoordCount = "0";
};
singleton Material(newMaterial)
{
mapTo = "unmapped_mat";
diffuseMap[0] = "art/decals/target.png";
specularPower[0] = "1";
glow[0] = "0";
scrollDir[0] = "-1 -1";
scrollSpeed[0] = "1.412";
rotSpeed[0] = "-0.35";
rotPivotOffset[0] = "-0.5 -0.5";
waveFreq[0] = "4.219";
waveAmp[0] = "0.203";
translucent = "1";
};The decal datablock.I can read it and access it from the server, if i eg. bind a key to this command:
function serverCmdDecalTest(%client)
{
echo(NewDecalData.Material);
}
It works fine, but if i call it from the client it says the datablock is invalid.
Not sure what is the cause of this.
I read somewhere that the server have to use the datablock or else it wont get transfered, but i got the decal in the mission. So it should be used, and the datablock must be transfered in some way.
Seems like it is the datablock name that doesn't get transfered actually.
About the author
IPS Bundle available at: https://www.winterleafentertainment.com/Products/IPS.aspx
#2
Anyway to work with datablocks on the client?
04/08/2012 (1:32 am)
Hmm it is pretty crucial for me to do this on the client side. I create a decal which gets updated 50 times a second. It creates to much traffic to have it on the server side, besides it should only be seen by a single client.Anyway to work with datablocks on the client?
#3
In decalData.cpp i added this:
Now it works perfectly! :)
04/08/2012 (2:01 am)
Oh i fixed this:In decalData.cpp i added this:
this->assignName(this->lookupName);to DecalData::unpackData
Now it works perfectly! :)
#4
Edit:
i can get the decal to draw on client side now but i cant remove it using "decalManagerRemoveDecal(%decalName)" the function runs but doesnt remove it :(
08/23/2012 (9:46 pm)
im having the same problem trying to get the decal to run on the client side but having no luck i get an error message "invalid decal datablock" i cant seem to get the decal to draw on the right client id. Any help would be much appreciated Edit:
i can get the decal to draw on client side now but i cant remove it using "decalManagerRemoveDecal(%decalName)" the function runs but doesnt remove it :(
Torque Owner Dennis Trevillyan
WatreGames