Is there a way to edit explosionData to make the explosion only add vertical velocity and not any x or y velocity? It mainly needs to work for when the projectile hits a vehicle.
This is the explosionData
datablock ExplosionData(strongMissileExplosion : gravityRocketExplosion)
{
explosionShape = "add-ons/weapon_rocket_launcher/explosionSphere1.dts";
damageRadius = 8;
radiusDamage = 220;
impulseRadius = 5;
impulseForce = 4000; //This will be removed since it adds x and y velocity
burnTime = 0;
};
If it can't be done in the explosionData, can it be done by editing function strongMissileProjectile::damage (which should be called when the projectile collides with something). I actually had problems getting this function to run- the echoes within it never showed up in console, maybe because I had weapon damage disabled in the minigame (but I still had vehicle damage enabled).
This is the function strongMissileProjectile::damage
function strongMissileProjectile::damage(%this,%obj,%col,%fade,%pos,%normal)
{
echo("MADE IT INSIDE DAMAGE TRIGGER"); //These 6 lines are my attempt at adding z velocity to the vehicle
if(%obj.getType() & $Typemasks::VehicleObjectType)
{
echo("HEY IT WORKED THUS FAR");
%obj.setVelocity(vectorAdd(%obj.getVelocity(),"0 0 35"));
}
if(%this.directDamage <= 0)
return;
%damageType = $DamageType::Direct;
if(%this.DirectDamageType)
%damageType = %this.DirectDamageType;
%scale = getWord(%obj.getScale(), 2);
%directDamage = mClampF(%this.directDamage, -100, 100) * %scale;
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
else
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
}