Game Development Community

How to get an objects ID on Impact

by Kevin Ostrowski · in Torque Game Engine · 03/08/2002 (12:31 am) · 5 replies

Here is a simpler version of a post I made a few days ago... How do I get the ID of the object that a vehicle is impacting with?

#1
03/08/2002 (12:07 pm)
Has no one been able to do this? It looks really funny when you smash a car into another and the car you are controlling fly's back, but the one you hit stays there like a brick wall... I really don't think this is a scripting porblem but rather something that's in (or not in) the engine.
#2
03/08/2002 (1:08 pm)
I'll look at it again tonight. I don't have the head version, but the code I sent you originally worked in my game (version 1.1.1)

It seems that collision is handled much more like with the player in player.cc using an object taken from the collision matrix (in the head version) as opposed to some wierd format that my current file has. It does allow me easier access to the object you hit, so it's why I have it working.

I think we have to figure out how to work with the collison matrix, and that's something I know little about. This is gonna be fun, hehe...
#3
03/08/2002 (1:20 pm)
Heh... Thanks again... I'm still trying to get the hang of C++ so a lot of this is still over my head, but I'm a quick learner :) I tried messing around with the code you gave me, but about the only thing I succeeded in was more compile errors...
#4
03/08/2002 (1:51 pm)
Yeah, a good portion of my vehicle.cc is different than yours. I didn't realize that when I Sent over the "fix" for you, so you'd be best off not trying to mess with it much.

All we need to get this working is the object that you hit, which was done in player.cc If you don't have much knowledge of c++ it's going to be hard, but hopefully someone else has looked around collision matrix code since it does seem to be pretty confusing.
#5
03/08/2002 (2:18 pm)
I've looked around the player.cc file a bunch but couldn't really figure out what I would need to pull from it to put in the vehicle.cc file... If only Torque was written in PHP (not that it's possible), I'd have no problems :)