Author Topic: Player-Brick collision detection?  (Read 2067 times)

Is there any catch-all I can use to see when a player has collided with a brick?

The basic idea is that I would have a package{} in which I could say, "if so and so condition, do this, oh yeah and BTW pass this on to normal collision stuff".

There is no collision callbacks for bricks.

Edit: Just remembered there is but I remember Badspot or someone said there was something about no collision callbacks. I think bricks being touched or something.
« Last Edit: May 18, 2007, 06:48:28 PM by -=>RR<=-MasterCE »

Can I do some kind of collision callback on the player?

Let's say I set up %thCIAthebrick.sillyvariable = true, can I check %thingthattheplayerhit.sillyvariable somehow, in a callback?

EDIT: The method here would also work for my purposes: http://www.blockland.us/smf/index.php?topic=15451.0

However, I can't get the trigger to create properly. I'm sure what %owner is supposed to be, and I seem to be having trouble passing the brick into the function even though I have its object ID.
« Last Edit: May 18, 2007, 09:10:39 PM by JJ10DMAN »

Triggers do not work too well, as your trigger bounding box is much larger than the collisions box. Look in the mission editor at yourself, another player or a bot.

You could try using the packaging you suggested as well as Armor::OnImpact, like this:

Code: [Select]
package ImpactChecker
{
 function Armor::onImpact(%this, %obj, %collidedObject, %vec, %vecLen)
 {
   if(%collidedObject.sillyvariable)
   {
     //Execute whatever code you want.
   }
   Parent::OnImpact(%this, %obj, %collidedObject, %vec, %vecLen);
 }
}
ActivatePackage("ImpactChecker");

To be fair, I could just make it a Tic that fails unless the intersection includes the actual model, but your way is easier  :cookieMonster:

I'll give it a try and edit the results.

OK EDIT: the OnCollision doesn't trigger unless the armor is subjected to falling damage. Only knowing that a player has died by impacting the brick is not suitable for my purposes. Seeking advice on where to go from here.
« Last Edit: May 19, 2007, 05:04:04 PM by JJ10DMAN »

LOL REVIVE  :cookieMonster:

Quote
Trigger collision is now based on player's collision box rather than bounding box

So now that this thing is 1.03 here to be working easily, can someone help me with triggers? I've been googling garagegames.com like crazy and I can't come up with any examples of how to deal with trigger creation/deletion in Tscript.

edit: Oi so anyway, I went online and saw this thing called scale changer, went back on here and downloaded it, dug around, I think I can just cannibalize what's in there.

Aloshi your box of  :cookie: s is in the mail.
« Last Edit: June 03, 2007, 01:41:29 AM by JJ10DMAN »