Author Topic: Super Smash Brothers type damage system  (Read 3534 times)

The more you're damaged, the farther you fly back when you're damaged

would be nice for maybe sword dms or something

The question is: Is it possible?

I actually think it is. Something to do with addVelocity, right? I don't know, I'm no coder.

The question is: Is it possible?

I actually think it is. Something to do with addVelocity, right? I don't know, I'm no coder.

More than extremely possible.




rap battle initiate
Someone who knows what he's talking about vs someone who has no clue what he's talking about.
There is no battle here

$MaxSSBVelocityScale = 9;

package SSBDamagePackage {
   function ShapeBase::addVelocity(%this, %velocity) {
      if (%this.usesSSBDamage()) {
         %velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
      }

      Parent::addVelocity(%this, %velocity);
   }

   function ShapeBase::applyImpulse(%this, %origin, %velocity) {
      if (%this.usesSSBDamage()) {
         %velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
      }

      Parent::applyImpulse(%this, %origin, %velocity);
   }

   function ShapeBase::setDamageFlash(%this, %scalar) {
      if (!%this.usesSSBDamage()) {
         Parent::setDamageFlash(%this, %scalar);
      }
   }
};

activatePackage("SSBDamagePackage");

function ShapeBase::usesSSBDamage(%this) {
   return 1;
}

function ShapeBase::getSSBVelocityScale(%this) {
   return 1 + (%this.getDamageLevel() / %this.getDataBlock().maxDamage) * $MaxSSBVelocityScale;
}
« Last Edit: September 15, 2013, 12:22:57 PM by Port »

$MaxSSBVelocityScale = 9;

package SSBDamagePackage {
   function ShapeBase::addVelocity(%this, %velocity) {
      if (%this.usesSSBDamage()) {
         %velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
      }

      Parent::addVelocity(%this, %velocity);
   }

   function ShapeBase::applyImpulse(%this, %origin, %velocity) {
      if (%this.usesSSBDamage()) {
         %velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
      }

      Parent::applyImpulse(%this, %origin, %velocity);
   }

   function ShapeBase::setDamageFlash(%this, %scalar) {
      if (!%this.usesSSBDamage()) {
         Parent::setDamageFlash(%this, %scalar);
      }
   }
};

activatePackage("SSBDamagePackage");

function ShapeBase::usesSSBDamage(%this) {
   return 1;
}

function ShapeBase::getSSBVelocityScale(%this) {
   return 1 + (%this.getDamageLevel() / %this.getDataBlock().maxDamage) * $MaxSSBVelocityScale;
}

There is no battle here

I think it would nice if you rewrote the damage system; like made it so you can't die from taking damage, you have to be knocked off the map into a kill event or something


Gotta love how Port makes unpackaged codes and gives them to people who have no idea what they mean or how to use them.

I suppose its proof of concept even though I have no idea what its telling me, however now we'd need somebody else with a knowledge of coding to come in and package it..

Gotta love how Port makes unpackaged codes and gives them to people who have no idea what they mean or how to use them.
I tried messing with it to no avail

Gotta love how Port makes unpackaged codes and gives them to people who have no idea what they mean or how to use them.

I suppose its proof of concept even though I have no idea what its telling me, however now we'd need somebody else with a knowledge of coding to come in and package it..
Ninjaedit: Whoops. You meant the other kind of packaging.
Well, here's how to package it:
Make a ZIP file and call it something like Script_SSB_Damage.zip
Copy the code port made and save it as server.cs and put it in the zip
make a description.txt, write
Code: [Select]
Name: SSB damage
Author: Port
Does stuff!
and put it in the zip.
Plop the newly packaged add-on into the add-ons folder and viola.

Seriously. It's not that hard.
« Last Edit: September 15, 2013, 03:57:18 PM by Crystalwarrior »


Should probably also prevent death from non-fall/splat damage.