Projectile sound crashes clients and decals not show. on clients
by Eric Lafrance · in Torque Game Engine · 01/20/2004 (3:12 am) · 4 replies
When I put a sound in ProjectileData, I get some bugs.
1- The sound stops and restarts "jerks" when the projectile explodes
2- The clients don't hear the sound
3- The clients crash...
I've been able to trace problems #1 and 2, but unable for the #3 :-(
for #1, in projectile.cc, in the function void Projectile::updateSound()
for #2, in projectile.cc, in the function bool ProjectileData::onAdd()
now, for problem #3, I can't find what makes the client crash. Anyone else has tried the projectile sound?!?
This is with the head.
Thanks
1- The sound stops and restarts "jerks" when the projectile explodes
2- The clients don't hear the sound
3- The clients crash...
I've been able to trace problems #1 and 2, but unable for the #3 :-(
for #1, in projectile.cc, in the function void Projectile::updateSound()
...
if (mHidden && mSoundHandle != NULL_AUDIOHANDLE)
{
alxStop(mSoundHandle);
mSoundHandle = NULL_AUDIOHANDLE;
}
else if (!mHidden) //<------- there was just an else
...for #2, in projectile.cc, in the function bool ProjectileData::onAdd()
...
if (!sound && soundId != 0) //<--- was missing the ! (was if (sound && soundId != 0))
if (Sim::findObject(soundId, sound) == false)
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockid(sound): %d", soundId);
...now, for problem #3, I can't find what makes the client crash. Anyone else has tried the projectile sound?!?
This is with the head.
Thanks
#2
01/22/2004 (9:48 am)
If you mail me this thread, I'll see about getting it into HEAD. (My mail client is my todo list. :)
#3
Just a reminder... :)
04/20/2004 (11:59 am)
The "if(!decals[i] && decalId[i] != 0)" and "if(mDataBlock->decalCount)" fixes do not seems to be applied to HEAD yet, but the others do.Just a reminder... :)
Torque Owner Eric Lafrance
in game\projectile.cc, go to function bool ProjectileData::onAdd(), lign 172
This will allow clients to hear the projectiles sound
You have:
Change it to:
Now go to function bool ProjectileData::preload(bool server, char errorBuffer[256]), lign 214
This will make the decals work for the clients and also prevent them from crashing if a projectile sound is used
You have:
Change it to:
Now go to function void Projectile::updateSound(), lign 709
This will prevent the projectile sound from "jerking" when the projectile explodes
You have:
Change it to:
Also, go to function void Projectile::onCollision(const Point3F& hitPosition... lign 896
This will prevent to call addDecal in case we're not using any decal for that projectile (prevents an engine crash)
You have:
Change it to:
I think the changes above should be updated into the head.