My maths is appaling, so i would appreciate any help offered
Thx in advance
What i am trying to do is
Simulate winching a vehicle from a recovery vehicle
the particular part i am stuck with is the small incremental setdir loop that slowly turns the target vehicle to the direction of the recovery vehicle
lets play make believe
The recovery vehicle backs up (reverses) to the target vehicle
The target vehicle could be facing any direction
now what i want is for system to auto decide whether
A) the rear of the target vehicleor
B) The front, should be pulled by the make believe winching rope
and this to be defined by which end of the target vehicle is closer to the angle of the getdir of the recovery vehicle
(eg winch ropes pull, they dont push)
Once the target vehicle is roughly the same direction as the recovery vehicle, i then want to setpos it, or setvelocity it, so that the effect looks like the target vehicle is being dragged towards the recovery vehicle by the winch rope
dont worry about any other parts of the script, its just the maths bit i am stuck on
heres the rough layout
Take it that
_v is the recovery vehicle
and
_obj is the target vehicle
winch rope length = 50m
dragging speed is 1m per second
if possible it would be nice to redefine the rope length and dragging speed so a variable in there for each would be nice
#TURN_LOOP
;; dont loop faster than 0.1 seconds (its for an mp system)
~0.1
;; this loop for turning the target vehicle to face the recovery vehicle
;;once the turn process has completed, then skip the goto Turn_Loop
#DRAG LOOP
;; this loop for dragging the target vehicle towards the recovery vehicle
Hope i aint asking too much in 1 go The initial reason for this system is to reset an overturned vehicle onto its wheels, or tracks
My understanding is that, as soon as you use setdir or setpos, it will jump back onto its feet.
If by some chance, a setvelocity or some other command, can actually drag it along on its side for a bit before it jumps to its feet, that would be fantastic
(Not related to the question)
The whole system works on addaction commands attached to the recovery vehicle that the driver of the vehicle, can initiate
eg
Addaction =Recover vehicle
......Sub addaction menu..Winch Out
......Sub addaction menu..Winch In
......Sub addaction menu....Stop winching
and a drop command around the target vehicle when the winching first starts up to throw a bit of dust around