Jump to content
Sign in to follow this  
nullsystems

Disabling vehicle movement...

Recommended Posts

Hi all,

Just a quick thought really...

What would be the best way to disable a MP, player controlled vehicle from moving?

For instance:

The vehicle is on, moving and with fuel.

How could you stop the vehicle moving ( not using setvelocity since its a dead stop ) ?

Ive removed the fuel, but you get that pesky " low on fuel " message.

Any thoughts? smile_o.gif

Share this post


Link to post
Share on other sites

Though a grenade at the tires, put a satchel not on the road but off to the side to it disables the vehicle.

Why do you want to do that, Becuase you could add the mine script to the mission and have a anti-tank/car mine on the road to disable it. made by Kronzy.

Share this post


Link to post
Share on other sites

A neat trick you can use with setvelocity without making it a dead stop is simply multiplying the previous velocity by a multipler less then 1.

For example

while {condition} do

{

Vehicle setVelocity

[

(velocity Vehicle select 0) * 0.75,

(velocity Vehicle select 1) * 0.75,

(velocity Vehicle select 2) * 0.75

];

sleep 0.01;

};

With a little tinkering with the multiplier and delay, you can get the exact effect you're looking for.

The above example will take 1/4 of the vehicles speed away every hundredth of a second.

Share this post


Link to post
Share on other sites

lol Matt, I dont want to obliterate the thing, just slow it down to stop. Then allow it to regain full control again after a period of time, im going to try the above example and get back to you.

Thanks guys wink_o.gif

Share this post


Link to post
Share on other sites

I realize that this is an old topic but I too would like to submit a question within this thread.

Im trying to create a cutscene that temporarily setposes the original helicopter out of the cutscene while replacing it with another that will continue flying its course. I setpos the original chopper setvelocity to [0,0,0] flyinheight at 40 (as I am going to reinsert the original heli with player when I am done with the replacement) and all works fine except that when I make the change and the cutscene takes over, control is removed from the original and whatever direction or turn on the axis it was in the process of performing, it continues to turn untill it pretty much is upside down and plummets to the ground. I need it to completely stop movement of any kind. Any ideas on how to do this?

EDIT: I figured out that its setvectorup  [0,0,1] followed  with setvelocity but it still insists on rolling the thing over even after I've attempted the commands repeatedly. It seems the only way to counter the roll is to move the uncontrolled player pilot out and an AI pilot in his place which counters the rotation but he doesnt want to fly the heli for long. He flies it to the ground and gets out. Any ideas would still be much appreciated. Thanks guys

Final edit: I got an answer to this at the LOL clan forum by the ever so helpful Mr. Peanut. I have not tried it yet but I'll post it for others anyways.

First he suggested using setvectorup [0,1,0] with the other command as this will stop the rotation by forcing the heli to face east.

He went further and provided an .sqf

executed by this line......

Code:

nul = [MyHeli, 10] execVM "freezeheli.sqf";

followed by this in a called script..............

"freezeheli.sqf "

Code:

_heli = _this select 0;

_duration = _this select 1;

_up = getVectorUp _heli;

_dir = getVectorDir _heli;

_pos = getPos _heli;

_start = time;

while {time - _start < _duration} do

{

_heli setVectorUp _up;

_heli setVectorDir _dir;

_heli setVelocity [0,0,0];

_heli setPos _pos;

sleep 0.2;

};

Hope this helps someone else in the future

Happy Editing my fellow addicts

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×