| Blockland Forums > Modification Help |
| Making projectiles do no damage to bots. |
| << < (3/4) > >> |
| Deadzone:
--- Quote from: Amade on February 02, 2011, 02:53:59 PM ---Be aware, however, that this apply to all bots, including tank turrets, cannons, and horses. --- End quote --- Again I must be placing it wrong, it still deals damage to bots. "function YOURPROJECTILE::damage" "function FireMProjectile::damage" |
| Nexus:
Amade, why are you having the function return the parent? I thought that normally you would just end with the parent::damage. |
| Amade:
--- Quote from: Nexus on February 02, 2011, 08:44:29 PM ---Amade, why are you having the function return the parent? I thought that normally you would just end with the parent::damage. --- End quote --- Some edits to functions will break things if you simply call the parent, returning the parent is "safer". --- Quote from: Deadzone on February 02, 2011, 03:08:41 PM ---Again I must be placing it wrong, it still deals damage to bots. "function YOURPROJECTILE::damage" "function FireMProjectile::damage" --- End quote --- Post the rest of your script |
| Deadzone:
AddDamageType("FireM", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Fire> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Fire> %1', 0.25, 0); datablock ProjectileData(FireMProjectile) { shapeFile = "base/data/shapes/empty.dts"; directDamage = 0.13; radiusDamageType = $DamageType::FireM; brickExplosionRadius = 0; brickExplosionImpact = true; brickExplosionForce = 0; brickExplosionMaxVolume = 0; brickExplosionMaxVolumeFloati ng = 0; impactImpulse = 0; verticalImpulse = 0; explosion = FireMExplosion; particleEmitter = FireAmbientEmitter; sound = FireLoopSound; muzzleVelocity = 75; velInheritFactor = 1; armingDelay = 0; lifetime = 1000; fadeDelay = 1000; bounceElasticity = 0.5; bounceFriction = 0.20; isBallistic = true; gravityMod = 0.0; hasLight = true; lightRadius = 5; lightColor = "1 0.5 0"; uiName = "Fireball"; }; function FireMProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal) { if(%col.getClassName() $= "TSStatic") { if(%col.shapeName $= "Add-Ons/Weapon_ElementalSpells/OtherShapes/IceBlock.dts") { if(isObject(%col.player)) { %col.player.thaw(); } %col.delete(); } } parent::onCollision(%this, %obj, %col, %fade, %pos, %normal); } function FireMProjectile::damage(%this, %obj, %col, %fade, %pos, %normal) { if(%obj.getClassName() $= "AIplayer") { return; } return parent::damage(%this, %obj, %col, %fade, %pos, %normal); } function FireMProjectile::RadiusDamage(%this, %obj, %col, %distance, %pos, %amt) { if(!isObject(%col)) { return; } %col.damage(%obj, %pos, 15 * getWord(%col.getScale(), 2), $DamageType::FireM); if(%col.getType() & $Typemasks::PlayerObjectType && %col.getMountedImage(0) != WaterMImage.getID()) { %col.burnCount = 0; if(isObject(%source = %obj.sourceObject)) { %col.lastBurner = %source; } else { %col.lastBurner = %obj; } for(%i = 2; %i < 7; %i++) { %img = %col.getMountedImage(%i); if(%img == FireBurnPlayerImage.getID()) { return; } if(%img < 1) { %col.mountImage(FireBurnPlayerImage, %i); return; } } } } You want the whole thing? |
| Red_Guy:
mabye try a different function? function FireMProjectile::onCollision(%this, %obj, %brick, %fade, %pos, %normal) { if(%obj.getClassName() $= "AIplayer") { return 0; } return parent::onCollision(%this, %obj, %brick, %fade, %pos, %normal); } Also - dont forget to trace() and echo() when your debugging. |
| Navigation |
| Message Index |
| Next page |
| Previous page |