Jump to content
Sign in to follow this  
callihn

Have chopper fly away after halo jump?

Recommended Posts

Is it possible to have the halo fly away after the jump?

I'm trying to adapt this script:

_StartLocation = _this select 0;

#include "x_setup.sqf"

#include "x_macros.sqf"

if (d_para_timer_base > 0) then {

d_next_jump_time = time + d_para_timer_base;

};

#ifndef __ACE__

_jump_helo = "CH_47F_EP1";

if (playerSide == east) then {

_jump_helo = "Mi17_rockets_RU";

};

#endif

#ifdef __ACE__

_jump_helo = "ACE_UH60MG_M240C";

if (playerSide == east) then {

_jump_helo = "ACE_Mi17_MG";

};

#endif

titleText ["","Plain"];

bird = createVehicle [_jump_helo, _StartLocation, [], 0, "FLY"];

bird setpos [_StartLocation select 0,_StartLocation select 1, d_halo_height];

bird engineon true;

player moveInCargo [bird,6];

sleep 1;

_obj_jump = player;

if(vehicle player == player)exitWith {};

#ifndef __ACE__

_obj_jump setvelocity [0,0,0];

_obj_jump action["EJECT",vehicle _obj_jump];

if (vehicle _obj_jump isKindOf "ParachuteBase") then {

_vec = vehicle _obj_jump;

_obj_jump action["EJECT",vehicle _obj_jump];

};

[_obj_jump, _obj_jump call XfGetHeight] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

sleep 1;

deleteVehicle _vec;

sleep 3;

deleteVehicle bird;

if ("AI" in d_version) then {

if (alive player) then {

[position player, velocity player, direction player] execVM "x_scripts\x_moveai.sqf";

};

};

if (true) exitWith {};

#endif

#ifdef __ACE__

/*if (!(_obj_jump hasWeapon "ACE_ParachutePack")) then {

_obj_jump addWeapon "ACE_ParachutePack";

};*/

[bird,_obj_jump] execVM "\ace_sys_eject\s\ace_jumpout.sqf";

sleep 3;

deleteVehicle bird;

if ("AI" in d_version) then {

if (alive player) then {

[position player, velocity player, direction player] execVM "x_scripts\x_moveai.sqf";

};

};

if (true) exitWith {};

#endif

I'm wanting to increase the wait before the eject and then have the chopper fly off into the distance before deleting, but right now if you stay in it very long or delay the delete it just heads for the ground. :(

Share this post


Link to post
Share on other sites

/me runs off into the woods after uttering thanks and grabbing an abandoned hint.

Seriously, the whole point of my post is so I can learn how to do something I'm obviously not familiar with, wouldn't I have to create an AI before I move it in?

/me runs out of the woods, grabs a Biki left by an abandoned campfire and runs back into the darkness.

Edited by callihn

Share this post


Link to post
Share on other sites

Take a look at the Parachute Bootcamp mission, that includes a vehicle flying away trick.

Share this post


Link to post
Share on other sites

Here is what I used for "Combat Jump"; deals with creating a pilot and a moving C130J:

_StartLocation = _this select 0;

#include "x_setup.sqf"
#include "x_macros.sqf"

_pos1 = getMarkerPos "jump_marker_1";
_pos2 = (if (current_mission_index != -1) then {getMarkerPos "jump_marker_2"} else {[-10000,-10000]});
if (_StartLocation distance _pos1 > _StartLocation distance _pos2) then {_pos1 = _pos2};

_dir = ((_StartLocation select 0) - (_pos1 select 0)) atan2 ((_StartLocation select 1) - (_pos1 select 1));
_dir = _dir + 180;
if(_dir < 0) then {_dir = _dir + 360};

if (_StartLocation distance getMarkerPos "jump_marker_1" < 2000) exitWith {["You can't do a Combat Jump within 2000 meters of the current main target, for the aircrafts safety!", "SIDE"] call XHintChatMsg};
if (current_mission_index != -1 && _StartLocation distance getMarkerPos "jump_marker_2" < 1500) exitWith {["You can't do a Combat Jump within 1500 meters of the current side mission, for the aircrafts safety!", "SIDE"] call XHintChatMsg};
deleteMarkerLocal "jump_marker_1"; deleteMarkerLocal "jump_marker_2";

if (d_para_timer_base > 0) then {
d_next_jump_time = time + d_para_timer_base;
};

// #ifndef __ACE__
_jump_helo = "C130J_US_EP1";
if (playerSide == east) then {
_jump_helo = "Mi17_rockets_RU";
};
// #endif
// #ifdef __ACE__
// _jump_helo = "ACE_UH60MG_M240C";
// if (playerSide == east) then {
// _jump_helo = "ACE_Mi17_MG";
// };
// #endif

#ifdef __ACE__
if (player hasWeapon "ACE_ParachuteRoundPack") then {
player removeWeapon "ACE_ParachuteRoundPack";
};
#endif


titleText ["","Plain"];

_dummygroup = createGroup west;
"US_Soldier_Pilot_EP1" createUnit [[0,0,0], _dummygroup, "pilot = this"];
pilot setCaptive true; pilot setCombatMode blue; pilot setBehaviour "CARELESS";

_vehicle = createVehicle [_jump_helo, _StartLocation, [], 0, "FLY"];
_vehicle setPos [_StartLocation select 0, _StartLocation select 1, 200]; //150 often doesnt work, although sometimes a combat jump is even lower than that
_vehicle setDir _dir;
_vehicle setVelocity [sin _dir*50,cos _dir*50,0];

_vehicle engineOn true;
sleep 0.1;
[_vehicle] spawn {(_this select 0) animate ["ramp_top",1]; (_this select 0) animate ["ramp_bottom",1];};

_li = "#lightpoint" createVehicleLocal getpos _vehicle;
_li setLightBrightness 0.02;
_li setLightAmbient[0.8, 0.2, 0.2];
_li setLightColor[0.8, 0.2, 0.2];
_li lightAttachObject [_vehicle, [0,-2,-5]];

[_vehicle, 10, 0] call BIS_fnc_setPitchBank;

_xxx = [_vehicle] spawn {
_timer = time + 12;
while {!isNull (_this select 0)} do {
//		if !(vehicle player isKindOf "ParachuteBase") then {[_this select 0, 10, 0] call BIS_fnc_setPitchBank}; //force pitch up and zero bank until jump performed. AI drive these like idiots.
	sleep 0.012;
	if (time > _timer) then {deleteVehicle pilot; deleteVehicle (_this select 0); deleteGroup _dummygroup; _timer = nil;};
};
};
sleep 0.2;

//player moveInDriver _vehicle;
player moveInCargo [_vehicle, 6];
pilot moveInDriver _vehicle;
(vehicle pilot) doMove ((vehicle pilot) modelToWorld [0,1000,0]);

(vehicle pilot) vehicleChat "Get Ready to Jump";
sleep 3;
(vehicle pilot) vehicleChat "Green Light! Go go go!";
_li setLightAmbient[0.2, 0.6, 0.2];
_li setLightColor[0.2, 0.6, 0.2];
sleep 1;
[_vehicle] spawn {(_this select 0) animate ["ramp_top",0]; (_this select 0) animate ["ramp_bottom",0];};

if(vehicle player == player)exitWith {};
player action ["eject", _vehicle];
//ParachuteMediumWest_EP1
player setvelocity [0,0,0];
unassignVehicle player; //Just in case of weirdness.

sleep 5;
deleteVehicle _li;

