resistance-rat 10 Posted February 26, 2014 (edited) Hello everyone, I've got a problem with mission loading and driving a vehicle. Everytime I save the game, while driving a car and load it, car brakes itself, even if I'm holding E button. I tried to fix that with eventHandler, but setVelocity makes car unstable and undrivable for a while. addMissionEventHandler ["Loaded",{RESRAT_Car setVelocity [((velocity RESRAT_Car) select 0)+(sin (getDir RESRAT_Car)*20),((velocity RESRAT_Car) select 1)+(cos (getDir RESRAT_Car)*20), ((velocity RESRAT_Car) select 2)]}] Any suggestions, how to force car to do not brake? Edited February 26, 2014 by resistance-rat Share this post Link to post Share on other sites
KC Grimes 79 Posted February 27, 2014 If this is happening on mission load, as in loading of a saved game, I don't see a way to script that reasonably. Play with your keys a bit, I'm sure theres a work around. I'll bet jamming W will do the trick. Share this post Link to post Share on other sites
f2k sel 164 Posted February 27, 2014 I've never used addMissionEventHandler ["Loaded",{ but I did test you code in a trigger and it is a bit jerky. The issue seems to be that you forcing a fixed speed on the vehicle all at once, basically just giving it a kick up the backside. You could try to smooth it out by placing it in a loop and apply a smaller force over a period of time. If you can save the original speed or retrieve it on reload you could do something like this. addMissionEventHandler ["Loaded",{ null=[] spawn {acc = 0.3;sleep 1; while { speed RESRAT_Car <40} do {sleep 0.01; RESRAT_Car setVelocity [((velocity RESRAT_Car) select 0)+(sin (getDir RESRAT_Car)*acc),((velocity RESRAT_Car) select 1)+(cos (getDir RESRAT_Car)*acc),((velocity RESRAT_Car) select 2)];};}; };]; I've used 40 as default speed but as said it would be better if you could retrieve pre saved speed so the script will force the car to that speed. Share this post Link to post Share on other sites
resistance-rat 10 Posted February 28, 2014 Thanks, will check that out :) Share this post Link to post Share on other sites