Author Topic: Dash Playertype (for the GunZ feeling)  (Read 1196 times)

I'm looking for a playertype that can dash in 4 directions like in a game called GunZ.
The katana addon probably has this but it will be better if it was a playertype.

GunZ = WarZ = stuff
Loadout is better.

GunZ = WarZ = stuff
Loadout is better.
If you don't intend on helping, please don't post.


Here is the code, package it yourself.
Code: [Select]
datablock PlayerData(PlayerDash: PlayerStandardArmor)
{
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

uiName = "Dash Player";
showEnergyBar = false;
};

datablock ParticleData(dashPuffParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.0;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0.0;
   lifetimeMS           = 200;
   lifetimeVarianceMS   = 50;
   textureName          = "base/data/particles/cloud";
   spinSpeed = 10.0;
   spinRandomMin = -500.0;
   spinRandomMax = 500.0;
   colors[0]     = "0.8 0.8 0.8 0.3";
   colors[1]     = "0.8 0.8 0.8 0.3";
   sizes[0]      = 0.5;
   sizes[1]      = 0.6;

   useInvAlpha = true;
};
datablock ParticleEmitterData(dashPuffEmitter)
{
   ejectionPeriodMS = 7;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "dashPuffParticle";
};

package PlayerDash
{
   function armor::onTrigger(%this,%player,%slot,%val)
   {
      if(%this.getName() $= "PlayerDash" && %slot $= 4)
      {
         if(%val)
         {
            %curVelocity = %player.getVelocity();
            %velX = getWord(%curVelocity, 0);
            %velY = getWord(%curVelocity, 1);
            %velZ = getWord(%curVelocity, 2);
            if(%velX < 8 && %velX > -8 && %velY < 8 && %velY > -8)
            {
               %finalVel = vectorScale(%velX SPC %velY SPC %velZ, 3.2);
               %player.setVelocity(getWords(%finalVel, 0, 1) SPC %velZ + 1);
               %player.playAudio(0, katanaDashSound);
               %node = new ParticleEmitterNode()
               {
                  position = %player.getPosition();
                  dataBlock = GenericEmitterNode;
                  emitter = dashPuffEmitter;
               };
               %node.schedule(100, delete);
            }
            else
               parent::onTrigger(%this, %player, %slot, %val);
         }
         else
            parent::onTrigger(%this, %player, %slot, %val);
      }
      else
         parent::onTrigger(%this, %player, %slot, %val);
   }
};
activatePackage(PlayerDash);

Haven't tested it, I just put the codes together.


Loadout is stuff

I played it for exact 1 hour then deleted it

Nvm was thinking of another game anyway loadout is pretty fun although you need to force yourself to play it.

Thanks it works great.
« Last Edit: July 10, 2014, 05:16:11 PM by DRiOD »

Lol. Ripped code from the katana and forgot the sound to go with it. :c

If the SFkatana is added on server it works, might edit it to work without