onVehicleTouch - a do-over?

Author Topic: onVehicleTouch - a do-over?  (Read 1268 times)

I've been making plans for a server that would benefit greatly from an onVehicleTouch event of some form. Through search, I found Chrono and Trigun's onVehicleTouch (found -here-, but it was failbinned for a faulty vehicle detection method-
Quote from: trader
This Add-On basically uses a method of vehicle detection that Trigun used previously in an Add-On that was also failed.  It involves running a function on a schedule, several times a second that searches around every vehicle in the server to see if any bricks are near.  There's not even a guarantee that the vehicle is actually colliding with the brick because of the way this check works.  This check is based on the bounding box of the vehicle, which is almost never the same size as the vehicle's collision mesh.  So, not only do you have a persistent schedule running the entire time the server is alive, you also have a detection method that isn't accurate.  The only way to get an accurate, efficient onVehicleTouch event is to have Badspot expose the engine's vehicle collision functionality (onCollision, etc) to TorqueScript.  You're just going to have to wait for him to add this functionality, because I'm going to fail any Add-On that offers an TorqueScript-based onVehicleTouch event.

My understandings of torque is that of a newborn, so I'll just go ahead and ask- 6 years later, is it possible to produce the same add-on, but without the faulty scheduling or checks?


Pardon the edit- I had intended to mention Chrono's onVehicleTouch but it slipped my mind before I posted. Details added in.
« Last Edit: May 14, 2015, 02:13:44 PM by AdinX »

the suspense is killing me

I've been really needing this event back too, hopefully someone can make a new one.

onvehicleenterzone works well, you could just use that

I could, and I don't want to explain my purposes but I will-
Quicksand: I COULD use zone events to trigger a single plate of quicksand and use relays to spread it down... OR I could use onVehicleTouch to make plates fakekill to simulate quicksand collapsing at point of contact.

Roadside IED: I COULD use zone events to trigger it (as I type this in an airport >,>") and it would be able to activate so long as the vehicle is within an 8x zone (smallest zone brick I can think off of the top of my head, though I think there are some brick shaped) OR I could have an actual wire trailing across the road.

Motion sensor: I COULD use zones to detect when a vehicle enters a lift or garage, but that won't be accurate if I want it to specifically stop at tire marks. If I use onVehicleTouch, I can have 4 spots and be specific about each tire being locked down (not sure if tires are detected but one can hope)

I have other uses but my point is zones work, but that's like walking when you can run.

or you could put the zones on the bricks themselves instead of on other bricks to trigger it
zones can be put on any bricks, not just zone bricks

I'm not quite following what you mean by put zones on the bricks. That's what I said I would have to do to activate everything. The vehicle would have to enter the zone to activate the events

Unless you mean to say I would put the onVehicleEnterZone activator directly on the bricks that the vehicles only touch. In which case I don't think that actually works, but I can't test that since I don't have my laptop with me in Mexico

Quicksand: I COULD use zone events to trigger a single plate of quicksand and use relays to spread it down... OR I could use onVehicleTouch to make plates fakekill to simulate quicksand collapsing at point of contact.
I don't see what the issue with the first solution is
Roadside IED: I COULD use zone events to trigger it (as I type this in an airport >,>") and it would be able to activate so long as the vehicle is within an 8x zone (smallest zone brick I can think off of the top of my head, though I think there are some brick shaped) OR I could have an actual wire trailing across the road.
you can turn any brick into a zonebrick, you don't have to use the ones in the brick menu
and therefore you can have an actual wire trailing across the road. just make it a zonebrick
Motion sensor: I COULD use zones to detect when a vehicle enters a lift or garage, but that won't be accurate if I want it to specifically stop at tire marks. If I use onVehicleTouch, I can have 4 spots and be specific about each tire being locked down (not sure if tires are detected but one can hope)
I'm not even sure how you plan to accomplish this in the first place, but you could definitely do the same thing by setting down four zonebricks where the tires will be
I have other uses but my point is zones work, but that's like walking when you can run.
no it isn't. first of all, you can't "run" and Trader already explained why. second, zonebricks are great for your purposes
« Last Edit: May 16, 2015, 12:05:51 PM by Foxscotch »

Unless you mean to say I would put the onVehicleEnterZone activator directly on the bricks that the vehicles only touch. In which case I don't think that actually works, but I can't test that since I don't have my laptop with me in Mexico
it works, you event a zone onto a brick just like zonebricks, and then you use the input event in exactly the same way
there's nothing different...

I have other uses but my point is zones work, but that's like walking when you can run.
personally I'd say we have the running option
out of the two, onvehicleenterzone and onvehicletouch, I'd say the zones are a whole lot more powerful because the vehicle doesn't have to collide with something and stop at it

I'm not even sure how you plan to accomplish this in the first place, but you could definitely do the same thing by setting down four zonebricks where the tires will beno it isn't.
Might be able to do a thing where there's a latent zone and have the zone check if the vehicle is at a certain coordinate and rotation through VCE, where if it fails, it fires a non-looping relay to disable and reset the zone, which checks for the vehicle entering the zone, and does position and rotation checks again.  When it matches to a satisfactory degree of accuracy, you can then run the other events for whatever OP wanted to do once the vehicle was aligned.

Wow cool avatar AdinX did you make that yourself?

[EDIT] I know you didn't because I did.

Wow cool avatar AdinX did you make that yourself?
[EDIT] I know you didn't because I did.
I doubt you drew yours yourself either


Might be able to do a thing where there's a latent zone and have the zone check if the vehicle is at a certain coordinate and rotation through VCE, where if it fails, it fires a non-looping relay to disable and reset the zone, which checks for the vehicle entering the zone, and does position and rotation checks again.  When it matches to a satisfactory degree of accuracy, you can then run the other events for whatever OP wanted to do once the vehicle was aligned.
too complicated, someone make onVehicleTouch
or release it if it's private for some reason

too complicated, someone make onVehicleTouch
or release it if it's private for some reason
Read the quote in the OP.  But even still, my method would still be more reliable than any possible onVehicleTouch event.