Author Topic: No Collision between players  (Read 2266 times)

Is there any way to disable collision between players.  I want players to be able to walk straight through other players.

So far I tried this, the message was sent but collision was normal:

Code: [Select]
Package NoCollision
{
function Armor::onCollision(%this, %obj, %col, %vec, %vecLen)
{
   if(%col.client.player)
   {
      messageclient(%obj,1,"Collision with another player");
      return;
   }
   Parent::onCollision(%this, %obj, %col, %vec, %vecLen);
}
}
ActivatePackage(noCollision);

Doesn't return give you a value or something?

Try break;

Doesn't return give you a value or something?

Try break;
no,
return exits the function,
break exits the current loop.

I think you'd need engine changes to prevent collision between players, the Armor::onCollision function is called after a collision to my knowledge, and exiting would not stop the collision from happening. You may be able to move the position of one of the players into the other and re-apply the impulse, however that would be very glitchy and probably wouldn't work properly. There may also be a few errors in the code, but I don't think it'll work anyway, but you can try again:
Code: [Select]
package NoCollision
{
function Armor::onCollision(%this, %obj, %col, %vec, %vecLen)
{
if(%col.getClassName() $= "Player")
{
messageclient(%obj.client, '', "Collision with another player");
return;
}
Parent::onCollision(%this, %obj, %col, %vec, %vecLen);
}
}
ActivatePackage(NoCollision);

the message was sent
I'm not sure how, because keywords in torquescript are case-sensitive, and yours had a capital 'P' in package.

Doesn't return give you a value or something?

Try break;
no,
return exits the function,
break exits the current loop.

Wow, I'm horrible at coding. My bad.

The collision is defined in the model.  The onCollision method describes the actions that should take place after the collision.  The only way to get around this would be to have a different player model (a version of the m.dts with no collision) or to have engine changes that allow you to toggle collision.  I don't think there are any methods currently defined that allow you to toggle collision the way %brick.setColliding(%bool) does.

You could make the player a negative scale, however you would end up with the ugly inside-outness of negative scaled models.

If you managed to make a new player model without collision, it would fall through everything, not just players.

If you managed to make a new player model without collision, it would fall through everything, not just players.
/noclip

If you managed to make a new player model without collision, it would fall through everything, not just players.
/noclip

Lol thats the Half-life CMD , humm how about a flying player type ?

If you managed to make a new player model without collision, it would fall through everything, not just players.
/noclip

Lol thats the Half-life CMD , humm how about a flying player type ?

actually that command has been used since quake

A player's collision box is defined by the boundingBox value in the datablock, players don't actually have a collision mesh.

But the bounding box does not control collision.  The player has a separate collision box.  This is why the %player.getHackPosition() method exists, to get the center of the collision box.

you want to make the challange even harder?!?!?

DAMN U

you want to make the challange even harder?!?!?

I think he wants to make it so there isnt player build up and you cant jump on peoples' heads for help, etc.