Announcement

Collapse
No announcement yet.

HALO script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [GUIDE] HALO script

    We have been using Ghost's halo script whenever we need one. In this script your backpack contents are saved and then once you are on the ground you have everything back. Also there is no delay between HALOs... YOu can halo anytime and as many times. So I edited the script to do what I want its behavior to be. A HALO is a convenience. But for this convenience, there should be a price. The following script does the following to the HALO we all know:
    • Limits a player to jump every certain seconds. For example, you have to wait thirty minutes before being able to jump again. Along with revive, teamplayers should not be hindered by this, while lonewolfers should be encouraged to stick to a team. (Rudolf gave me this idea a few months back... Just now it is getting implemented.)
    • You need a parachute on your back to do the jump. This is more like a price a soldier must pay to use this convenient fast travel. This means no backpack.


    I am open to suggestions. I might change it back if the backlash is heavy from the players or if when playtesting, the restrictions are too harsh. I welcome feedback also. I have been editing Occupation. This script will debut with that mission.


    Code:
    //initPlayLocal.sqf   ; halo is the object name in the editor. TG_fnc_halo is the function name comiled in CFGfunctions
    halo addAction ["<t size='1.5' shadow='2' color='#00ffff'>HALO</t> <img size='4' color='#00ffff' shadow='2' image='\A3\Air_F_Beta\Parachute_01\Data\UI\Portrait_Parachute_01_CA.paa'/>", "call TG_fnc_halo", nil, 5, true, true, "","alive _target"];
    Code:
    /*
    V1.3.5 Script by: Ghost put this in an objects init line - ghst_halo = host1 addAction ["Halo", "ghst_halo.sqf", 6, true, true, "","alive _target"];
    */
    
    _host = _this select 0;
    _caller = _this select 1;
    _id = _this select 2;
    _althalo = 3000; //altitude of halo jump
    _timeout = 300;	//change to 30 minutes.
    
    _elapsedTime = 86400; //24 hours
    
    if (not alive _host) 												exitwith {hint "Halo Not Available"; _host removeaction _id;};
    
    //special case: first time halo
    if !(isNil {_caller getVariable "HALO_last_time"}) then 
    {
    	_lastTime 		= _caller getVariable "HALO_last_time";
    	_elapsedTime 	= time - _lasttime;	
    };
    
    if (_elapsedTime < _timeout) exitWith {_caller groupchat format["Next HALO flight will be ready in %1 seconds.", (round(_timeout - _elapsedTime))];};
    if (not ("B_Parachute" == typeOf (unitBackpack _caller))) 	exitwith {_caller groupchat "You will need a parachute to HALO.";};
    
    private ["_pos"];
    _caller groupchat "Left click on the map where you want to insert";
    openMap true;
    mapclick = false;
    onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """";true;";
    waituntil {mapclick or !(visiblemap)};
    
    if !(visibleMap) exitwith {_caller groupchat "Im too scared to jump";};
    
    _pos = clickpos;
    
    _caller setpos [_pos select 0, _pos select 1, _althalo];
    _caller spawn bis_fnc_halo;		
    
    openMap false;
    
    [_caller] spawn bis_fnc_halo;
    
    sleep 5;
    
    _caller groupchat "Dont forget to open your chute!";
    
    _caller setVariable ["HALO_last_time", time];


  • #2
    Re: HALO script

    I like the Halo cooling of period as a concept! I'll let you know more once I have to live with it :)

    I'm not crazy about the no backpack. that kills it as an option for Medics, Engineers, and AT troops. You CAN'T carry a medkit/toolkit/missle in your vest. Now if BIS would introduce those TARDIS vests I've been asking for...

    Comment


    • #3
      Re: HALO script

      I like the no backpack idea, it keeps us to using halo more as a reinforcement for JIP's and it allows for the ordinary supply drops instead of one guy jumping in with 100 mags on his back - promoting transport and logistics as being advantageous in terms of firepower

      I do admit it's a shame about medkit/toolkit but we can live without those since we have first aid kits

      cooldown I don't care what it's set to
      - Current ArmA Pathfinder

      sigpic

      Comment


      • #4
        Re: HALO script

        I'd love to see an option for the mission commander/admin to "order" HALO or suspend HALO operations. No more pubbies raining down on your stealthy approach!

        Is it possible to get the markers that players put on the map and use those as "allowable" DZs? Lets say only CO, XO, Squad Leads can set DZs?
        |TG-189th| Unkl
        ArmA 3 Game Officer
        Dean of Tactical Gamer University
        189th Infantry Brigade Member
        SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
        "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

        Comment


        • #5
          Re: HALO script

          Timeout, if pilot in the server, no go.

          Future: If pilot in the server, require parachute, or require group jump.

          Code:
          /*
          V1.3.5 Script by: Ghost put this in an objects init line - ghst_halo = host1 addAction ["Halo", "ghst_halo.sqf", [(true,false),2500], 6, true, true, "","alive _target"];
          */
          
          _host = _this select 0;
          _caller = _this select 1;
          _id = _this select 2;
          _althalo = 1000;//altitude of halo jump
          _altchute = 60;//altitude for autochute deployment
          _params = [];
          _saveLoadOut = [_params, 3, false, [true]] call BIS_fnc_param;//save loadout
          
          _elapsedTime = 86400; //24 hours
          _timeout = 600;	//change to 20 minutes.
          
          if (not alive _host) exitwith {
          hint "Halo Not Available"; 
          _host removeaction _id;
          };
          
          //special case: first time halo
          if !(isNil {_caller getVariable "HALO_last_time"}) then 
          {
          	_lastTime 		= _caller getVariable "HALO_last_time";
          	_elapsedTime 	= time - _lasttime;	
          };
          
          if (_elapsedTime < _timeout) exitWith {_caller groupchat format["Next HALO flight will be ready in %1 seconds.", (round(_timeout - _elapsedTime))];};
          if ({typeOf _x IN ["B_Helipilot_F"]} count (playableUnits + switchableUnits) > 0) exitWith {_caller groupchat "HALO is not available if there is a human player slotted in as a dedicated pilot.";};
          
          
          //save the backpack and its contents, also adds fake pack to front of unit
          //[_saveLoadOut,_caller] spawn ghst_halo_ventralpack;
          ghst_halo_ventralpack = {
          
          	private ["_saveLoadOut","_caller","_altitude","_pack","_packclass","_magazines","_weapons","_items","_helmet","_packHolder"];
          	
          	_saveLoadOut = _this select 0;
          	_caller = _this select 1;
          	//_altitude = (getpos _caller select 2);
          	_helmet = headgear _caller;
          
          	if (_saveLoadOut and !(isnull (unitBackpack _caller)) and ((backpack _caller) != "b_parachute")) then {
          		_pack = unitBackpack _caller;
          		_packclass = typeOf _pack;
          		_magazines = getMagazineCargo _pack;
          		_weapons = getWeaponCargo _pack;
          		_items = getItemCargo _pack;
          
          		//if ((_altitude > 3040) and (_helmet != "H_CrewHelmetHeli_B")) then {
          		if (_helmet != "H_CrewHelmetHeli_B") then {
          			//(unitBackpack _caller) addItemCargoGlobal [_helmet, 1]
          			_caller addHeadGear "H_CrewHelmetHeli_B";//add "halo" headgear
          		};
          
          		removeBackpack _caller; //remove the backpack
          		_caller addBackpack "b_parachute"; //add the parachute
          
          		_packHolder = createVehicle ["groundWeaponHolder", [0,0,0], [], 0, "can_collide"];
          		_packHolder addBackpackCargoGlobal [_packclass, 1];
          
          		waitUntil {animationState _caller == "HaloFreeFall_non"};
          		_packHolder attachTo [_caller,[-0.12,-0.02,-0.74],"pelvis"]; 
          		_packHolder setVectorDirAndUp [[0,-1,-0.05],[0,0,-1]];
          
          		waitUntil {animationState _caller == "para_pilot"};
          		_packHolder attachTo [vehicle _caller,[-0.07,0.67,-0.13],"pelvis"]; 
          		_packHolder setVectorDirAndUp [[0,-0.2,-1],[0,1,0]];
          
          		waitUntil {isTouchingGround _caller || (getPos _caller select 2) < 1};
          		detach _packHolder;
          		deleteVehicle _packHolder; //delete the backpack in front
          
          		_pack = unitBackpack _caller;
          		removeBackpack _caller; //remove the backpack
          		deletevehicle _pack;
          		_caller addBackpack _packclass; //return the backpack
          		clearAllItemsFromBackpack _caller; //clear all gear from new backpack
          
          		for "_i" from 0 to (count (_magazines select 0) - 1) do {
          		(unitBackpack _caller) addMagazineCargoGlobal [(_magazines select 0) select _i,(_magazines select 1) select _i]; //return the magazines
          		};
          		for "_i" from 0 to (count (_weapons select 0) - 1) do {
          		(unitBackpack _caller) addWeaponCargoGlobal [(_weapons select 0) select _i,(_weapons select 1) select _i]; //return the weapons
          		};
          		for "_i" from 0 to (count (_items select 0) - 1) do {
          		(unitBackpack _caller) addItemCargoGlobal [(_items select 0) select _i,(_items select 1) select _i]; //return the items
          		};
          
          		if !(isnil "_helmet") then {
          		_caller addHeadGear _helmet;//add back original headgear
          		};
          	};/* else {
          		if ((backpack _caller) != "b_parachute") then {_caller addBackpack "B_parachute"}; //add the parachute if unit has no backpack
          		if ((headgear _caller) != "H_CrewHelmetHeli_B") then {
          			//(unitBackpack _caller) addItemCargoGlobal [_helmet, 1]
          			_caller addHeadGear "H_CrewHelmetHeli_B";//add "halo" headgear
          		};
          		waitUntil {isTouchingGround _caller || (getPos _caller select 2) < 1};
          		_pack = unitBackpack _caller;
          		removeBackpack _caller; //remove the backpack
          		deletevehicle _pack;
          		if !(isnil "_helmet") then {
          		_caller addHeadGear _helmet;//add back original headgear
          		};
          	};*/
          };
          
          private ["_pos"];
          _caller groupchat "Left click on the map where you want to insert";
          openMap true;
          mapclick = false;
          onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """";true;";
          waituntil {mapclick or !(visiblemap)};
          
          if !(visibleMap) exitwith {_caller groupchat "HALO cancelled.";};
          _pos = clickpos;
          
          
          _caller setpos [_pos select 0, _pos select 1, _althalo];
          _caller spawn bis_fnc_halo;
          [_saveLoadOut,_caller] spawn ghst_halo_ventralpack;
          
          
          if (getpos _caller select 2 > (_altchute + 100)) then {
          sleep 1;
          
          [_caller] spawn bis_fnc_halo;
          
          openMap false;
          
          _bis_fnc_halo_action = _caller addaction ["<t size='1.5' shadow='2' color='#ff0000'>Open Chute</t> <img size='3' color='#ff0000' shadow='2' image='\A3\Air_F_Beta\Parachute_01\Data\UI\Portrait_Parachute_01_CA.paa'/>","A3\functions_f\misc\fn_HALO.sqf",[],1,false,true,"Eject"];
          
          sleep 5;
          
          _caller groupchat "Have a nice trip";// and dont forget to open your chute!";
          _caller setVariable ["HALO_last_time", time];
          
          //auto open before impact
          waituntil {(position _caller select 2) <= _altchute};
          
          _caller removeaction _bis_fnc_halo_action;
          
          if !((vehicle _caller) iskindof "ParachuteBase") then {
          
          	_caller groupchat "Deploying Chute";
          
          	[_caller] spawn bis_fnc_halo;
          
          };
          waituntil {(position _caller select 2) < 1.5};
          deletevehicle (vehicle _caller);
          _caller switchmove "AmovPercMstpSrasWrflDnon";
          _caller setvelocity [0,0,0];
          };

          Comment

          Connect

          Collapse

          TeamSpeak 3 Server

          Collapse

          Advertisement

          Collapse

          Twitter Feed

          Collapse

          Working...
          X