OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Mandoble 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.
-
nice!!
im going to have to play around with this later, all we need now is someone to model a real one :D
-
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 (http://www.ofpec.com/forum/index.php?topic=30030.msg205480#msg205480) 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
-
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 (http://community.bistudio.com/wiki/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.
-
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.
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?
-
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
_planes = nearestObjects [_tractor, ["Air"], 20];
by
_planes = nearestObjects [_tractor, ["LandVehicle"], 20];
or
_planes = nearestObjects [_tractor, ["Air", "LandVehicle"], 20];
for planes and vehicles.
-
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.
-
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
-
Look for this in mando_tractor.sqdf and change the 10 by 1000 and try.
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:
_planes = nearestObjects [_tractor, ["LandVehicle"], 20];
if (count _planes < 2) exitWith {};
_plane = _planes select 1;
-
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:
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 (http://community.bistudio.com/wiki/ArmA:_Actions#USER)? :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.
-
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:
-
Is there any way we can convert this script to get trucks to pull Static Guns ?
This would be great,
-
Open mando_hook.sqf and change:
_planes = nearestObjects [_tractor, ["Air"], 20];
by
_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 (http://www.ofpec.com/COMREF/armavehicles.php)
But, are the current static weapons able to use their wheels?
-
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.
-
Open mando_tractor.sqf and change
_vz = -0.01;
by
_vz = -0.5;
-
Sorry to drag up an old thread, I have a small problem. I can hook and unhook but the plane will not move. What am i doing wrong?
-
Have you tried putting it in neutral?
-
I'm sorry but i do not understand, the tractors are automatic :)
-
Does it work for you the demo mission?
-
unfortunately not. I was using the demo mission to test it :)
-
Now that is weird, can you try it without any extra addon/mod active?
-
It works fine in vanilla armed assault.
-
Could someone re-upload this resource please? The link in the very first post leads to a 404 page.