| Blockland Forums > Modification Help |
| Finding what a vehicle hits |
| (1/5) > >> |
| Treynolds416:
So I need a script to figure out what exactly a certain vehicle has hit. the package part is pretty easy: --- Code: ---package WtfAmHit { function DriftingJeepVehicle::OnImpact(%this,%obj,%col,%pos,%speed) { //What now } }; activatePackage(WtfAmHit); --- End code --- %pos is highly unreliable, the given position is way off from where the collision occurs. %speed is only a scalar value, %col is always 0, and I don't have a clue what %this is. I could do some stuff with container searches, but that is messy and I wanted to know if there is a cut and dry method before I jump all the way in. |
| Treynolds416:
Well of loving course I figure something out right after I post a topic. Turns out the fourth argument in ::OnImpact is actually the velocity vector, not the position. I guess most of the BLF has gotten it wrong, because all of the search results have the fourth argument as %pos. It probably doesn't help me much, but progress is progress. |
| Lugnut:
%this is either the datablock of the drifting jeep or the instance of the drifting jeep I believe %obj is literally the object that the vehicle hit. |
| Treynolds416:
--- Quote from: Lugnut1206 on June 08, 2012, 11:02:12 PM ---%this is either the datablock of the drifting jeep or the instance of the drifting jeep I believe %obj is literally the object that the vehicle hit. --- End quote --- %obj is the jeep Would %this be the datablock of the thing it hit? |
| Port:
%col is what the object hit. http://docs.garagegames.com/torque-3d/reference/classShapeBaseData.html#a20b5fdadf24208cf5e7ef53d0242747c |
| Navigation |
| Message Index |
| Next page |