Author Topic: Getting the players velocity before the brick stops him?  (Read 907 times)

I need to get the players velocity right before his velocity is set back to 0 0 0 after hitting a brick

Would this do?
Code: [Select]
function Armor::onImpact(%this, %obj, %brick, %vel, %splatSpeed)
{
//Your stuff here

return parent::onImpact(%this, %obj, %brick, %vel, %splatSpeed);
}

Would this do?
Code: [Select]
function Armor::onImpact(%this, %obj, %brick, %vel, %splatSpeed)
{
//Your stuff here

return parent::onImpact(%this, %obj, %brick, %vel, %splatSpeed);
}
OnImpact is only activated once the player is at a fall damage speed

OnImpact is only activated once the player is at a fall damage speed

Use ::onCollision then.

Use ::onCollision then.
But that's not called when they hit a brick unless it has an event correct?

But that's not called when they hit a brick unless it has an event correct?

Correct. There is no other way.

The correct collision callback for players has never been added to the game

But that's not called when they hit a brick unless it has an event correct?
Use the armor::onCollision, not fxdtsbrick::oncollision

Use the armor::onCollision, not fxdtsbrick::oncollision

armor::onCollision is not invoked if the brick you're hitting doesn't have a specific member field set.

armor::onCollision is not invoked if the brick you're hitting doesn't have a specific member field set.
Which one?

armor::onCollision is not invoked if the brick you're hitting doesn't have a specific member field set.

So just set the member field on brick creation.

So just set the member field on brick creation.

That would defeat the purpose of it.

So just set the member field on brick creation.
What's the member field?

%brick.enableTouch = 1;

also, why isn't this working?

package a
{
   function Armor::OnCollision(%this, %obj, %brick, %vel, %splatSpeed)
   {
      talk(%this SPC %obj SPC %brick SPC %vel SPC %splatSpeed);

      return; parent::OnCollision(%this, %obj, %brick, %vel, %splatSpeed);
   }
};
« Last Edit: September 30, 2012, 03:58:40 PM by Conservative »

also, why isn't this working?

package a
{
   function Armor::OnCollision(%this, %obj, %brick, %vel, %splatSpeed)
   {
      talk(%this SPC %obj SPC %brick SPC %vel SPC %splatSpeed);

      return; parent::OnCollision(%this, %obj, %brick, %vel, %splatSpeed);
   }
};
Because it needs to be return parent::OnCollision(%this, %obj, %brick, %vel, %splatSpeed); not return; parent::OnCollision(%this, %obj, %brick, %vel, %splatSpeed);

Don't forget activatePackage(a);