Jump to content
Sign in to follow this  

Recommended Posts

Hey guys

I was just wondering if any one knew how i could add a boost to the vehicles in ArmA 2 by using a simple init line?

Also i was wondering if any one knew how i could make the vehicles so they dont change speed when you go over different terrain again using a simple init line if possible.

Thanks in advance

RealPlay

Share this post


Link to post
Share on other sites

1]

I don't think this is possible.

You will need to change the vehicle config for this (or at least script something?)

2]

I don't know anything about this but I think this is something in the game and not in the

config of the vehicle itself.

Share this post


Link to post
Share on other sites

Rather then a boost i went for sustained speed, i found this script in a mission on armaholic, the only issue with it is that it disables the breaks, not good when trying to drive.

#define SPEEDX 0.1

while {true} do {
sleep 0.001;
if(vehicle player != player) then {
	_veh = vehicle player;

	if (speed _veh > 20) then {
		_vel = velocity _veh;
		_dir = getdir _veh;
		_veh setvelocity [
			(((_vel select 0) + SPEEDX * (sin _dir)) min 200) max -200,
			(((_vel select 1) + SPEEDX * (cos _dir)) min 200) max -200,
			(_vel select 2) - SPEEDX
		];
	};
};
};

anyone got any ideas how i can re-enable the breaks?

Another question, how can i disable a script using a trigger?

Edited by UKrealplayER666

Share this post


Link to post
Share on other sites

You could check to see if the brake key is being pressed and if so change a variable that shuts down the velocity part.

Brake key for me is "S"

save as init.sqf

disableSerialization;
sleep 1;
brake = 0;
_display = (findDisplay 46);
_display displayAddEventHandler ["KeyDown","if ((_this select 1) == 31) then {brake = 1} else {brake = 0}"];

modified code to check for the brake variable.

#define SPEEDX 0.1
quit_this = true;
while {quit_this} do {
sleep 0.001;
if (vehicle player != player) then {
	_veh = vehicle player;

	if (speed _veh > 20 and brake == 0  ) then {

		_vel = velocity _veh;
		_dir = getdir _veh;
		_veh setvelocity [
			(((_vel select 0) + SPEEDX * (sin _dir)) min 200) max -200,
			(((_vel select 1) + SPEEDX * (cos _dir)) min 200) max -200,
			(_vel select 2) - SPEEDX
		];
	};

};
};

also included is a variable named quit_this, if you now place this in a trigger and set it to false it should end the script

quit_this=false

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  

×