Results 1 to 5 of 5

Thread: Vehicle boost

  1. #1

    Vehicle boost

    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

  2. #2
    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.
    Five Combat reconnaissance [5CR]
    Lance Corporal

  3. #3
    First Sergeant cobra4v320's Avatar
    Join Date
    Mar 10 2009
    Location
    Seattle Washington
    Posts
    841
    Try this below placed into a radio trigger
    Code:
    tank setVelocity [sin (getdir tank) * 200, cos (getDir tank) * 200, 0];
    You might find this interesting.
    http://www.armaholic.com/page.php?id=15013

  4. #4
    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.

    Code:
    #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?
    Last edited by UKrealplayER666; Aug 30 2011 at 17:46.

  5. #5
    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
    Code:
    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.

    Code:
    #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

    Code:
    quit_this=false

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •