Game Development Community

Damage Modification

by Owen "WDA" Ashcroft · in General Discussion · 07/15/2002 (8:49 am) · 2 replies

I have been experimenting with my casting time system on Realm Wars crossbow, however, unfortunately it does not work as planned, this is due to the datablock system, you cannot alter a data-block, cast a projectile then alter the data-block back without affecting the already created projectile, this causes some problems, therefore I would require that when a projectile is created an additional variable called modifier, an integer, is passed back into the engine in the same manner as its current position, and is carried through the various phases until it re-emerges into script where the damage can be modified at a point where damage becomes unique to each projectile/explosion.

This modifier could then also be applied to the section that handles each emitter individually as the particle data-blocks suffer from the same problem.

Owen

#1
07/15/2002 (11:07 am)
When you create the object append the appropriate field to the that object instance. For example you want to modify the damage to have a "flame" effect.

%p = new (%this.projectileType)() {
      dataBlock        = %projectile;
      initialVelocity  = %muzzleVelocity;
      initialPosition  = %obj.getMuzzlePoint(%slot);
      sourceObject     = %obj;
      sourceSlot       = %slot;
      client           = %obj.client;
   };
   %p.modifier="flame";
   MissionCleanup.add(%p);
   return %p;

Then in the onCollision you would add:

function Projectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{

  if (%obj.modifier $= "flame")
     {
          echo("Flame Damage Done");
     }
  else {
          echo ("Normal Damage Done");
     }

}

NOTE: I'm at work so I didn't get a chance to do a test run... the basic concept should be fine though.
#2
07/19/2002 (7:30 am)
I figured out how to do it purely in script about 20 minutes after posting this.. oh well :)