waitUntil {((getPos (vehicle player) select 2) < 10)};
if (d_debug_mode) then {hint "debug: checking started"};
while {vehicle player isKindOf "ParachuteBase"} do {
sleep 10;
if (vehicle player isKindOf "ParachuteBase") then {
	player action ["EJECT",vehicle player];
	if (d_debug_mode) then {hint "debug: player ejected from parachute by force";};
	player setPos [getPos player select 0, getPos player select 1, 0];
} else {
	if (d_debug_mode) then {hint "debug: situation resolved itself without assistance needed";};
};
};
sleep 2;
if (vehicle pilot isKindOf "ParachuteBase") then {deleteVehicle (vehicle pilot); deleteVehicle pilot;}; //In case he bails out
if (alive pilot) then {deleteVehicle pilot};

if (true) exitWith {};

Just delete the stuff you don't need (this is for heavily modified Domination, so it may not work "as is"), or just grab what you do need, or just read and get ideas from it.

Or, a modified mission.fsm from the HALO Jump tutorial (in spoiler). This one deals with a static C130J where the moving one is activated once you bail, but it has a few changes from the original mission.fsm:

/*%FSM<COMPILE "H:\Program Files\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, mission">*/
/*%FSM<HEAD>*/
/*
item0[] = {"START",0,250,-375.000000,-1125.000000,-275.000000,-1075.000000,0.000000,"START"};
item1[] = {"Jump",4,218,-225.000000,-1125.000000,-125.000000,-1075.000000,0.000000,"Jump"};
item2[] = {"Switch_C_130",2,250,-100.000000,-1125.000000,0.000000,-1075.000000,0.000000,"Switch C-130"};
item3[] = {"Delay",4,218,-375.000000,-1050.000000,-275.000000,-1000.000000,0.000000,"Delay"};
item4[] = {"Shake_and_Pos",2,250,-375.000000,-975.000000,-275.000000,-925.000000,0.000000,"Shake and Pos"};
item5[] = {"Opened",4,218,-100.000000,-750.000000,0.000000,-700.000000,0.000000,"Opened"};
item6[] = {"Parachute",2,250,-100.000000,-675.000000,0.000000,-625.000000,0.000000,"Parachute"};
item7[] = {"Delay",4,218,-375.000000,-600.000000,-275.000000,-550.000000,0.000000,"Delay"};
item8[] = {"Open_Top",2,250,-375.000000,-375.000000,-275.000000,-325.000000,0.000000,"Open Top"};
item9[] = {"True",8,218,-100.000000,-1050.000000,0.000000,-1000.000000,0.000000,"True"};
item10[] = {"MFF",2,250,-100.000000,-975.000000,0.000000,-925.000000,0.000000,"MFF"};
item11[] = {"__00_meters____c",4,218,25.000000,-900.000000,125.000000,-850.000000,0.000000,"500 meters" \n "&& cadetMode"};
item12[] = {"Open_now_",2,250,25.000000,-825.000000,125.000000,-775.000000,0.000000,"Open now!"};
item13[] = {"Landed_OK",4,218,-100.000000,-600.000000,0.000000,-550.000000,1.000000,"Landed" \n "OK"};
item14[] = {"Landing",2,4346,-100.000000,-525.000000,0.000000,-475.000000,0.000000,"Landing"};
item15[] = {"Down",2,250,-100.000000,-375.000000,0.000000,-325.000000,0.000000,"Down"};
item16[] = {"END",1,250,-100.000000,-75.000000,0.000000,-25.000000,0.000000,"END"};
item17[] = {"Delay",4,218,-375.000000,-150.000000,-275.000000,-100.000000,0.000000,"Delay"};
item18[] = {"Green_Light_03_G",2,250,-375.000000,-75.000000,-275.000000,-25.000000,0.000000,"Green Light" \n "03_GetOutNow"};
item19[] = {"Red_Light_02_Get",2,250,-375.000000,-525.000000,-275.000000,-475.000000,0.000000,"Red Light" \n "02_GetReady"};
item20[] = {"Delay",4,218,-375.000000,-450.000000,-275.000000,-400.000000,0.000000,"Delay"};
item21[] = {"Delay",4,218,-375.000000,-900.000000,-275.000000,-850.000000,0.000000,"Delay"};
item22[] = {"Fade_in",2,250,-375.000000,-825.000000,-275.000000,-775.000000,0.000000,"Fade in"};
item23[] = {"",7,210,-179.000015,-54.000011,-170.999985,-45.999989,0.000000,""};
item24[] = {"Delay",4,218,-375.000000,-300.000000,-275.000000,-250.000000,0.000000,"Delay"};
item25[] = {"Opened",4,218,25.000000,-750.000000,125.000000,-700.000000,0.000000,"Opened"};
item26[] = {"Open_Bottom",2,250,-375.000000,-225.000000,-275.000000,-175.000000,0.000000,"Open Bottom"};
item27[] = {"Delay",4,218,-375.000000,-750.000000,-275.000000,-700.000000,0.000000,"Delay"};
item28[] = {"__1_OneMinute",2,250,-375.000000,-675.000000,-275.000000,-625.000000,0.000000,"01_OneMinute"};
item29[] = {"Delay",4,218,-100.000000,-450.000000,0.000000,-400.000000,0.000000,"Delay"};
item30[] = {"Delay",4,218,-100.000000,-150.000000,0.000000,-100.000000,0.000000,"Delay"};
link0[] = {0,3};
link1[] = {1,2};
link2[] = {2,9};
link3[] = {3,4};
link4[] = {4,21};
link5[] = {5,6};
link6[] = {6,13};
link7[] = {7,19};
link8[] = {8,24};
link9[] = {9,10};
link10[] = {10,5};
link11[] = {10,11};
link12[] = {11,12};
link13[] = {12,25};
link14[] = {13,14};
link15[] = {14,29};
link16[] = {15,30};
link17[] = {17,18};
link18[] = {18,23};
link19[] = {19,20};
link20[] = {20,8};
link21[] = {21,22};
link22[] = {22,27};
link23[] = {23,1};
link24[] = {24,26};
link25[] = {25,6};
link26[] = {26,17};
link27[] = {27,28};
link28[] = {28,7};
link29[] = {29,15};
link30[] = {30,16};
globals[] = {25.000000,1,0,0,0,640,480,1,279,6316128,1,-600.377258,179.195511,-0.194785,-1165.124634,704,1052,1};
window[] = {2,-1,-1,-32000,-32000,1095,154,1369,154,3,718};
*//*%FSM</HEAD>*/
class FSM
{
 fsmName = "mission";
 class States
 {
   /*%FSM<STATE "START">*/
   class START
   {
     name = "START";
     init = /*%FSM<STATEINIT""">*/"private [""_offset""];" \n
      "_dropdelay = 45;" \n
      "titleText ["""", ""BLACK FADED"",4];" \n
      "0 fadeSound 0;" \n
      "" \n
      "killed = false;" \n
      "//_alt = 2500;" \n
      "_alt = 6100; //20000 feet ASL. Gives approx 3600meters (12000 feet) freefall._offset is only used for altimeter readout." \n
      "" \n
      "c130 setposasl [3905.436,2483.467,_alt];" \n
      "_lobj = ""Sign_sphere10cm_EP1"" createVehicleLocal [0,0,0];" \n
      "_lobj setPosASL (c130 modelToWorld [0,0.86,7.8]);" \n
      "_lobj setObjectTexture [0,'#(argb,8,8,3)color(0.15,0.9,0.9,1.0)']; //Weird. Just... Weird..." \n
      "" \n
      "c130_real hideobject true;" \n
      "c130_real animate [""ramp_bottom"",1];" \n
      "c130_real animate [""ramp_top"",1];" \n
      "_light = ""#lightpoint"" createVehicleLocal getPos c130;" \n
      "_light setLightAmbient [0.1,0.1,0.1];" \n
      "_light setLightColor [0.25,0.25,0.25];" \n
      "_light lightAttachObject [_lobj,[0,0,-0.125]];" \n
      "_light setLightBrightness 35; //BIS lighting system can be SOOO crazy looking at times..." \n
      "" \n
      "_offset = missionNamespace getVariable ""BIS_HALO_Offset"";" \n
      "" \n
      "player setposasl [3904.695,2485.931,_alt + 1];" \n
      "player setvariable [""bis_fnc_halo_now"",true];" \n
      "player setdir 180;" \n
      "player addeventhandler [""handledamage"",{killed = true}];" \n
      "player allowdamage false;" \n
      "" \n
      "c130 setvectorup [(sin 0)/36,(sin 0)/36,1];" \n
      "c130_locked = [] spawn {" \n
      "	while {true} do {" \n
      "		waituntil {c130 animationphase ""ramp_bottom"" > 0};" \n
      "		c130 animate [""ramp_bottom"",0];" \n
      "		c130 animate [""ramp_top"",0];" \n
      "	};" \n
      "};" \n
      "" \n
      "_tleft = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_tleft setTriggerStatements [""true"", """", """"];" \n
      "_tleft setSoundEffect [""NoSound"", """", """", ""fx_c130l""];" \n
      "_tleft attachTo [c130,[-10,3,0]];" \n
      "_tright = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_tright setTriggerStatements [""true"", """", """"];" \n
      "_tright setSoundEffect [""NoSound"", """", """", ""fx_c130r""];" \n
      "_tright attachTo [c130,[10,3,0]];" \n
      "" \n
      "c130_extsound = [_tleft,_tright] spawn {" \n
      "	_tleft = _this select 0;" \n
      "	_tright = _this select 1;" \n
      "	_offset = _this select 2;" \n
      "	while {true} do {" \n
      "		if (getPos player select 2 < 1) then {" \n
      "			sleep 0.01;" \n
      "//			_dist = (player distance (c130 modelToWorld [0,5,-6])) max 1;" \n
      "			_dist = (player distance (c130 modelToWorld [0,10,-6])) max 1;" \n
      "			_anim1 = 0.15 * (c130 animationPhase ""ramp_bottom""); //0 when closed, 1 when opened" \n
      "			_anim2 = 0.75 * (c130 animationPhase ""ramp_top""); //0 when closed, 1 when opened." \n
      "			_anim = 0.1 + _anim1 + _anim2;" \n
      "			_mod = ((10 - _dist)/20) max 0 min 2;" \n
      "			vol = _mod * _anim;" \n
      "			vol = (50 - 75*vol) max 0;" \n
      "			vol = vol - (30 * _anim) max 0;" \n
      "			vol = 4 * sqrt(vol);" \n
      "//			hintSilent format [""%1"",vol];" \n
      "			_tleft attachTo [player,[-10,3,vol]];" \n
      "			_tright attachTo [player,[10,3,vol]];" \n
      "		};" \n
      "	};" \n
      "};" \n
      "" \n
      "_delay = time + 3;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Shake_and_Pos";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Switch_C_130">*/
   class Switch_C_130
   {
     name = "Switch_C_130";
     init = /*%FSM<STATEINIT""">*/"c130 setPos [getPos c130 select 0, getPos c130 select 1, _alt];" \n
      "c130_real setPos [getPos c130_real select 0, getPos c130_real select 1, _alt];" \n
      "player setPos [getPos player select 0, getPos player select 1, _alt];" \n
      "//player addWeapon ""ItemGPS""; //I don't know how to force open it anyway." \n
      "" \n
      "terminate c130_extsound;" \n
      "" \n
      "deleteVehicle _light;" \n
      "deleteVehicle _tleft;" \n
      "deleteVehicle _tright;" \n
      "" \n
      "c130_real setpos position c130;" \n
      "c130_real setdir 0;" \n
      "c130_real hideobject false;" \n
      "c130_real enablesimulation true;" \n
      "c130_real setvelocity [0,120,0];" \n
      "addCamShake [140,6,8];" \n
      "[] spawn {" \n
      "	sleep 5;" \n
      "	while {player == vehicle player} do {" \n
      "		addCamShake [20,10,8];" \n
      "		sleep 5;" \n
      "	};" \n
      "};" \n
      "	" \n
      "c130_real flyinheight _alt;" \n
      "" \n
      "player spawn bis_fnc_halo;" \n
      "player setvelocity [0,-120*0.8,0];" \n
      "player setdir 0;" \n
      "player allowdamage true;" \n
      "" \n
      "//terminate c130_shake;" \n
      "c130 setpos [3905.436,2483.467,_alt+9999];" \n
      "//c130 hideobject true;" \n
      "" \n
      "jumpTime = time;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "True">*/
       class True
       {
         priority = 0.000000;
         to="MFF";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Shake_and_Pos">*/
   class Shake_and_Pos
   {
     name = "Shake_and_Pos";
     init = /*%FSM<STATEINIT""">*/"c130_real setposasl [position c130 select 0,position c130 select 1,_alt];" \n
      "c130_real enableSimulation false;" \n
      "" \n
      "call BIS_AdvHints_setDefaults;" \n
      "BIS_AdvHints_Dynamic = [" \n
      "	{'MoveForward' call BIS_getKeyBind}," \n
      "	{'MoveBack' call BIS_getKeyBind}," \n
      "	{'TurnLeft' call BIS_getKeyBind}," \n
      "	{'TurnRight' call BIS_getKeyBind}," \n
      "	{round((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2))}," \n
      "	{round(((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2)) * 3.28)}," \n
      "	{'Action' call BIS_getKeyBind}" \n
      "];" \n
      "BIS_AdvHints_THeader = ""HALO Jump"";" \n
      "BIS_AdvHints_TInfo = ""Wait for the aircrafts loadmaster to give you the ready go. Use this time to find out at what altitude ASL you need to open your parachute, as this version is a barometric altimeter instead of the too easy radar altimeter in vanilla. You will still receive a warning when passing 500m/1600ft AGL in recruit or regular difficulty mode, but not in veteran or expert difficulty modes. There is no auto pull in any difficulty modes."";" \n
      "BIS_AdvHints_TImp = format [""Alt. ASL: %1 m (%2 ft)"", round((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2)), round(((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2)) * 3.28)];" \n
      "BIS_AdvHints_TAction = ""Your weapons are removed, but will be given back on touchdown. NVGs can be equipped only during the parachute phase, not the freefall phase due to oxygen mask."";" \n
      "BIS_AdvHints_TBinds = """"; localize ""STR_EP1_mission.fsmFSM_States_MFF3"";" \n
      "BIS_AdvHints_HideCond = ""false"";" \n
      "BIS_AdvHints_Seamless = true;" \n
      "BIS_AdvHints_Text = call BIS_AdvHints_formatText;" \n
      "BIS_AdvHints_Spawn = [] spawn BIS_AdvHints_showHintSpawn;" \n
      "" \n
      "_pwpn = primaryWeapon player;" \n
      "player removeWeapon _pwpn;" \n
      "_swpn = secondaryWeapon player;" \n
      "player removeWeapon _swpn;" \n
      "_sarm = currentWeapon player;" \n
      "player removeWeapon _sarm;" \n
      "_nvgs = false;" \n
      "if (player hasWeapon ""NVGoggles"") then {" \n
      "	_nvgs = true;" \n
      "	player removeWeapon ""NVGoggles"";" \n
      "};" \n
      "//_gps = false; //Removed. GPS is a requirement for a HALO jump, and I'm currently not able to force open it when player gets it back on the exit." \n
      "//if (player hasWeapon ""ItemGPS"") then {" \n
      "//	_gps = true;" \n
      "//	player removeWeapon ""ItemGPS"";" \n
      "//};" \n
      "" \n
      "c130_shake = [] spawn {" \n
      "	while {(getPos player select 2) < 1} do {" \n
      "//		addCamShake [4,1,0.2];" \n
      "		sleep 0.5;" \n
      "		addCamShake [0.35,1,40];" \n
      "	};" \n
      "};" \n
      "" \n
      "/*" \n
      "c130_shake = [] spawn {" \n
      "	n = 0;" \n
      "	while {true} do {" \n
      "		sleep 0.01;" \n
      "		c130 setvectorup [(sin n)/36,(sin n)/36,1];" \n
      "		n = n + random 1;" \n
      "	};" \n
      "};" \n
      "*/" \n
      "" \n
      "_delay = time + 3;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Fade_in";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Parachute">*/
   class Parachute
   {
     name = "Parachute";
     init = /*%FSM<STATEINIT""">*/"addCamShake [340,3,8];" \n
      "[] spawn {" \n
      "	sleep 5;" \n
      "	while {player != vehicle player} do {" \n
      "		addCamShake [4,10,4];" \n
      "		sleep 5;" \n
      "	};" \n
      "};" \n
      "" \n
      "call BIS_AdvHints_setDefaults; //Removes the hintbox" \n
      "" \n
      "if (_nvgs) then {" \n
      "	player addWeapon ""NVGoggles"";" \n
      "};" \n
      ""/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Landed_OK">*/
       class Landed_OK
       {
         priority = 1.000000;
         to="Landing";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"getPos player select 2 < 1 || vehicle player == player"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Open_Top">*/
   class Open_Top
   {
     name = "Open_Top";
     init = /*%FSM<STATEINIT""">*/"c130 animate [""ramp_top"",1];" \n
      "_delay = time + 3;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Open_Bottom";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "MFF">*/
   class MFF
   {
     name = "MFF";
     init = /*%FSM<STATEINIT""">*/"call BIS_AdvHints_setDefaults;" \n
      "//BIS_AdvHints_THeader = localize ""STR_EP1_mission.fsmFSM_States_MFF0"";" \n
      "BIS_AdvHints_THeader = ""HALO Jump"";" \n
      "BIS_AdvHints_TInfo = localize ""STR_EP1_mission.fsmFSM_States_MFF1"";" \n
      "BIS_AdvHints_TImp = localize ""STR_EP1_mission.fsmFSM_States_MFF0_0"";" \n
      "BIS_AdvHints_TAction = localize ""STR_EP1_mission.fsmFSM_States_MFF2"";" \n
      "BIS_AdvHints_TBinds = localize ""STR_EP1_mission.fsmFSM_States_MFF3"";" \n
      "BIS_AdvHints_HideCond = ""false"";" \n
      "BIS_AdvHints_Seamless = true;" \n
      "BIS_AdvHints_Text = call BIS_AdvHints_formatText;" \n
      "BIS_AdvHints_Dynamic = [" \n
      "	{'MoveForward' call BIS_getKeyBind}," \n
      "	{'MoveBack' call BIS_getKeyBind}," \n
      "	{'TurnLeft' call BIS_getKeyBind}," \n
      "	{'TurnRight' call BIS_getKeyBind}," \n
      "	{round((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2))}," \n
      "	{round(((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2)) * 3.28)}," \n
      "	{'Action' call BIS_getKeyBind}" \n
      "];" \n
      "BIS_AdvHints_Spawn = [] spawn BIS_AdvHints_showHintSpawn;" \n
      "_tlefth = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_tlefth setTriggerStatements [""true"", """", """"];" \n
      "_tlefth setSoundEffect [""NoSound"", """", """", ""fx_windhighl""];" \n
      "_tlefth attachTo [player,[-10,10,0]];" \n
      "_trighth = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_trighth setTriggerStatements [""true"", """", """"];" \n
      "_trighth setSoundEffect [""NoSound"", """", """", ""fx_windhighr""];" \n
      "_trighth attachTo [player,[10,10,0]];" \n
      "_tleftl = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_tleftl setTriggerStatements [""true"", """", """"];" \n
      "_tleftl setSoundEffect [""NoSound"", """", """", ""fx_windlowl""];" \n
      "_tleftl attachTo [player,[-10,10,100]];" \n
      "_trightl = createTrigger[""EmptyDetector"" ,[0,0,0]];" \n
      "_trightl setTriggerStatements [""true"", """", """"];" \n
      "_trightl setSoundEffect [""NoSound"", """", """", ""fx_windlowr""];" \n
      "_trightl attachTo [player,[10,10,100]];" \n
      "player_freefallsound = [_tleftl,_trightl,_tlefth,_trighth, _alt] spawn {" \n
      "	_tleftl = _this select 0;" \n
      "	_trightl = _this select 1;" \n
      "	_tlefth = _this select 2;" \n
      "	_trighth = _this select 3;" \n
      "	_alt = _this select 4;" \n
      "	_altmax = _alt-500;" \n
      "	_altmin = 500;" \n
      "	_dvdmin = viewDistance;" \n
      "	_dvdmax = _alt min 5000;" \n
      "	_dvd = 0;" \n
      "	while {(getPosASL vehicle player select 2) > 5} do {" \n
      "		_vx = abs (velocity vehicle player select 0);" \n
      "		_vy = abs (velocity vehicle player select 1);" \n
      "		_vz = abs (velocity vehicle player select 2);" \n
      "		_vel = _vx + _vy + _vz;" \n
      "		vel = _vel;" \n
      "		if (_vel>50) then {" \n
      "			_tlefth attachTo [vehicle player,[-10,10,0]];" \n
      "			_trighth attachTo [vehicle player,[10,10,0]];" \n
      "			_tleftl attachTo [vehicle player,[-10,10,100]];" \n
      "			_trightl attachTo [vehicle player,[10,10,100]];" \n
      "		} else {" \n
      "			_tlefth attachTo [vehicle player,[-10,10,100]];" \n
      "			_trighth attachTo [vehicle player,[10,10,100]];" \n
      "			_tleftl attachTo [vehicle player,[-10,10,0]];" \n
      "			_trightl attachTo [vehicle player,[10,10,0]];" \n
      "		};" \n
      "		if (getPosASL player select 2 > 500) then {" \n
      "			_dvd = [getPosASL player select 2, _altmin, _altmax] call fn_Normalize;" \n
      "			_dvd = _dvd * _dvdmax max _dvdmin;" \n
      "		} else {" \n
      "			_dvd = _dvdmin;" \n
      "			if ((getPosASL player select 2) < 100) then {" \n
      "				_tleftl attachTo [vehicle player,[-10,10,100 - (getPosASL vehicle player select 2)]];" \n
      "				_trightl attachTo [vehicle player,[10,10,100 - (getPosASL vehicle player select 2)]];" \n
      "			};" \n
      "		};" \n
      "		setViewdistance _dvd;" \n
      "		sleep 0.567;" \n
      "//		player globalChat format [""dvd: %1 - %2, alt: %3"",round _dvd, round time, round (getPosASL vehicle player select 2)];" \n
      "	};" \n
      "};"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "__00_meters____c">*/
       class __00_meters____c
       {
         priority = 0.000000;
         to="Open_now_";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"(position vehicle player select 2) < 500 && cadetMode"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
       /*%FSM<LINK "Opened">*/
       class Opened
       {
         priority = 0.000000;
         to="Parachute";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"vehicle player != player"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Open_now_">*/
   class Open_now_
   {
     name = "Open_now_";
     init = /*%FSM<STATEINIT""">*/"call BIS_AdvHints_setDefaults;" \n
      "//BIS_AdvHints_THeader = localize ""STR_EP1_mission.fsmFSM_States_MFF0"";" \n
      "BIS_AdvHints_THeader = ""HALO Jump"";" \n
      "BIS_AdvHints_TInfo = localize ""STR_EP1_mission.fsmFSM_States_MFF1"";" \n
      "BIS_AdvHints_TImp = localize ""STR_EP1_mission.fsmFSM_States_MFF0_0"";" \n
      "//BIS_AdvHints_TAction = localize ""STR_EP1_mission.fsmFSM_States_MFF2"";" \n
      "BIS_AdvHints_TAction = ""Open parachute NOW!"";" \n
      "BIS_AdvHints_TBinds = localize ""STR_EP1_mission.fsmFSM_States_MFF3"";" \n
      "BIS_AdvHints_HideCond = ""false"";" \n
      "BIS_AdvHints_Seamless = true;" \n
      "BIS_AdvHints_Text = call BIS_AdvHints_formatText;" \n
      "BIS_AdvHints_Dynamic = [" \n
      "	{'MoveForward' call BIS_getKeyBind}," \n
      "	{'MoveBack' call BIS_getKeyBind}," \n
      "	{'TurnLeft' call BIS_getKeyBind}," \n
      "	{'TurnRight' call BIS_getKeyBind}," \n
      "	{round((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2))}," \n
      "	{round(((missionNamespace getVariable ""BIS_HALO_Offset"") + (getPosASL player select 2)) * 3.28)}," \n
      "	{'Action' call BIS_getKeyBind}" \n
      "];" \n
      "BIS_AdvHints_Spawn = [] spawn BIS_AdvHints_showHintSpawn;" \n
      "" \n
      ""/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Opened">*/
       class Opened
       {
         priority = 0.000000;
         to="Parachute";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"vehicle player != player"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Landing">*/
   class Landing
   {
     name = "Landing";
     init = /*%FSM<STATEINIT""">*/"call BIS_AdvHints_setDefaults;" \n
      "if (vehicle vehicle player isKindOf ""ParachuteBase"") then {" \n
      "	player action [""Eject"", vehicle player];" \n
      "};" \n
      "deleteVehicle _tlefth;" \n
      "deleteVehicle _trighth;" \n
      "deleteVehicle _tleftl;" \n
      "deleteVehicle _trightl;" \n
      "//player globalChat format [""%1 - %2 - %3 - %4"", _tlefth,_trighth,_tleftl,_trightl];" \n
      "if (_pwpn != """") then {" \n
      "	player addWeapon _pwpn;" \n
      "};" \n
      "if (_swpn != """") then {" \n
      "	player addWeapon _swpn;" \n
      "};" \n
      "if (_sarm != """") then {" \n
      "	player addWeapon _sarm;" \n
      "};" \n
      "" \n
      "player selectWeapon (primaryWeapon player);" \n
      "_muzzles = getArray(configFile>>""cfgWeapons"" >> (primaryWeapon player) >> ""muzzles"");" \n
      "player selectWeapon (_muzzles select 0);" \n
      "addCamShake [80,3,8];" \n
      "player playMove ""amovppnemstpsraswrfldnon"";" \n
      "_delay = time + 1;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Down";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Down">*/
   class Down
   {
     name = "Down";
     init = /*%FSM<STATEINIT""">*/"player playMove ""amovppnemstpsraswrfldnon"";" \n
      "_delay = time + 5;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="END";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "END">*/
   class END
   {
     name = "END";
     init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Green_Light_03_G">*/
   class Green_Light_03_G
   {
     name = "Green_Light_03_G";
     init = /*%FSM<STATEINIT""">*/"_light setLightAmbient [-0.3,1,-0.3];" \n
      "_light setLightColor [-0.3,1,0.-0.3];" \n
      "_lobj setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,1)'];" \n
      "glChatLogic sideRadio ""03_GetOutNow"";"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Jump">*/
       class Jump
       {
         priority = 0.000000;
         to="Switch_C_130";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"(position player select 2) > 1"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Red_Light_02_Get">*/
   class Red_Light_02_Get
   {
     name = "Red_Light_02_Get";
     init = /*%FSM<STATEINIT""">*/"_light setLightAmbient [1,0,0];" \n
      "_light setLightColor [1,0,0];" \n
      "_lobj setObjectTexture [0,'#(argb,8,8,3)color(1,0,0,1)'];" \n
      "_delay = time + 8;" \n
      "glChatLogic sideRadio ""02_GetReady"";"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Open_Top";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Fade_in">*/
   class Fade_in
   {
     name = "Fade_in";
     init = /*%FSM<STATEINIT""">*/"titleText ["""", ""BLACK IN"",10];" \n
      "10 fadeSound 1;" \n
      "" \n
      "_delay = time + 5;" \n
      ""/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="__1_OneMinute";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "Open_Bottom">*/
   class Open_Bottom
   {
     name = "Open_Bottom";
     init = /*%FSM<STATEINIT""">*/"terminate c130_locked;" \n
      "c130 animate [""ramp_bottom"",1];" \n
      "_delay = time + 3;"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Green_Light_03_G";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
   /*%FSM<STATE "__1_OneMinute">*/
   class __1_OneMinute
   {
     name = "__1_OneMinute";
     init = /*%FSM<STATEINIT""">*/"_delay = time + _dropdelay;" \n
      "glChatLogic sideRadio ""01_OneMinuteToDropZone"";"/*%FSM</STATEINIT""">*/;
     precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
     class Links
     {
       /*%FSM<LINK "Delay">*/
       class Delay
       {
         priority = 0.000000;
         to="Red_Light_02_Get";
         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
         condition=/*%FSM<CONDITION""">*/"time > _delay"/*%FSM</CONDITION""">*/;
         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
       };
       /*%FSM</LINK>*/
     };
   };
   /*%FSM</STATE>*/
 };
 initState="START";
 finalStates[] =
 {
   "END",
 };
};
/*%FSM</COMPILE>*/

But in all seriousness, I try to point users to their mistakes rather than show them full code which may not be applicable (or even work) at all.

Share this post


Link to post
Share on other sites

I dunno, I can't seem to make it work. I also can't figure out how to get rid of the default chute either.

Here is what I have so far:

_StartLocation = _this select 0;

#include "x_setup.sqf"

#include "x_macros.sqf"

_pos1 = getMarkerPos "jump_marker_1";

_pos2 = (if (current_mission_index != -1) then {getMarkerPos "jump_marker_2"} else {[-10000,-10000]});

if (_StartLocation distance _pos1 > _StartLocation distance _pos2) then {_pos1 = _pos2};

_dir = ((_StartLocation select 0) - (_pos1 select 0)) atan2 ((_StartLocation select 1) - (_pos1 select 1));

_dir = _dir + 180;

if(_dir < 0) then {_dir = _dir + 360};

if (_StartLocation distance getMarkerPos "jump_marker_1" < 2000) exitWith {["You can't do a Combat Jump within 2000 meters of the current main target, for the aircrafts safety!", "SIDE"] call XHintChatMsg};

if (current_mission_index != -1 && _StartLocation distance getMarkerPos "jump_marker_2" < 1500) exitWith {["You can't do a Combat Jump within 1500 meters of the current side mission, for the aircrafts safety!", "SIDE"] call XHintChatMsg};

deleteMarkerLocal "jump_marker_1"; deleteMarkerLocal "jump_marker_2";

if (d_para_timer_base > 0) then {

d_next_jump_time = time + d_para_timer_base;

};

// #ifndef __ACE__

_jump_helo = "CH_47F_EP1";

if (playerSide == east) then {

_jump_helo = "Mi17_rockets_RU";

};

// #endif

// #ifdef __ACE__

// _jump_helo = "ACE_UH60MG_M240C";

// if (playerSide == east) then {

// _jump_helo = "ACE_Mi17_MG";

// };

// #endif

#ifdef __ACE__

if (player hasWeapon "ACE_ParachuteRoundPack") then {

player removeWeapon "ACE_ParachuteRoundPack";

};

#endif

titleText ["","Plain"];

_dummygroup = createGroup west;

"US_Soldier_Pilot_EP1" createUnit [[0,0,0], _dummygroup, "pilot = this"];

pilot setCaptive true; pilot setCombatMode blue; pilot setBehaviour "CARELESS";

_vehicle = createVehicle [_jump_helo, _StartLocation, [], 0, "FLY"];

_vehicle setPos [_StartLocation select 0, _StartLocation select 1, d_halo_height];

_vehicle flyinheight d_halo_height;

_vehicle setDir _dir;

_vehicle setVelocity [sin _dir*50,cos _dir*50,0];

_vehicle engineOn true;

[_vehicle] spawn {(_this select 0) animate ["ramp_top",1]; (_this select 0) animate ["ramp_bottom",1];};

_li = "#lightpoint" createVehicleLocal getpos _vehicle;

_li setLightBrightness 0.02;

_li setLightAmbient[0.8, 0.2, 0.2];

_li setLightColor[0.8, 0.2, 0.2];

_li lightAttachObject [_vehicle, [0,-2,-5]];

[_vehicle, 10, 0] call BIS_fnc_setPitchBank;

_xxx = [_vehicle] spawn {

_timer = time + 33;

while {!isNull (_this select 0)} do {

if !(vehicle player isKindOf "ParachuteBase") then {[_this select 0, 5, 0] call BIS_fnc_setPitchBank}; //force pitch up and zero bank until jump performed. AI drive these like idiots.

sleep 0.012;

if (time > _timer) then {deleteVehicle pilot; deleteVehicle (_this select 0); deleteGroup _dummygroup; _timer = nil;};

};

};

player moveInCargo [_vehicle, 6];

pilot moveInDriver _vehicle;

(vehicle pilot) doMove ((vehicle pilot) modelToWorld [0,1000,0]);

(vehicle pilot) vehicleChat "Get Ready to Jump";

sleep 3;

(vehicle pilot) vehicleChat "Green Light! Go go go!";

_li setLightAmbient[0.2, 0.6, 0.2];

_li setLightColor[0.2, 0.6, 0.2];

[_vehicle] spawn {(_this select 0) animate ["ramp_top",0]; (_this select 0) animate ["ramp_bottom",0];};

if(vehicle player == player)exitWith {};

_vehicle lock false;

player action ["eject", _vehicle];

[player, player call XfGetHeight] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

player setvelocity [0,0,0];

unassignVehicle player;

sleep 5;

deleteVehicle _li;

if (vehicle pilot isKindOf "ParachuteBase") then {deleteVehicle (vehicle pilot); deleteVehicle pilot;};

if (alive pilot) then {deleteVehicle pilot};

if (true) exitWith {};

Edited by callihn

Share this post


Link to post
Share on other sites

Use code tags instead of quote tags. Quote tags for code is kinda impossible to read.

Maybe you shouldn't check against that _pos thing, I bet you don't have "jump_marker_1" and "jump_marker_2" defined. For me, these are created when the dialog is created, at main mission target and side mission position. For HALO (or rather, MFF) in the vanilla Domination sense, you probably don't need them. My system is a bit different from what you may be used to from vanilla Domination.

Share this post


Link to post
Share on other sites
Use code tags instead of quote tags. Quote tags for code is kinda impossible to read.

Maybe you shouldn't check against that _pos thing, I bet you don't have "jump_marker_1" and "jump_marker_2" defined. For me, these are created when the dialog is created, at main mission target and side mission position. For HALO (or rather, MFF) in the vanilla Domination sense, you probably don't need them. My system is a bit different from what you may be used to from vanilla Domination.

Thanks, all of that works fine though, except the chopper drops your off and vanishes in thin air shortly after, I simply want it to fly out of site and then vanish or at least fly further away.

Share this post


Link to post
Share on other sites

Try to increase the sleep. I know there is a reason I put it short in the first place, but I can't remember what it was atm.

Share this post


Link to post
Share on other sites
Try to increase the sleep. I know there is a reason I put it short in the first place, but I can't remember what it was atm.

No for some reason it still doesn't fly so increasing the sleep or the timer just allows you to watch it all the way to the ground. :(

Share this post


Link to post
Share on other sites

Ah, now I remember. Yes it will plunge to the ground because it has no pilot. The pilot is removed once the player bails - he is only there to vehicle chat the "green light, go", not to pilot the plane. He is removed because he will go crazy with the controls, and the airplanes control surfaces will go amok - nobody flies like that. If he is left on the controls he will do crazy things like 80° banks etc, completely insane. The C130J is not a jet fighter :(

I don't know, you could try putting him at the copilots seat instead and to a quick loop on setting the planes attitude and velocity to keep it "flying"?

I'll try to improve further on that script a little for myself. Played vanilla public Domination yesterday (no hackers, yay!!!) and I found it incredibly annoying with those sudden chopper "pop ins" that "HALO'ed" in those of us who paratrooped.

Share this post


Link to post
Share on other sites

Please do, I think it would be a nicer solution myself, I mean planes or choppers do not just vanish in thin air. Would be nice to have it move up and away a little more so it atleast looks halfway legit. I'm having simular issues with attaching a parachute to an ammo box for some reason in another thread, the chute doesn't actually slow the ammo box down. Yea I tried to add a ten second lead in so you actually get a chance to ride in the chopper, but I had to stick with three because the chopper decends too rapidly. I may get back to it in time, but it's not been too friendly so I'll have to leave it for now.

Share this post


Link to post
Share on other sites

I've played a couple missions where the plane or chopper returns to base, another where it flies far away then gets deleted. It does seem better to see the plane leave the area, rather then vanish.

Share this post


Link to post
Share on other sites

This should fill the void until someone can make it better using more waypoints. Seems they start getting lost somewhere past 1000m and can no longer link with the waypoint. Would be nicer if it could do a true 360 on _chopper_spawn and _end_pos in the "y" field.

// Modified/Patched By SoNumb, no prior credits, assumed Xeno's

_StartLocation = _this select 0;

#include "x_setup.sqf"
#include "x_macros.sqf"

if (d_para_timer_base > 0) then {
d_next_jump_time = time + d_para_timer_base;
};

#ifndef __ACE__
_jump_helo = "CH_47F_EP1";
if (playerSide == east) then {
_jump_helo = "Mi17_rockets_RU";
};
#endif
#ifdef __ACE__
_jump_helo = "CH_47F_EP1";
if (playerSide == east) then {
_jump_helo = "ACE_Mi17_MG";
};
#endif

titleText ["","Plain"];

_jump_pos = [_StartLocation select 0, _StartLocation select 1, d_halo_height];
_chopper_spawn = [(_StartLocation select 0) - (800 - ceil(random 200)), (_StartLocation select 1) - ceil(random 1000) + ceil(random 1000), d_halo_height];
_end_pos = [(_StartLocation select 0) + 1000, (_StartLocation select 1) + (ceil(random 1000)) - (ceil(random 1000)), d_halo_height + ceil(random 250)];

_the_pilot = "";

_chopper = createVehicle [_jump_helo, _chopper_spawn, [], 0, "FLY"];
_chopper setpos [_chopper_spawn select 0,_chopper_spawn select 1, d_halo_height];
_chopper engineon true;
_chopper lock false;
_obj_jump = player;

sleep 2;


switch (X_Drop_Side) do {
case "WEST": {
	_the_pilot = d_pilot_W;
};
case "GUER": {
	_the_pilot = d_pilot_G;
};
case "EAST": {
	_the_pilot = d_pilot_E;
};
case "CIV": {
	_the_pilot = "Civilian";
};
};

_grp = [X_Drop_Side] call x_creategroup;
_unit = _grp createUnit [_the_pilot, _jump_pos, [], 0, "NONE"];
[_unit] join _grp;_unit setSkill 1;_unit moveInDriver _chopper;
player moveInCargo [_chopper,20];
_unit setCaptive true;
__addDead(_unit);
__addDead(_chopper);

if(vehicle player == player)exitWith {};

_chopper lock true;
removeAllWeapons _chopper;

_delete_chop = {
private ["_unit","_chopper"];
_unit = _this select 0;
_chopper = _this select 1;
deleteVehicle _chopper;deleteVehicle _unit;
};

if (_chopper distance _jump_pos > _chopper distance d_island_center) then {
_wp = _grp addWaypoint [d_island_center, 0];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "STEALTH";
_wp setWaypointSpeed "FULL";
};
_wp = _grp addWaypoint [_jump_pos, 0];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "STEALTH";
_wp setWaypointSpeed "NORMAL";

if (_jump_pos distance _end_pos > _jump_pos distance d_island_center) then {
_wp = _grp addWaypoint [d_island_center, 0];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "STEALTH";
_wp setWaypointSpeed "FULL";
};
_wp2 = _grp addWaypoint [_end_pos, 0];
_wp2 setwaypointtype "MOVE";
_wp2 setWaypointBehaviour "STEALTH";
_wp2 setWaypointSpeed "FULL";

_chopper flyInHeight d_halo_height;

_dist_to_drop = 150;

_may_exit = false;

while {_chopper distance _jump_pos > 1000} do {
sleep 0.512;
if (!alive _unit || !alive _chopper || !canMove _chopper) exitWith {[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];_may_exit = true};
};

if (_may_exit) exitWith {};

while {_chopper distance _jump_pos > _dist_to_drop} do {
sleep 1.012;
if (!alive _unit || !alive _chopper || !canMove _chopper) exitWith {[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];_may_exit = true};
_unit doMove _jump_pos;
};

if (_may_exit) exitWith {};

#ifndef __ACE__

waituntil {_chopper distance _jump_pos < _dist_to_drop};

_obj_jump setvelocity [0,0,0];
_obj_jump action["EJECT",vehicle _obj_jump];

if (vehicle _obj_jump isKindOf "ParachuteBase") then {
_vec = vehicle _obj_jump;
_chopper lock false;
_obj_jump action["EJECT",vehicle _obj_jump];
_chopper lock true;
deleteVehicle _vec;
};

[_obj_jump, _obj_jump call XfGetHeight] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

sleep 5;

_starttime = time;
_exit_it = false;

sleep 0.512;

while {_chopper distance _end_pos > 300} do {
if (time - _starttime > 300) exitWith {
	[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];	
	_exit_it = true;
};
if (!alive _unit || !alive _chopper || !canMove _chopper) exitWith {_exit_it = true;[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];};
sleep 1.012;
};

if (_exit_it) exitWith {};

[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];

if ("AI" in d_version) then {
if (alive player) then {
	[position player, velocity player, direction player] execVM "x_scripts\x_moveai.sqf";
};
};

if (true) exitWith {};

#endif

#ifdef __ACE__

/*if (!(_obj_jump hasWeapon "ACE_ParachutePack")) then {
_obj_jump addWeapon "ACE_ParachutePack";
};*/

[_chopper,_obj_jump] execVM "\ace_sys_eject\s\ace_jumpout.sqf";

sleep 5;
_starttime = time;
_exit_it = false;

sleep 0.512;

while {_chopper distance _end_pos > 300} do {
if (time - _starttime > 300) exitWith {
	[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];
	_exit_it = true;
};
if (!alive _unit || !alive _chopper || !canMove _chopper) exitWith {_exit_it = true;[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];};
sleep 1.012;
};

if (_exit_it) exitWith {};

[_unit,_chopper] spawn _delete_chop;deleteWaypoint [_grp, 0];
if ("AI" in d_version) then {
if (alive player) then {
[position player, velocity player, direction player] execVM "x_scripts\x_moveai.sqf";
};
};
if (true) exitWith {};
#endif 

Edited by callihn

Share this post


Link to post
Share on other sites

This is the best I could do, it does come from one of two randomly selected directions, North or South, it also has a player cue so if someone is out in the transport and a player opts to jump then it will place them in the cue and they will jump next, which means they they will load in a new transport vehicle as soon as the current one reaches reaches it's end point.

Ideally it could spawn the chopper at a random degree exactly d_viewdistance from the _jumpPos giving it 360 degrees of possibly approaches, I've found that the choppers are a problem they want to hang up, they would stop and hoover at times for no apparent reason, so I went with the C130J and it seems to have fixed that problem, still do not know what the problem was though.

Now the only problem I have is that the plane loses allot of altitude at the start and I can't seem to stop it.

/*
Modified/Patched By SoNumb, no prior credits, assumed Xeno's. HIGHLY modified.
Currently broken, the plane loses altitude after spawning, this can cause it to crash over mountains.
*/
#include "x_setup.sqf"
#include "x_macros.sqf"
private ["_dropDistance","_transport","_transportSpawn","_delTransport","_endPos","_exitIt","_grp","_transportVehicle","_jumpPos","_mayExit","_pilot","_startLocation","_startTime","_unit","_wp","_wp2","_wp3","_halfWay","_threeQ","_wp1","_wp4","_randomNum","_debug","_objJump","_transportDir","_timeLeft","__addDead"];
_debug = false;
_startLocation = _this select 0;
if (d_para_timer_base > 0) then {
d_next_jump_time = time + d_para_timer_base;
};
if (_debug) then {
d_next_jump_time = 0;
transportAvailable = true;
transportCue = false;
};
if (d_next_jump_time > time) exitWith {
_timeLeft = d_next_jump_time - time; 
player globalChat format ["You can't jump again this soon, wait %1 seconds.",_timeLeft];
};
if transportCue exitWith {
"Transport is currently unavailable, one player already cued." call XfHQChat;
"Form a single file line behind them." call XfHQChat;
"You can get in the cue when you see them depart." call XfHQChat;
};
if (!transportAvailable) then {
"Transport is currently unavailable, you have been added to the cue." call XfHQChat;
"Do not leave the area, you will jump next." call XfHQChat;
"Form a line so other players will know the cue is full." call XfHQChat;
transportCue = true;
 while {!transportAvailable} do {
  waituntil {transportAvailable};
  "_StartLocation = _pos;closeDialog 0;[_StartLocation] execVM ""AAHALO\jump.sqf";
  transportCue = false;
  sleep random 5;
 }; 
};
transportAvailable = false;
titleText ["","Plain"];
_randomNum = 1;
if (_randomNum < 1) then {
_transportDir = 0;
_transportSpawn = [_startLocation select 0,((_startLocation select 1)-(d_viewdistance)),d_halo_height];
_halfWay = [_startLocation select 0,((_startLocation select 1)-((d_viewdistance)/(2))),d_halo_height];
_jumpPos = [_startLocation select 0,_startLocation select 1,d_halo_height];
_threeQ = [((_jumpPos select 0)-(400)),((_jumpPos select 1)+((d_viewdistance)/(2))),d_halo_height];
_endPos = [((_threeQ select 0)-(400)),((_threeQ select 1)+((d_viewdistance)/(2))),d_halo_height];
 }else{
  _transportDir = 180;
  _transportSpawn = [_startLocation select 0,((_startLocation select 1)+(d_viewdistance)),d_halo_height];
  _halfWay = [_startLocation select 0,((_startLocation select 1)+((d_viewdistance)/(2))),d_halo_height];
  _jumpPos = [_startLocation select 0,_startLocation select 1,d_halo_height];
  _threeQ = [((_jumpPos select 0)+(400)),((_jumpPos select 1)-((d_viewdistance)/(2))),d_halo_height];
  _endPos = [((_threeQ select 0)+(400)),((_threeQ select 1)-((d_viewdistance)/(2))),d_halo_height];
};
if (_debug) then {
createMarkerLocal ["mkrCS", _transportSpawn];
createMarkerLocal ["mkrHW", _halfWay];
createMarkerLocal ["mkrJP", _jumpPos];
createMarkerLocal ["mkrTQ", _threeQ];
createMarkerLocal ["mkrEP", _endPos];
"mkrCS" setMarkerShapeLocal "ICON";
"mkrHW" setMarkerShapeLocal "ICON";
"mkrJP" setMarkerShapeLocal "ICON";
"mkrTQ" setMarkerShapeLocal "ICON";
"mkrEP" setMarkerShapeLocal "ICON";
"mkrCS" setMarkerTypeLocal "mil_circle";
"mkrHW" setMarkerTypeLocal "mil_circle";
"mkrJP" setMarkerTypeLocal "mil_circle";
"mkrTQ" setMarkerTypeLocal "mil_circle";
"mkrEP" setMarkerTypeLocal "mil_circle";
"mkrCS" setMarkerColorLocal "ColorGreen";
"mkrJP" setMarkerColorLocal "ColorBlue";
"mkrTQ" setMarkerColorLocal "ColorOrange";
"mkrEP" setMarkerColorLocal "ColorRed";
};
_transportVehicle = "C130J_US_EP1";
_pilot = "";
switch (X_Drop_Side) do {
case "WEST": {
 _pilot = d_pilot_W;
};
case "GUER": {
 _pilot = d_pilot_G;
};
case "EAST": {
 _pilot = d_pilot_E;
};
case "CIV": {
 _pilot = "Civilian";
};
};
_grp = [X_Drop_Side] call x_creategroup;
_transport = createVehicle [_transportVehicle,_transportSpawn,[],0,"FLY"];
removeAllWeapons _transport;
_transport engineon true;
_unit = _grp createUnit [_pilot, _transportSpawn, [], 0, "NONE"];
_unit setSkill [general,1];
_unit moveInDriver _transport;
_unit setCaptive true;
_transport lock true;
__addDead (_unit);
__addDead (_transport);
_transport setDir _transportDir;
_transport setVelocity [180,0,0];
_transport lock false;
player moveInCargo [_transport,20];
if(vehicle player == player)exitWith {};
_transport lock true;
_transport flyInHeight d_halo_height;
_transport forceSpeed 180;
_transport setpos [_transportSpawn select 0,_transportSpawn select 1,d_halo_height];
_delTransport = {
private ["_unit","_transport","_grp"];
_unit = _this select 0;
_transport = _this select 1;
_grp = _this select 2;
deleteVehicle _transport;
deleteVehicle _unit;
transportAvailable = true;
deleteWaypoint [_grp, 0];
deleteWaypoint [_grp, 1];
deleteWaypoint [_grp, 2];
deleteWaypoint [_grp, 3];
deleteWaypoint [_grp, 4];
};
_wp = _grp addWaypoint [_transportSpawn, 0];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointSpeed "FULL";
_wp1 = _grp addWaypoint [_halfWay, 1];
_wp1 setwaypointtype "MOVE";
_wp1 setWaypointBehaviour "CARELESS";
_wp1 setWaypointSpeed "FULL";
_wp2 = _grp addWaypoint [_jumpPos, 2];
_wp2 setwaypointtype "MOVE";
_wp2 setWaypointBehaviour "CARELESS";
_wp2 setWaypointSpeed "FULL";
_wp3 = _grp addWaypoint [_threeQ, 3];
_wp3 setwaypointtype "MOVE";
_wp3 setWaypointBehaviour "CARELESS";
_wp3 setWaypointSpeed "FULL";
_wp4 = _grp addWaypoint [_endPos, 4];
_wp4 setwaypointtype "MOVE";
_wp4 setWaypointBehaviour "CARELESS";
_wp4 setWaypointSpeed "FULL";
_dropDistance = 150;
_mayExit = false;
while {_transport distance _jumpPos > 1000} do {
if (!alive _unit || !alive _transport || !canMove _transport) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _mayExit = true
};
sleep 0.5;
};
_unit doMove _jumpPos;
if (_mayExit) exitWith {};
while {_transport distance _jumpPos > _dropDistance} do {
 if (!alive _unit || !alive _transport || !canMove _transport) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _mayExit = true
};
_unit doMove _jumpPos;
sleep 0.5;
};
if (_mayExit) exitWith {};

#ifndef __ACE__
if (!_debug) then {
_objJump = player;
_transport lock false;
[_objJump, _objJump call XfGetHeight] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
_objJump setPos [getPos _transport select 0,((getPos _transport select 1)+(12)),((getPos _transport select 2)-(36))];
_objJump setvelocity [0,0,0];
};
_transport forceSpeed 300;
deleteWaypoint [_grp, 0];
deleteWaypoint [_grp, 1];

if ("AI" in d_version) then {
if (alive player) then {
 [position player,velocity player,direction player] execVM "x_scripts\x_moveai.sqf";
};
};
_startTime = time;
_exitIt = false;
while {_transport distance _endPos > 1000} do {
if (time - _startTime > 180) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _exitIt = true;
};
if (!alive _unit || !alive _transport || !canMove _transport) exitWith 
 {_exitIt = true;
 [_unit,_transport,_grp] spawn _delTransport;
};
sleep 0.5;
};
_unit doMove _endPos;
while {_transport distance _endPos > _dropDistance} do {
if (time - _startTime > 180) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _exitIt = true;
};
if (!alive _unit || !alive _transport || !canMove _transport) exitWith 
 {_exitIt = true;
 [_unit,_transport,_grp] spawn _delTransport;
};
_unit doMove _endPos;
sleep 0.5;
};
if (_exitIt) exitWith {};
if (_debug) then {
deleteMarkerLocal "mkrCS";
deleteMarkerLocal "mkrHW"; 
deleteMarkerLocal "mkrJP";
deleteMarkerLocal "mkrTQ";
deleteMarkerLocal "mkrEP";
};
[_unit,_transport,_grp] spawn _delTransport;
if (true) exitWith {};
#endif
#ifdef __ACE__
if (!_debug) then {
[_transport,_objJump] execVM "\ace_sys_eject\s\ace_jumpout.sqf";
};
_transport forceSpeed 300;
deleteWaypoint [_grp, 0];
deleteWaypoint [_grp, 1];

if ("AI" in d_version) then {
if (alive player) then {
 [position player,velocity player,direction player] execVM "x_scripts\x_moveai.sqf";
};
};
_startTime = time;
_exitIt = false;
while {_transport distance _endPos > 1000} do {
if (time - _startTime > 180) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _exitIt = true;
};
if (!alive _unit || !alive _transport || !canMove _transport) exitWith 
 {_exitIt = true;
 [_unit,_transport,_grp] spawn _delTransport;
};
sleep 0.5;
};
_unit doMove _endPos;
while {_transport distance _endPos > _dropDistance} do {
if (time - _startTime > 180) exitWith {
 [_unit,_transport,_grp] spawn _delTransport;
 _exitIt = true;
};
if (!alive _unit || !alive _transport || !canMove _transport) exitWith 
 {_exitIt = true;
 [_unit,_transport,_grp] spawn _delTransport;
};
_unit doMove _endPos;
sleep 0.5;
};
if (_exitIt) exitWith {};
if (_debug) then {
deleteMarkerLocal "mkrCS";
deleteMarkerLocal "mkrHW"; 
deleteMarkerLocal "mkrJP";
deleteMarkerLocal "mkrTQ";
deleteMarkerLocal "mkrEP";
};
[_unit,_transport,_grp] spawn _delTransport;
if (true) exitWith {};
#endif

Edited by callihn

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  

×