I'm editing Kalphiters Infinite Mining mod, and I want to add dynamite. Everything works- the weapon, the model, the function to destroy the bricks when the explosion hits them, but theres one issue. The function that should be called to destroy the brick (because they player will not earn or for using dynamite) is not called. Heres what I'm using:
function DynamiteExplosionP::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
Dig_explodeBrick(%obj, %col, %pos);
echo("Dynamite hit brick!"); //Testing Purposes - Will Be Removed
}
ExplodeBrick doesn't need to be added, I tested it, and it does what it should. The datablocks around it like:
function gunProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
if(%obj.client.isAdmin)
Dig_mineBrick(%obj, %col, %pos);
}
Are not packaged, so I'm sure this doesn't need to be. The Dynamite weapon is a modifed version of the C4 Item (This edit is for private use, so don't start bitching on credit) and this is what the projectile lookes like:
datablock ProjectileData(DynamiteExplosionP : rocketlauncherProjectile)
{
directDamage = 70;
brickexplosionradius = 10;
brickexplosionMaxVolume = 150;
brickexplosionforce = 20;
radiusDamageType = $DamageType::DynamiteRadius;
radiusDamageType = $DamageType::DynamiteRadius;
lifetime = 1;
explosion = gravityRocketExplosion;
explodeonDeath = true;
uiName = "Dynamite Explosion";
};
Thanks alot, good night
