Home   Help Search Login Register  

Author Topic: Mando Tractor, time to park these planes  (Read 10164 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Mando Tractor, time to park these planes
« on: 13 Aug 2007, 03:00:50 »
Makes any vehicle able to hook plane's noses or tails and then pull to park them.

Edit: Updated to v1.1

The elacticity of the link is now minimized.
Probably now fully MP compatible.
« Last Edit: 19 Aug 2007, 23:42:52 by Mandoble »

Offline smoke52

  • Members
  • *
Re: Mando Tractor, time to park these planes
« Reply #1 on: 15 Aug 2007, 17:20:30 »
nice!!

im going to have to play around with this later, all we need now is someone to model a real one :D

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Mando Tractor, time to park these planes
« Reply #2 on: 19 Aug 2007, 21:03:03 »
Excellent script as usual, Mandoble. But there are some things i would point at.

MP-compatibility:
At first it didn't worked in MP but by adding if (! local player) exitwith {}; it worked...as long only 1 tractor was in use. I saw you use a global variable (mando_tractor_hook) and i guess this variable messes up as soon a second tractor tries to hook. If this can be fixed (my thought was to createvehicle a gamelogic when hooked, name it something unique, and delete it when unhook, but i bet you'll find a better way) it would be great for big Coop MP maps.

Towing Planes/Choppers:
It seems that the planes/choppers are attached with some kind of elastic rubberband. If it's possible something more stable (makin it better controllable and also closer to realistic) would be nice. Look at JasonO's picture there you can see what i mean.

This script might not be one of those groundbreaking stuff, no superkewl new special effects. But it's a step to a more realistic behaviour on airfields as usually Choppers don't start right out of the hangar. Keep your excellent work up, mate.


Myke out

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #3 on: 19 Aug 2007, 21:33:25 »
For addAction the unit and the effects are always local so if (! local player) exitwith {} is not needed as only the local player may activate any action availabe on this game. Unless the documentation about addAction is wrong.

mando_tractor_hook is global, but it is not published, so it doesnt mess with the corresponding mando_tractor_hook variables in other machines. So you may have two tractors trying to pull from a plane to opposite directions.

Good point about the elasticity, I have now a version where you may choose between elastic link or fixed one. With the latter the elasticity is minimum (while still exists, like in the tractor of the picture, but almost not noticeable). I will update to the new version later or tomorrow.

EDIT: v1.1 available.
« Last Edit: 19 Aug 2007, 23:43:32 by Mandoble »

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Mando Tractor, time to park these planes
« Reply #4 on: 21 Aug 2007, 23:38:54 »
Version 1 was really weird where you would gain speed and then stop and the plane had to catch up with you. Didn't like that at all  :no:...

Version 1.1 doesnt really work? I attach it and drive off and it follows me for a bit, then I turn around and its not following me, just moving very very slowly on the grass. I still have the unhook option.

Quote
Good point about the elasticity, I have now a version where you may choose between elastic link or fixed one. With the latter the elasticity is minimum (while still exists, like in the tractor of the picture, but almost not noticeable).

How do I make it fixed?

Also, is there a way of adapting this for a tow script for vehicles?
« Last Edit: 21 Aug 2007, 23:46:15 by JasonO »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #5 on: 21 Aug 2007, 23:51:30 »
You need to keep low speed to keep with the plane, else it will unhook and you will need to hook it again.

Adapting it for vehicles is quite easy. Change this line in mando_hook.sqf
Code: [Select]
_planes = nearestObjects [_tractor, ["Air"], 20];by
Code: [Select]
_planes = nearestObjects [_tractor, ["LandVehicle"], 20];or
Code: [Select]
_planes = nearestObjects [_tractor, ["Air", "LandVehicle"], 20];for planes and vehicles.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Mando Tractor, time to park these planes
« Reply #6 on: 22 Aug 2007, 00:01:56 »
Thanks

Is this a script/Arma engine limitation of having to keep a certain speed, because I want to be able to go a bit faster.

