Particle explosion do not work at client-side !!
by BLACKHOUND · in Torque Game Engine · 10/16/2002 (11:17 am) · 48 replies
hello i need some help
my explosion show only at server-side, why ??
----------------
Code :
function SmokeIt()
{
...
%p = new explosion() {
dataBlock = "SpellExplosion";
position = "526.874 86.8943 145.435"; //%finalPos;
};
MissionCleanup.add(%p);
return %p;
}
-----------------
what is the problem ?
thx
Derek
my explosion show only at server-side, why ??
----------------
Code :
function SmokeIt()
{
...
%p = new explosion() {
dataBlock = "SpellExplosion";
position = "526.874 86.8943 145.435"; //%finalPos;
};
MissionCleanup.add(%p);
return %p;
}
-----------------
what is the problem ?
thx
Derek
About the author
#2
10/16/2002 (11:46 am)
Try making it client-side.
#3
10/17/2002 (7:52 am)
when the client connect to server, the game crash because the particle datablock is on client side
#4
ex : projectile
10/17/2002 (7:55 am)
what max ?? i want only my explosion show on all client connected to my server, when my server start the explosion.ex : projectile
#5
The client gets the datablocks from the server.
10/17/2002 (6:21 pm)
Well that particle datablock thing shouldn't ever happen unless you did something completely bizzare.The client gets the datablocks from the server.
#6
Really the only thing left to do is sending the explosion information through the networking code via the packUpdate and unpackUpdate methods provided through the networking model.
10/22/2002 (10:40 pm)
This is a known issue. Originally spawning an explosion via the scripts would cause the server/client to crash (not sure exactly which since I only have one machine). I submitted a patch to stop the crash from occuring awhile ago but unfortunately I never got around to fully patching the explosion class so that you can call explosions via through script methods.Really the only thing left to do is sending the explosion information through the networking code via the packUpdate and unpackUpdate methods provided through the networking model.
#7
I know this thread is dead and gone .
But can you spawn a explosion client side this way ?
or is there any other ways, except the projectile way ?
06/07/2004 (5:37 pm)
Hi all I know this thread is dead and gone .
But can you spawn a explosion client side this way ?
or is there any other ways, except the projectile way ?
#8
When you mean spawn an explosion client side, why would you want to do this? It would only show up for that one client.
Do you mean spawn an explosion server side in any way BUT through projectiles? It should be possible, in fact using that "new Explosion" method shown by the OP.
However, due to some changes in the HEAD, the explosions will not spawn correctly. The particles will spawn, but subexplosions and debris will not show up. (At least, as of the HEAD from about a month ago. Haven't tried the absolute latest one.)
06/07/2004 (6:05 pm)
And the thread moaned, "Bwaains! Bwaaaaaaaains!"When you mean spawn an explosion client side, why would you want to do this? It would only show up for that one client.
Do you mean spawn an explosion server side in any way BUT through projectiles? It should be possible, in fact using that "new Explosion" method shown by the OP.
However, due to some changes in the HEAD, the explosions will not spawn correctly. The particles will spawn, but subexplosions and debris will not show up. (At least, as of the HEAD from about a month ago. Haven't tried the absolute latest one.)
#9
06/08/2004 (2:40 am)
I mean show on clients David ,my english is bad so hard to explain sometimes in right words.
#10
06/11/2004 (4:18 pm)
Just to let you guys know, Robert has been working on this stuff again in the office. Hopefully there will be an update soon.
#11
- Ryan
11/15/2004 (7:00 am)
Has anyone found a solution to this problem? I am having the same issue where the explosion occurs on server side (twice actually) but not client-side. Anyone have any insight as to how I might fix this? Thanks.- Ryan
#12
11/15/2004 (10:44 am)
It should be fixed in latest HEAD...
#13
As you can see, I've tried several different methods and none of them appear on the client, only the server. And in fact, the effect appears twice on the server. I'm assuming that is because the server counts as a client as well so it is executing twice. The interesting thing is, I believe I am getting the sound defined in the ExplosionData block on both the client and server (although this could be the same problem as the particle effect executing twice) so why can't I see the particle effect on both?
Can anyone see anything offhand that I'm doing wrong?
- Ryan
11/15/2004 (11:23 am)
Thanks Ben. I have the latest HEAD and it is still a problem. Here is what I'm doing to call it.// ------------------------------------------------------------------------
// player.cs
// ------------------------------------------------------------------------
function Fighter::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
...
%flashPos = %sourceObject.getMountPos(0); // gets the position of the mount to spawn the particle effect there
//for( %client=0; %client<ClientGroup.getCount(); %client++ )
//{
//messageClient( %client, 'MsgImpactFlash', "MsgImpactFlash", %client, %pos );
messageAll( 'MsgImpactFlash', "MsgImpactFlash", %obj.client.connectionNumber, %flashPos );
//}
//handleImpactFlash( %flashPos );
...
}
//--------------------------------------------------------
// impactflash.cs
//--------------------------------------------------------
datablock ParticleData(ImpactFlashParticle) {
dragCoefficient = "0";
windCoefficient = "0";
gravityCoefficient = "0";
inheritedVelFactor = "0";
constantAcceleration = "5";
lifetimeMS = "100";
lifetimeVarianceMS = "0";
spinSpeed = "0";
spinRandomMin = "0";
spinRandomMax = "0.5";
useInvAlpha = "0";
animateTexture = "0";
framesPerSec = "1";
textureName = "~/data/shapes/particles/flash";
animTexName[0] = "~/data/shapes/particles/flash";
colors[0] = "1.000000 1.000000 0.000000 1.000000";
colors[1] = "1.000000 1.000000 1.000000 1.000000";
colors[2] = "1.000000 1.000000 0.000000 1.000000";
colors[3] = "1.000000 1.000000 1.000000 1.000000";
sizes[0] = "0.15";
sizes[1] = "0.11";
sizes[2] = "0.07";
sizes[3] = "0.02";
times[0] = "0";
times[1] = "0.33";
times[2] = "0.66";
times[3] = "1";
};
datablock ParticleEmitterData(ImpactFlashEmitter) {
className = "ParticleEmitterData";
ejectionPeriodMS = "1";
periodVarianceMS = "0";
ejectionVelocity = "1";
velocityVariance = "0";
ejectionOffset = "0";
thetaMin = "0";
thetaMax = "180";
phiReferenceVel = "0";
phiVariance = "360";
overrideAdvance = "0";
orientParticles = "0";
orientOnVelocity = "1";
particles = "ImpactFlashParticle";
lifetimeMS = "10";
lifetimeVarianceMS = "9";
useEmitterSizes = "0";
useEmitterColors = "0";
lifetimeVariance = "0";
overrideAdvances = "0";
};
datablock ExplosionData(ImpactFlashExplosion)
{
soundProfile = ImpactFlashExplosionSound;
lifeTimeMS = 150;
emitter[0] = ImpactFlashEmitter;
shakeCamera = false;
lightStartRadius = 3;
lightEndRadius = 3;
lightStartColor = "1.0 1.0 0.0 0.25";
lightEndColor = "1.0 1.0 1.0 0.25";
};
addMessageCallback( 'MsgImpactFlash', handleImpactFlash );
function handleImpactFlash( %msgType, %msgString, %client, %pos )
{
echo( "ImpactFlash" );
%flash = new Explosion() {
dataBlock = "ImpactFlashExplosion";
position = %pos;
client = %client;
};
%flash.schedule( 500, "delete" );
}As you can see, I've tried several different methods and none of them appear on the client, only the server. And in fact, the effect appears twice on the server. I'm assuming that is because the server counts as a client as well so it is executing twice. The interesting thing is, I believe I am getting the sound defined in the ExplosionData block on both the client and server (although this could be the same problem as the particle effect executing twice) so why can't I see the particle effect on both?
Can anyone see anything offhand that I'm doing wrong?
- Ryan
#14
I can confirm this is still an issue. I can't use code that uses "new Explosion()" to create an explosion at all.
04/13/2005 (5:46 pm)
Hi,I can confirm this is still an issue. I can't use code that uses "new Explosion()" to create an explosion at all.
#15
04/13/2005 (5:52 pm)
Yup, still there.
#17
10/02/2005 (11:07 pm)
Explosions seem to be working fine in latest 1.4. Insofar as, I can run around the starter fps demo and shoot things with no problems.
#18
10/03/2005 (7:18 am)
Playing as a client over a dedicated server Ben?
#19
This thread is about script-spawned explosions, not the code-spawned ones that happen on the client - those work perfectly.. and are the ones you see when a crossbow bolt hits an object.
10/03/2005 (7:49 am)
Yeah, that's the first thing I thought too.Quote:
Explosions seem to be working fine in latest 1.4. Insofar as, I can run around the starter fps demo and shoot things with no problems.
This thread is about script-spawned explosions, not the code-spawned ones that happen on the client - those work perfectly.. and are the ones you see when a crossbow bolt hits an object.
#20
10/11/2005 (9:16 pm)
Can anyone confirm that 1.4 fixes explosions? My current build I am spawning blood particles and they are not showing up on the clients.
Torque Owner Max Robinson
Just in case you want to know, the projectile method for spawning one is:
if (mDataBlock->explosion) { pExplosion = new Explosion; pExplosion->onNewDataBlock(mDataBlock->explosion); } if( pExplosion ) { MatrixF xform(true); xform.setPosition(p); pExplosion->setTransform(xform); pExplosion->setInitialState(p, n); pExplosion->setCollideType( collideType ); if (pExplosion->registerObject() == false) { Con::errorf(ConsoleLogEntry::General, "Projectile(%s)::explode: couldn't register explosion", mDataBlock->getName() ); delete pExplosion; pExplosion = NULL; } }