Heh, yeah, sorry, I made some fatal mistakes there
Now that I've got OFP with me though, I could empirically test my horrible autrocity. In the original, only the car would shoot off
And, the speed was all too slow, which made the whole thing look...awful
Any case, here's the new version:
;this determines the unit triggering the action, and the vehicle of the unit
_car=_this select 0
;checks who in the crew is the Player
_i=0
_j=count crew _car
#PlayerCheck
?crew _car select _i==Player: _ejector= crew _car select _i ; goto "Start"
~0.1
_i=_i+1
?_j==_i : hint "Error: Player not in vehicle; exit
goto "PlayerCheck"
#Start
;this gives the ejector an initial height of 5 m above the designated vehicle (change this to whatever you want)
_ejector action ["EJECT", _car]
_ejector setpos [(getpos _car select 0), (getpos _car select 1), 5]
;this is a gradual gain in height, going at a speed of 2 m /0.01 seconds (200m/second). change this by chanding the _height variable or by lessening the speed. When reached 100 meters, the parachute opens (change this as you see fit)
#HeightGain
?getpos _ejector select 2>100 : goto "Parachute"
_height=(getpos _ejector select 2) +2
~0.01
_ejector setpos [(getpos _ejector select 0), (getpos _ejector select 1), _height]
goto "HeightGain"
;a parachute is created and the ejector is moved into it
#Parachute
_para="Parachute" CamCreate getpos _ejector
_ejector moveInDriver _para
exit
Right, so, my suggestion on how to work this:
Make your car, name it...whatever, CAR for instance. Then, make a trigger, a/b=0, Repeatedly, type: Switch.
Condition: Player in CAR
on Activation: ActionID=CAR addAction ["Ejector Seat", "ejectseat.sqs"]
on Deactivation: CAR removeAction ActionID
Now, whenever you enter the car, the action will be added TO THE CAR (and thus accessable by you). And, when you leave the car, it's removed (so you can't start whoosing off outside of it....). Easy peasy. Now, this is tested, so it damned well should work! I even made it so that only the player gets ejected (i.e, you can have other passangers but they won't go anywhere). All in all a workable script, I think.
If you still find some bugs I somehow missed, please complain
Wolfrug out.