Jump to content
Sign in to follow this  
rundll.exe

Vehicle towing script

Recommended Posts

Hi,

I have been working on a script for towing vehicles (truck-trailer) in a realistic way and finally I came up with a script that does this quite well. It took some maths and trail-error to make it work, but in fact the basic idea is quite simple. (math-wise)

Here is a preview of the script in action:

Q-Yeu21RaVc

Its a generic script that can be applied to almost every vehicle or object in game. You just need to specify the position of the wheels and the axis, and you can connect any object to eachother. Vanilla arma doenst include proper trailers, so the best use for it now is towing planes, put them in or out hangars and parking them.

It's still a bit rough, so I need to tweak some more to make the ride as smooth as possible, and optimize in performance. Dont know when the release will be, but shouldnt take too long.

Share this post


Link to post
Share on other sites

Thank you very much.

We would sure love to use it to tow our AT-guns with it :)

Greetingz, Monk.

Share this post


Link to post
Share on other sites

Excellent work :)

Hopefully can be worked into getting the trains hooked up at some point too ;)

Share this post


Link to post
Share on other sites

This is VERY cool! :D

Two questions:

- Does it work on the aircraft carrier deck?

- Can you tow a damaged vehicle/truck(e.g.: front left tire flat)?

MfG Lee :)

Share this post


Link to post
Share on other sites

They said it couldn't be done. Working hinges, awesome!

Share this post


Link to post
Share on other sites

This is totally awesome! Finally make a Airport more functional moving Aircraft and on the LHD this should really be the answer!

Well Done!

Share this post


Link to post
Share on other sites

I don't think the LHD is life-size so it will still be hard to move Aircraft around. I'm not saying it can't be done but the catapult script moves stuff around automagically.

Share this post


Link to post
Share on other sites

Nice!

This will be in ACE2 also i think (not this version but). Great stuff you guys make. Thanks!

Share this post


Link to post
Share on other sites
Great start!

Have you tested it on steep terrain too? Like hills on Chernarus?

Looking forward to your release !

I havent tested that verry much, but there is no reason for it not to work, since it uses setvectordir.

This is VERY cool! :D

Two questions:

- Does it work on the aircraft carrier deck?

- Can you tow a damaged vehicle/truck(e.g.: front left tire flat)?

MfG Lee :)

Yes it works on the LHD, but planes act a little jumpy there. IT doesnt look that nice but it is verry functional, putting the planes in the right place for take-off for example

And yes, damaged vehicles shouldnt be a problem. You cant tow wrecks atm, but if you need you can change that in the script.

I think I'll release a simple version first for some feedback, and later make a complete package, and hopefully MP proof.

Share this post


Link to post
Share on other sites

" I think I'll release a simple version first for some feedback, and later make a complete package, and hopefully MP proof. "

Awesome! will be the perfect thing to move the B-52 around! :bounce3:

Share this post


Link to post
Share on other sites

Awesome, this is what ArmA modding needs and not another jet, sniper rifle, tank, etc. Do you use attachTo at any point in your script? It might solve some of the jumpiness but it has other limitations.

Something like no (or very little) change in geometry between tow and towed and you can just use attachTo for the static relationships and then switch over to a setPos/Vector system for turns, hills, etc and then back to attachTo for straights. Going over terrain could be problematic.

Another avenue of expansion is making the tug more sluggish based on the resistance of the thing being pulled. Just an idea sure to lead to all manner of coding headaches.

It really is a shame that BIS didn't include a decent built-in articulated attachTo scripting function.

Share this post


Link to post
Share on other sites

attachto is too limited for this use, and switching those would be really ugly. for vehicles I use a combination of setdir/setvectordir and setvelocity. for static objects I have to use setpos, since you cant give it a velocity. Setpos is way more choppy ofc.

Share this post


Link to post
Share on other sites

A superb piece of work ... great job :rthumb:

Edited by Lester

Share this post


Link to post
Share on other sites

WAIT WAIT WAIT:

LoL I asked Norrin 2 months ago for this script and he made the script!

It can be found in Armaholic but I don't know why in this moment is unavailable but here is the script:

http://www.megaupload.com/?d=7XFXS5EI

If this can help you there are the different distance between tractor and airplanes... (warning for the names of SU25 and AV8B: there are different version)

about 2 weeks ago I asked at Norrin if he can fix the bug on LHD (it's impossible attach the planes) but he is very busy so...

I hope something in the script can help you in your work!

But in credits put Norrin :P

---------- Post added at 12:18 PM ---------- Previous post was at 12:06 PM ----------

attachto is too limited for this use, and switching those would be really ugly. for vehicles I use a combination of setdir/setvectordir and setvelocity. for static objects I have to use setpos, since you cant give it a velocity. Setpos is way more choppy ofc.

ah yes the Norrin's script is based on attachto he said it's ugly but it's functional and he made it in brief time...

Share this post


Link to post
Share on other sites

now all we need is a tow-bar model and everything is perfect :D

Share this post


Link to post
Share on other sites
WAIT WAIT WAIT:

LoL I asked Norrin 2 months ago for this script and he made the script!

It can be found in Armaholic but I don't know why in this moment is unavailable but here is the script:

http://www.megaupload.com/?d=7XFXS5EI

If this can help you there are the different distance between tractor and airplanes... (warning for the names of SU25 and AV8B: there are different version)

about 2 weeks ago I asked at Norrin if he can fix the bug on LHD (it's impossible attach the planes) but he is very busy so...

I hope something in the script can help you in your work!

But in credits put Norrin :P

---------- Post added at 12:18 PM ---------- Previous post was at 12:06 PM ----------

ah yes the Norrin's script is based on attachto he said it's ugly but it's functional and he made it in brief time...

Well, if Norrins script is using attachto it cant be the same script as runddl.exe doesnt use that command..

Share this post


Link to post
Share on other sites
Well, if Norrins script is using attachto it cant be the same script as runddl.exe doesnt use that command..

yes.... the command setVector is more realistic than AttachTo only but it take more time to make a script... but it's a nice idea!

Share this post


Link to post
Share on other sites

I think people are underestimating how complex and proper you can use attachTo as a command. I'm not suggesting a simple "attach and forget it" where the relative geometry doesn't change.

Share this post


Link to post
Share on other sites

To clarify, I didn't know of the existence of norrins script, I will check it out tomorrow.

Attachto was my first attempt, but there are many problems with it. The biggest problem is that there is no collision with the attached object, so it goes right trough walls etc.

My script doesnt suffer from that, since it uses setvelocity: It obeys Arma's physics (which are a bit wacky but it works)

The things I still have to do are safety measures, like when the angle becomes too big it should break the towing. Also I need to add all the axis positions of different BIS vehicles in a convenient way to the script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×