How to use the Airfield Support Tug: Difference between revisions

From RKSL Studios Knowledgebase
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 29: Line 29:
=== Config values for a vehicle that can tow other vehicles ===
=== Config values for a vehicle that can tow other vehicles ===


'''LESH_canTow = 1;''' //stomper example - This one is pretty obvious. If this is missing or not equal to 1 the vehicle will be unable to perform towing.
'''LESH_AxisOffsetTower[] = {0.43,-3,-0.94};''' //stomper example - This is the model space coordinates [x,y,z] for an arbitrary point at which point any potential towable vehicle is "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle as well as approximately 1m in altitude above ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model. This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.
=== Config values for a vehicle that can be towed by other vehicles ===


'''LESH_canTow = 1;''' //stomper example
This one is pretty obvious. If this is missing or not equal to 1 the vehicle will be unable to perform towing.
<br>'''LESH_AxisOffsetTower[] = {0.43,-3,-0.94};''' //stomper example
This is the model space coordinates [x,y,z] for an arbitrary point at which point any potential towable vehicle is "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle
as well as approximately 1m in altitude above ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model.
This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.
=== Config values for a vehicle that can be towed by other vehicles ===




'''LESH_canBeTowed = 1;''' //buzzard example - Again pretty self-explanatory. This is the first thing checked when someone tries to tow something by pressing the keybind. If not 1 or missing the vehicle will not be a valid target to be towed


'''LESH_canBeTowed = 1;''' //buzzard example
'''LESH_towFromFront = 1;''' //buzzard example
Again pretty self-explanatory. This is the first thing checked when someone tries to tow something by pressing the keybind. If not 1 or missing the vehicle will not be a valid target to be towed
This is incase you have a vehicle that is towed from the back. If the value is 1 then all directions and speeds are unchanged. If 0 or missing all directions and velocities used are reversed (which would equal being towed from behind)
<br>'''LESH_AxisOffsetTarget[] = {0,6.8,-1.4};''' //buzzard example
<br>'''LESH_towFromFront = 1;''' //buzzard example
This is the model space coordinates [x,y,z] for an arbitrary point at which any vehicle that can tow will be "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle
This is incase you have a vehicle that is towed from the back. If the value is 1 then all directions and speeds are unchanged. If 0 or missing all directions and velocities used are reversed (which would equal being towed from behind)
as well as approximately 1m in altitude above the ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model.
This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.
<br>'''LESH_AxisOffsetTarget[] = {0,6.8,-1.4};''' //buzzard example
This is the model space coordinates [x,y,z] for an arbitrary point at which any vehicle that can tow will be "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle
as well as approximately 1m in altitude above the ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model.
This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.


'''LESH_WheelOffset[] = {0,1.6}; '''//buzzard example
'''LESH_WheelOffset[] = {0,1.6}; '''//buzzard example - This is the model space coordinates [x,y] for the wheel axis around which the target vehicle will rotate when it is being towed. Usually on the opposite side of the model compared to the AxisOffset.
This is the model space coordinates [x,y] for the wheel axis around which the target vehicle will rotate when it is being towed. Usually on the opposite side of the model compared to the AxisOffset.
== How to add configs to a vehicle in a mission: ==
== How to add configs to a vehicle in a mission: ==


Line 65: Line 54:
  this setVariable ["LESH_AxisOffsetTarget", [0,4.5,-0.8]]; // the point at which the tow ball will appear and where the attachment point will be in model space coordinates
  this setVariable ["LESH_AxisOffsetTarget", [0,4.5,-0.8]]; // the point at which the tow ball will appear and where the attachment point will be in model space coordinates
  this setVariable ["LESH_WheelOffset", [0,-1.5]]; // the point around which the towed vehicle is rotated when making turns. should be aligned with the center of the rear axis
  this setVariable ["LESH_WheelOffset", [0,-1.5]]; // the point around which the towed vehicle is rotated when making turns. should be aligned with the center of the rear axis
Or if you wish a vehicle to be able to tow
Or if you wish a vehicle to be able to tow
  this setVariable ["LESH_canTow", 1]; // a flag to determine if the vehicle can tow 1/0
  this setVariable ["LESH_canTow", 1]; // a flag to determine if the vehicle can tow 1/0
  this setVariable ["LESH_AxisOffsetTower", [0.43,-3,-0.94]]; // the connection point of the towing vehicle in model space coordinates
  this setVariable ["LESH_AxisOffsetTower", [0.43,-3,-0.94]]; // the connection point of the towing vehicle in model space coordinates
Or during runtime just replace "this" above with the variable for the vehicle.
'''Note:''' These values need to be globally applied in order for them to work on all machines.


