Netobject ghosted twice
by Lukas Joergensen · in Torque 3D Professional · 01/14/2013 (1:12 am) · 2 replies
Hello guys!
I'm trying to ghost a NetObject SpellDecalManager:
Is it supposed to create 2 ghosts?
It's causing quite a bit of trouble...
This is how I create the new SpellDecalManager:
This is the constructor:
I implement like this: IMPLEMENT_CO_NETOBJECT_V1(SpellDecalManager);
Any ideas on why this is happenning? Or how I can prevent it
I'm trying to ghost a NetObject SpellDecalManager:
class SpellDecalManager : public NetObject, public ITickable
{
typedef NetObject Parent;
enum MaskBits{
Init = BIT(4),
};However it seems to be ghosted twice, unpackUpdate runs 2 times on two different instances of the SpellDecalManager client object (I checked that it is the client object)Is it supposed to create 2 ghosts?
It's causing quite a bit of trouble...
This is how I create the new SpellDecalManager:
SpellDecalManager* SDM = new SpellDecalManager();
if(!SDM->registerObject())
{
Con::errorf("!SDM->registerObject()");
delete SDM;
callback(caller, Point3F(0), false);
return;
}This is the constructor:
//--------------------------------------------
// Constructor
//--------------------------------------------
SpellDecalManager::SpellDecalManager()
{
mNetFlags.set(Ghostable | ScopeLocal);
setScopeAlways();
mDecalInstance = NULL;
mDecalController = NULL;
caller = NULL;
ServerID = 0;
SpawnWhenPossible = 0;
}I implement like this: IMPLEMENT_CO_NETOBJECT_V1(SpellDecalManager);
Any ideas on why this is happenning? Or how I can prevent it
About the author
IPS Bundle available at: https://www.winterleafentertainment.com/Products/IPS.aspx
#2
Used this:
But that didn't work for me earlier.. Guess the planets are aligned correctly now. Sorry but can't be of any help to others facing the same problem! :)
01/14/2013 (1:28 am)
Nevermind.. Seems to be working now.. No clue what I did to fix it..Used this:
client->objectLocalScopeAlways(SDM);Instead of objectInScope.
But that didn't work for me earlier.. Guess the planets are aligned correctly now. Sorry but can't be of any help to others facing the same problem! :)
Torque Owner Lukas Joergensen
WinterLeaf Entertainment
Instead I wanted to add it to the scope like this:
But then it isn't ghosted at all.