Blockland Forums > Modification Help
How do i make a projectile solid?
<< < (3/4) > >>
Masterlegodude:
How do i do that?
Spaceomega:

--- Quote from: masterlegodude on June 10, 2007, 11:02:22 PM ---How do i do that?

--- End quote ---
Maybe tinker with health-packs from RtB or something?
Masterlegodude:
I doubt that works with projectiles, if it does, then the coding must be different...

...Hmm, i think it is possible, but how much health does the minifig have, 100 like usual or 50, or 200? Or more?

Does this look like it'd work


--- Code: ---function shieldProjectile::onEnter(%this,%obj,%col)
{
   // Apply health to colliding object if it needs it.
   // Works for all shapebase objects.
   if (%col.getDamageLevel() != 0 && %col.getState() !$= "Dead" ) {
      %col.applyRepair(%this.repairAmount);
      %obj.respawn();
      if (%col.client)
         messageClient(%col.client, 'MsgHealthPatchUsed', '\c2Health regaining...');
   }
}
--- End code ---

I put the repair thing into the projectile scripts


--- Code: ---//projectile
datablock ProjectileData(shieldProjectile)
{
   projectileShapeName = "./shapes/shield.dts";

   repairAmount = 400;
   muzzleVelocity      = 50;
   velInheritFactor    = 0;

   armingDelay         = 9999;
   lifetime            = 20000;
   fadeDelay           = 19500;
   bounceElasticity    = 0.1;
   bounceFriction      = 900;
   isBallistic         = true;
   gravityMod = 200.0;

   hasLight    = true;
   lightRadius = 6.0;
   lightColor  = "0 0 0.5";
};
--- End code ---
Badspot:
Things do not collide with projectiles.  If you want it to be solid, you should spawn a static shape when the projectile explodes.
Ladios:
how did you get it to stay still after it hit the gound... im jsut wondering for a landmine thign i was gonna make
Navigation
Message Index
Next page
Previous page

Go to full version