I am wanting give my projectiles some different partical emmitters!
I am wanting give my projectiles some different partical emmitters, depending on if they hit terrain or an Interior,
The function below is buggy, does not work all the time..
Doing a terrain search was always easy for deployables, but on projectile collision, its a bit strange.
If there are any coding gods still here, any help would be apreciated.
The function below is buggy, does not work all the time..
Doing a terrain search was always easy for deployables, but on projectile collision, its a bit strange.
If there are any coding gods still here, any help would be apreciated.
function DiscProjectile::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
{
echo("\n--------- ( DiscProjectile::onCollision ) ---------");
%masks = $TypeMasks::TerrainObjectType;
%detectRange = 5;
InitContainerRadiusSearch(%position, %detectRange, %masks);
while((%targetObject = containerSearchNext()) != 0)
if(%targetObject){
echo("\n--------- ( dirt effect ) ---------");
%dirtEffect1 = new ParticleEmissionDummy(){
position = %position;
dataBlock = "defaultEmissionDummy";
emitter = "RocketDirtBurstEmitter";
};
MissionCleanup.add(%dirtEffect1);
%dirtEffect1.schedule(1000, delete);
%dirtEffect2 = new ParticleEmissionDummy(){
position = %position;
dataBlock = "defaultEmissionDummy";
emitter = "RocketDirtSparksEmitter";
};
MissionCleanup.add(%dirtEffect2);
%dirtEffect2.schedule(1000, delete);
}
else
{
echo("\n--------- ( no dirt effect ) ---------");
}
if(isObject(%targetObject)) // z0dd - ZOD, 4/24/02. Console spam fix.
{
%targetObject.damage(%projectile.sourceObject, %position, %data.directDamage * %modifier, %data.directDamageType);
}
}
Comments
Instead of going through a search for the hit object just to see if it is terrain, you could check the type of the %targetObject already passed to your function against the terrain mask with a simple bitwise AND operation.
Still need to make the cement one nicer...
Snow
Dirt
Cement
http://www.tribalcombat.com/misc/logo_320x185.jpg
Heat, did you mean the logo, or the content above?
EDIT: I guess that's what you was askin'. :P
I made a big mod for it, that's based in part on Meltdown2..
More screenshots...
http://tribalcombat.com/viewtopic.php?f=14&t=8&sid=3ec0e7dcfd0983d0a26fa83dc55659c4
Legions Overdrive, download
http://www.legionsoverdrive.com/download/
The devs are still working on the game at-least...
VGCA