Or during runtime just replace "this" above with the variable for the vehicle. Note: these values need to be globally applied in order for them to work on all machines,
[[Category:Airfield_Support_Tug]]

Latest revision as of 14:52, 23 January 2024

The following is taken from Lesh's Readme file.

Lesh's Tow mod allows for towing of vehicles by other vehicles.

For towing to work, both the towed vehicle and the towing vehicle need to be preconfigured with the correct config parameters in the vehicle class. The mod has most vanilla planes and helicopters configured and ready to go. Currently in vanilla only the UGV is capable of towing. Additionally the mod has a few optional configurations for various modded assets if you wish to use them.

How to use:

To initiate towing you need to drive the towing vehicle into position infront (or behind depending on the vehicle you want to tow) the target vehicle. Once in position you press Shift+B to start the towing action. If you are too far away from the intended point 2 guide spheres will appear for several seconds. 1 attached to both vehicles. Once you line them up (within 1m of eachother) the towing can commence by pressing Shift+B While towing you can press Shift+B at any time to stop towing. If for some reason either vehicle is destroyed or the distance between them grows too large the towing will cease. Otherwise towing will continue until you stop it with Shift+B.

Control Keys

Shift+B - Starts and Stops towing. Can be reconfigured in-game using the "configure addons" under keybindings.
Shift+Ctrl+B - Toggles speedlimiter while towing

Known Issues:

Choppers take damage at higher speeds if you disable the speed limiter In Multiplayer when towing someone else it might look a bit teleporty, bandwith and server settings can be used to lessen the effect. There is a small chance of hitdetection detecting a collision and making a boom. so try to tow only empty vehicles for the best results

The mod is largely untested in many many scenarios and might exhibit unexpected behaviour. Due to the implementation, gravity doesn't act normally on the towed vehicle which might lead to interesting edge cases around areas where ground level changes quickly or dramatically. While connected to an UGV you can't use other vehicles to tow as the UGV always takes precedence. To avoid this just disconnect from the UGV. Optional configuration don't require their host mod which might result in errors if used without.

For Modders:

Config values for a vehicle that can tow other vehicles

LESH_canTow = 1; //stomper example - This one is pretty obvious. If this is missing or not equal to 1 the vehicle will be unable to perform towing. LESH_AxisOffsetTower[] = {0.43,-3,-0.94}; //stomper example - This is the model space coordinates [x,y,z] for an arbitrary point at which point any potential towable vehicle is "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle as well as approximately 1m in altitude above ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model. This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.

Config values for a vehicle that can be towed by other vehicles

LESH_canBeTowed = 1; //buzzard example - Again pretty self-explanatory. This is the first thing checked when someone tries to tow something by pressing the keybind. If not 1 or missing the vehicle will not be a valid target to be towed

LESH_towFromFront = 1; //buzzard example This is incase you have a vehicle that is towed from the back. If the value is 1 then all directions and speeds are unchanged. If 0 or missing all directions and velocities used are reversed (which would equal being towed from behind)
LESH_AxisOffsetTarget[] = {0,6.8,-1.4}; //buzzard example This is the model space coordinates [x,y,z] for an arbitrary point at which any vehicle that can tow will be "attached". It is best if the coordinates result in a point that is slightly outside the bounding box of the vehicle as well as approximately 1m in altitude above the ground when the coordinates are transferred to world space. Or in other words that it is 1m higher than the ground contact points of the model. This is also the point at which the orange sphere will appear when you attempt towing and you are out of range.

LESH_WheelOffset[] = {0,1.6}; //buzzard example - This is the model space coordinates [x,y] for the wheel axis around which the target vehicle will rotate when it is being towed. Usually on the opposite side of the model compared to the AxisOffset.

How to add configs to a vehicle in a mission:

If you use the editor init field you can place the following lines with the correct numbers to allow towing

this setVariable ["LESH_canBeTowed", 1]; // needs to be 1 if you want to tow the vehicle
this setVariable ["LESH_towFromFront", 1]; // 1 for towing from front, 0 for towing from back
this setVariable ["LESH_AxisOffsetTarget", [0,4.5,-0.8]]; // the point at which the tow ball will appear and where the attachment point will be in model space coordinates
this setVariable ["LESH_WheelOffset", [0,-1.5]]; // the point around which the towed vehicle is rotated when making turns. should be aligned with the center of the rear axis

Or if you wish a vehicle to be able to tow

this setVariable ["LESH_canTow", 1]; // a flag to determine if the vehicle can tow 1/0
this setVariable ["LESH_AxisOffsetTower", [0.43,-3,-0.94]]; // the connection point of the towing vehicle in model space coordinates

Or during runtime just replace "this" above with the variable for the vehicle.

Note: These values need to be globally applied in order for them to work on all machines.