The Horny Rat
2004-02-10, 05:32 AM
I am trying use this function Lt Earthworm, made for tribes2, its awasome for making better FX trails or effects...
The problem I have on Legends is this...
projectile :onAdd: mSourceObjectId is invalid
I need help just with that err I think....
look at the onfire you will see this line that calls the trail function...
// FX //////////////////////////////////////////////////////////////////////////
CreateMitziTrail(%p, %obj.getMuzzleVector(%slot), "MitziTrailProj", 150);
////////////////////////////////////////////////////////////////////////////////
datablock LinearProjectileData(MitziTrailProj)
{
projectileShapeName = "~/data/shapes/wep_plasma/projectile_spingrow_00.dts";
scale = "6.5 1.0 6.5";
//sound = GrenadeLauncherProjectileSound;
explosion = MitziTrailExp;
directDamage = 0.00001;
radiusDamage = 0.00001; //little stronger than disk, which is 1.5 atm
damageRadius = 15.0; //should be a little smaller than disk, which is 15 atm
damageType = $DamageType::Mitzi;
impulse = 1500;//don't bounce people back with this
muzzleVelocity = 15;
velInheritFactor = 0.3;
lifetime = 250;
fadeDelay = 250;
hasLight = true;
lightRadius = 6.0;
lightColor = "0.0 0.4 0.2";
};
function CreateMitziTrail(%obj, %Vect, %Projectile, %emitTime)
{
if(isObject(%obj))
{
%p = new LinearProjectile()
{
dataBlock = %projectile;
initialPosition = %obj.getPosition();
initialDirection = %obj.initialDirection;
sourceObject = %obj.sourceObject;
sourceSlot = 0;
client = %obj.client;
};
MissionCleanup.add(%p);
if(%emitTime > 0)
{
schedule(%emitTime,0, "CreateMitziTrail", %obj, %Vect, %Projectile, %emitTime);
}
}
}
// -----------------------------------------------------------------------------
function MBCannonFire( %data, %obj, %slot )
{
// -- required for projectiles which inherit velocity from their parent
%muzzleVelocity = VectorAdd(
VectorScale(%obj.getMuzzleVector(%slot), %data.projectile.muzzleVelocity),
VectorScale(%obj.getVelocity(), %data.projectile.velInheritFactor));
if(%obj.client.MitziMode == 3)
{
// -- Create the projectile object
%p = new (%data.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
// FX //////////////////////////////////////////////////////////////////////////
CreateMitziTrail(%p, %obj.getMuzzleVector(%slot), "MitziTrailProj", 150);
////////////////////////////////////////////////////////////////////////////////
%obj.applyKick(-100);
}
The problem I have on Legends is this...
projectile :onAdd: mSourceObjectId is invalid
I need help just with that err I think....
look at the onfire you will see this line that calls the trail function...
// FX //////////////////////////////////////////////////////////////////////////
CreateMitziTrail(%p, %obj.getMuzzleVector(%slot), "MitziTrailProj", 150);
////////////////////////////////////////////////////////////////////////////////
datablock LinearProjectileData(MitziTrailProj)
{
projectileShapeName = "~/data/shapes/wep_plasma/projectile_spingrow_00.dts";
scale = "6.5 1.0 6.5";
//sound = GrenadeLauncherProjectileSound;
explosion = MitziTrailExp;
directDamage = 0.00001;
radiusDamage = 0.00001; //little stronger than disk, which is 1.5 atm
damageRadius = 15.0; //should be a little smaller than disk, which is 15 atm
damageType = $DamageType::Mitzi;
impulse = 1500;//don't bounce people back with this
muzzleVelocity = 15;
velInheritFactor = 0.3;
lifetime = 250;
fadeDelay = 250;
hasLight = true;
lightRadius = 6.0;
lightColor = "0.0 0.4 0.2";
};
function CreateMitziTrail(%obj, %Vect, %Projectile, %emitTime)
{
if(isObject(%obj))
{
%p = new LinearProjectile()
{
dataBlock = %projectile;
initialPosition = %obj.getPosition();
initialDirection = %obj.initialDirection;
sourceObject = %obj.sourceObject;
sourceSlot = 0;
client = %obj.client;
};
MissionCleanup.add(%p);
if(%emitTime > 0)
{
schedule(%emitTime,0, "CreateMitziTrail", %obj, %Vect, %Projectile, %emitTime);
}
}
}
// -----------------------------------------------------------------------------
function MBCannonFire( %data, %obj, %slot )
{
// -- required for projectiles which inherit velocity from their parent
%muzzleVelocity = VectorAdd(
VectorScale(%obj.getMuzzleVector(%slot), %data.projectile.muzzleVelocity),
VectorScale(%obj.getVelocity(), %data.projectile.velInheritFactor));
if(%obj.client.MitziMode == 3)
{
// -- Create the projectile object
%p = new (%data.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
// FX //////////////////////////////////////////////////////////////////////////
CreateMitziTrail(%p, %obj.getMuzzleVector(%slot), "MitziTrailProj", 150);
////////////////////////////////////////////////////////////////////////////////
%obj.applyKick(-100);
}