Also, when I do LandVehicle, the vehicle hooks itself. I haven't managed to grasp SQF yet so I don't know how to skip the vehicle if its the players vehicle.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Mando Tractor, time to park these planes
« Reply #7 on: 22 Aug 2007, 00:03:07 »
Quote
Version 1.1 doesnt really work? I attach it and drive off and it follows me for a bit, then I turn around and its not following me, just moving very very slowly on the grass. I still have the unhook option.
I can second that, although i was driving as slow as i could (which isn't easy at all in ArmA) and i was driving backwards where speed is even more limited.

Myke out

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #8 on: 22 Aug 2007, 00:14:04 »
Look for this in mando_tractor.sqdf and change the 10 by 1000 and try.
Code: [Select]
   while {((_plane modelToWorld [0,_planelength*_inversion,0] distance _log) > (4+accTime)) && (((_plane modelToWorld [0,_planelength*_inversion,0]) distance _tofollow) < 10) && mando_tractor_hook} do

The automatic unhook when further than 10m away, was coded because while the plane will try to keep with you (will try to match your speed), due different localities in MP, a tractor driver may actually gain distance over and over along the time.

LOL, yep, the vehicle will hook itself with LandVehicle.

Do this in mando_hook.sqf:
Code: [Select]
_planes = nearestObjects [_tractor, ["LandVehicle"], 20];
if (count _planes < 2) exitWith {};
_plane = _planes select 1;
« Last Edit: 22 Aug 2007, 00:17:02 by Mandoble »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Mando Tractor, time to park these planes
« Reply #9 on: 22 Aug 2007, 09:04:01 »
So how hard is it to convert this to work for AI as well? As in, letting the AI hook/unhook vehicles and towing them around? (for those sweet-ass SP missions for eyecandy). is it possible to use for instance this:

Quote
USER
unitName ["USER", <target unit>, <action index>]

Soldier 'unitName' does nothing. Executes the custom action with the given index of the the target unit. Indexes are based upon the order in which the actions are added to the unit. See addAction.

Example:
gameLogic action ["USER", player, 3]

From the BIKI:D Would be quite, as they say, sweeeet. Your coding is generally too hard for me otherwise (I suck at math) and I can't quite pierce .sqf syntax yet.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #10 on: 22 Aug 2007, 19:00:51 »
if you know the plane and you know the tractor, you may simply execute mando_tractor.sqf directly, you dont need any action. Making the AI to drive accurately is a different story ...  :whistle:

Offline Morticus

  • Members
  • *
Re: Mando Tractor, time to park these planes
« Reply #11 on: 20 Sep 2007, 16:06:23 »
Is there any way we can convert this script to get trucks to pull Static Guns ?

This would be great,

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #12 on: 20 Sep 2007, 16:16:35 »
Open mando_hook.sqf and change:
Code: [Select]
_planes = nearestObjects [_tractor, ["Air"], 20];

by
Code: [Select]
_planes = nearestObjects [_tractor, [PUT THERE THE LIST OF OBJECTS TYPES YOU WANT TO BE ABLE TO HOOK], 20];

And for a  list of types:
CfgVehicles Class Tree

But, are the current static weapons able to use their wheels?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Mando Tractor, time to park these planes
« Reply #13 on: 20 Sep 2007, 17:34:55 »
They are not. I tried to use mandotractor to drag the D-30's for the intro cutscene to Operation Dawning Hope,  but it sadly didn't work. Also another fun little event:

(not the best picture, but yeah)

Basically, if you drive your tractor downhill, your towable object will just quietly glide away above you.  ::) Seems like someone forgot to check the actual height above ground of the towable object/another ArmA bug.

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Tractor, time to park these planes
« Reply #14 on: 20 Sep 2007, 17:52:04 »
Open mando_tractor.sqf and change
Code: [Select]
      _vz = -0.01; 

by
Code: [Select]
      _vz = -0.5;