Author Topic: Explosion on Smash and Sprint.  (Read 745 times)

Is this possible?:

Explosion on Smash:
If a player hits a floor at a high velocity, an explosion spawns?
If so, how would it be put in script?

Sprint:
When holding down a binded key, player's speed increases by x amount?

Smash:
Running into something at a speed over x would hurt/kill it depending on speed?

Thanks in advance, Yogurt Man.
« Last Edit: December 20, 2009, 08:35:27 PM by Yogurt Man »

Explosion on Smash: I don't think so, unless there's some kind of field you can set.
Sprint: No.
Smash: Edit the minImpactSpeed on a player datablock.

Needs moar V15: Modders update.

I think ill change the sprint.

I thought you mean an explosion spawning when a sprint phone hits the floor.

I thought you mean an explosion spawning when a sprint phone hits the floor.
Erm, what?
I mean if your falling at x BPS an explosion spawns. This gives the illusion that somthing heavy hit the floor causing a deadly shockwave. (Prototype, anyone?)
« Last Edit: December 21, 2009, 09:34:47 AM by Yogurt Man »

1.
Code: [Select]
package what
{
        function Armor::onImpact(%this,%obj,%col,%pos,%speed)
        {
                new Projectile()
                {
                        dataBlock = what;
                        initialPosition = %pos;
                        initialVelocity = "0 0 1";
                        sourceObject = "";
                        client = "";
                        sourceSlot = 0;
                        originPoint = %pos;
                };
                Parent::onImpact(%this,%obj,%col,%pos,%speed);
        }
};
activatePackage(what);

2. Possibly, if some sort of hack was involved, where you add velocity while the key is down and checks if the player is walking some how.

3. Mentioned by Amade.


Thanks Destiny!

Is there a way to add an explosion to that script?
« Last Edit: December 21, 2009, 01:49:04 PM by Yogurt Man »

Code: [Select]
initialVelocity = "0 0 1";
That should be vectorScale(impactNormal, -1) instead in-case the projectile has some lifetime and you want it to collide with something immediately but the normal to the impact is not "0 0 -1" (colliding straight up with something)

Sprint (extremely roughly):

package {
   armor::onTrigger {
      if(val)
         player.accelerateSched = player.schedule(sprint)
      else
         cancel(player.accelerateSched)
      parent::onTrigger()
   }
}
player::sprint {
   player.addVelocity(player.getEyeVector())
   player.accelerateSched = player.schedule(sprint)
}

ninja-edit: Oops, sorry for double post.

Sprint (extremely roughly):

package {
   armor::onTrigger {
      if(val)
         player.accelerateSched = player.schedule(sprint)
      else
         cancel(player.accelerateSched)
      parent::onTrigger()
   }
}
player::sprint {
   player.addVelocity(player.getEyeVector())
   player.accelerateSched = player.schedule(sprint)
}

ninja-edit: Oops, sorry for double post.

Thanks, but would it be possible to bind this to a key instead of right mouse button?

Explosion on Smash: I don't think so, unless there's some kind of field you can set.
Sprint: No.
Smash: Edit the minImpactSpeed on a player datablock.
Hahahaha no.

All three are possible in their own ways.

Practicality is another discussion though.

Thanks, but would it be possible to bind this to a key instead of right mouse button?
Keep in mind how rough that is.