Jump to content
Sign in to follow this  
rundll.exe

Vehicle towing script

Recommended Posts

It occurs to me that it might be possible to use a modified version of this system to make objects/vehicles which are being carried by helicopters behave in a more realistic way (i'e swinging around when the helo changes vector).

For example if the helo slows down rapidly and stops, the cargo being carried underneath continues to swing forward etc. Possible?

If this script is somewhat a success I will try to make something like that. Its quite a bit more complicated tho, since you have to account for inertia, which a towed vehicle doesn't have (not noticeable at least)

The usage in warfare needs some heavy MP testing, and may take a bit more time. I'm not working full-time on this unfortunately :)

You can expect a 1.0 release next Monday , but no promises.

Share this post


Link to post
Share on other sites

You want realistic airlift physics? The hitched vehicles would end up on top of the helicopter with the way people fly. Same thing for with overstress on planes, there would be a lot of bent airframes.

Share this post


Link to post
Share on other sites

Looks bloody awesome, and I agree with Frederf that stuff like this is what we need :) I sure hope it will be possible to have it work in MP without causing lag.

Share this post


Link to post
Share on other sites

That would be awesome Gnat :D If only we had the Sigma-6 truck and your trailler in A2...:whistle:

Share this post


Link to post
Share on other sites
No its even better, right now the only thing you have to do is add a gamelogic to the map with an init line to the script. It will automatically search for vehicles in a radius from that gamelogic, and enable suitable vehicles for towing.

You can edit the script to remove or add vehicles (think addons) to the list ofcourse.

I don't think It will change later, since I think it works pretty convenient.

Wouldn't it be possible to add it as a Module instead of a gamelogic? Seems like alot of people forget about them when making addons/scripts :) and using modules is alot easier for the end user than all the gamelogics, init lines and other stuff like that.

(module example from SNKMAN here)

Edited by Cole

Share this post


Link to post
Share on other sites

That would be an idea indeed. But that requires an addon pbo, wich I want to avoid as long as possible.

Edited by rundll.exe

Share this post


Link to post
Share on other sites
If only we had the Sigma-6 truck and your trailler in A2...:whistle:

Better than that, I have Sigma-6's truck AND his own semi-trailer ;)

PBO? I think I'd prefer an addon version myself.

Share this post


Link to post
Share on other sites

Ok I kindof promised a release for today, so here you go:

Download

From the readme:

Just run the sample mission and drive a suitable vehicle to something you want to tow.

For example drive the towing tractor backwards under the nose of a su34.

When you're close enough (2m) to its attach-point, you will get an action "attach vehicle". Enjoy the ride!

The scripts are inside the example mission in a folder called dll_tow

For easy use in your own mission, copy the dll_tow folder to your mission root folder,

and place a gamelogic near your vehicles and put in the init line:

null = this execVM "dll_tow\enabletowing.sqf";

Use the config.sqf to add new objects to be enabled for towing or change the search radius (default 1km).

For usage of the generic script (for standalone use) see the tow.sqf script.

Its beta, meaning there will be some weird behavior sometimes of the vehicles, and there are no safety measures yet. There is also a lot of extra code for debugging (set dll_tow_debug to true in config.sqf) but I think that doesn't affect the performance. The code is commented quite a bit, so you should be able to tweak here and there if you're into scripting ;)

Please give feedback on the smoothness of the towed vehicle. It may need some more tweaking.

Edited by rundll.exe

Share this post


Link to post
Share on other sites
Ok I kindof promised a release for today, so here you go:

Download

one word: AWESOME! thank you very much :bounce3:

Share this post


Link to post
Share on other sites

Yes, avoid addon method at all cost. Any mission designer with respect for himself would read the instructions how to use a script package, and removes unwanted dependancy to download an addon to play a mission. If addon based, you would never get missions like Domination to use it, unless it was part of a big package like ACE2 or something.

Share this post


Link to post
Share on other sites

outstanding work :D

i agree with CarlGustaffa. avoid addon methode at all costs,

Share this post


Link to post
Share on other sites

Is it possible somehow to simulate towing of the artillery pieces?

Share this post


Link to post
Share on other sites

As I stated before, it is possible, but there is something weird with the BIS arty pieces. I didn't find out yet what it is, but they turn around by themselves. I guess the modelToworld command doesn't work properly for those models.

You can try it with the example mission. Walk to the hmmwv and attach the generator trailer, and watch... Its the same as the BIS arty.

Ill investigate this soon, but I doubt Im able to solve it :(

If anyone has a suggestion for an non-bis arty addon I can test with, post a link here.

Share this post


Link to post
Share on other sites

Maybe you could find a solution by taking a look into A1 artillery models. They have been released in MLOD format.

I would really like to see and addon that makes both M119 and D-30 deployable and makes a good use of your towing script :).

Share this post


Link to post
Share on other sites

Legend!!!:jump_clap:

So when is BIS going to hire you?

People like you make Arma 2 more enjoyable! Keep up the great work!

Share this post


Link to post
Share on other sites

I am not really sure how it all works, but could you use attachTo on the artillery piece to lock it in place onto some small, non-visible object then do the calculations on the small object to move it around?

Share this post


Link to post
Share on other sites

thats not a bad idea tcp. But I dont know how it will "follow" the terrain then. Have to test.

Share this post


Link to post
Share on other sites

Yea the only reason I thought it might be acceptable is because it's not like the piece has wheels to begin with.

Share this post


Link to post
Share on other sites

Very interesting script :bounce3:

I found the one bug in 0.1b.

If a tractor becomes an acute angle, it will continue being pushed from succession vehicle and handling will become impossible.

Share this post


Link to post
Share on other sites

Can you tell me which variable affects the distance to plane for Attach as I am trying to setup for B52 and need to have Tow Vehicle in front more than C130 settings.

Thanks

Share this post


Link to post
Share on other sites
Very interesting script :bounce3:

I found the one bug in 0.1b.

If a tractor becomes an acute angle, it will continue being pushed from succession vehicle and handling will become impossible.

Yeah thats known. For now, you just need to press detach.

Unfortunately I cant detect if 2 objects collide with each other. I added a check on the angle in tow.sqf (line 68 to 71) but I commented it out because it can be anoying. I might have to add a max angle for each vehicle I guess.

Can you tell me which variable affects the distance to plane for Attach as I am trying to setup for B52 and need to have Tow Vehicle in front more than C130 settings.

Thanks

Have a look in config.sqf, you see

["C130J",	[0,15],	[0,-5], 	nil,	false]

duplicate that line and change "C130J" to the classname you have for the B52. Then edit the offsets for your plane. [0,15] means the front axis (tow position) is 15 meters in front of the CENTER of the C130, and 0 meters to the right of it. [0,-5] means that the wheels are 5 meters behind the center and 0 meters to the right.

Make sure you end the matrix the right way, as its done now.

set dll_tow_debug = true; in the first line, to see the axis marked with roadcones. This makes it easier to locate the right offset

Good luck

Edited by rundll.exe

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  

×