initial commit

This commit is contained in:
2020-01-15 19:18:38 +01:00
commit 593a971b19
49 changed files with 1060 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/*
Author: Djeeberjr
Description:
Closes the cargo door of the plane
Parameter(s):
0: OBJECT - the main gamelogic
*/
params ["_gl"];
_plane = _gl getVariable "DLib_pj_plane";
playSound3D ["cup\airvehicles\cup_airvehicles_ch53e\data\sfx\Heli_CH53_ramp.wss",_plane,false,AGLToASL (_plane modelToWorld [0,4,-3.8])];
_plane animate ["ramp_bottom",0];
_plane animate ["ramp_top",0];

View File

@@ -0,0 +1,20 @@
/*
Author: Djeeberjr
Description:
Turns the light green inside of the plane
Parameter(s):
0: OBJECT - the main gamelogic
*/
params ["_gl"];
_lightSource = _gl getVariable "DLib_pj_lightSource";
_redLight = _gl getVariable "DLib_pj_redLight";
_greenLight = _gl getVariable "DLib_pj_greenLight";
_lightsource setLightAmbient [0.0, 1.0, 0.0];
_lightsource setLightColor [0.0, 1.0, 0.0];
_greenLight setObjectMaterial [0,"a3\data_f\lights\building_landinglights_green.rvmat"];
_redLight setObjectMaterial [0,"a3\structures_f_heli\items\airport\data\portablehelipadlight_01.rvmat"];

View File

@@ -0,0 +1,68 @@
/*
Author: Djeeberjr
Description:
Inits a plane to be ready to use
Parameter(s):
0: OBJECT - the main gamelogic
1: SCALAR - the hight of the plane
*/
params ["_gl","_hight"];
// Get synced objects
_trigger = ([_gl,"myPlanetNeedsMe"] call Dlib_fnc_getSyncTypeTrigger)#0;
_greenLight = ([_gl,"PortableHelipadLight_01_green_F"] call DLib_fnc_getSyncClass)#0;
_redLight = ([_gl,"PortableHelipadLight_01_red_F"] call DLib_fnc_getSyncClass)#0;
_spawn = ([_gl,"spawn"] call DLib_fnc_getSyncType)#0#0;
_plane = ([_gl,"C130J_static_EP1"] call DLib_fnc_getSyncClass)#0;
// Attach light to plane
[_greenLight,_plane] call DLIB_fnc_attachToRelative;
[_redLight,_plane] call DLIB_fnc_attachToRelative;
// Move all the stuff up into the air
_plane setPos ((getPos _plane) vectorAdd [0,0,_hight]);
_spawn setPos ((getPos _spawn) vectorAdd [0,0,_hight]);
_trigger setPos ((getPos _trigger) vectorAdd [0,0,_hight]);
// create sound source
_soundSources = [];
{
_soundSources pushBack (createSoundSource ["DLIB_pj_planeLoop", (getpos (_x#0)) vectorAdd [0,0,_hight] , [], 0]);
} forEach ([_gl,"soundSource"] call DLib_fnc_getSyncType);
// Setup trigger
_trigger setTriggerStatements ["this","
{
_x setVelocity "+ str (vectorDir _plane vectorMultiply 50) + ";
} forEach thisList;
resetCamShake;
",""];
// setup lights
_greenLight setDamage 1;
_redLight setDamage 1;
// _greenLight setObjectMaterial [0,"a3\structures_f_heli\items\airport\data\portablehelipadlight_01.rvmat"];
_redLight setObjectMaterial [0,"a3\data_f\lights\building_landinglights_green.rvmat"];
// Create light source
_lightsource = "#lightpoint" createVehicleLocal (getPos _redLight);
_lightsource setLightBrightness 0.2;
_lightsource setLightAmbient [1.0, 0.0, 0.0];
_lightsource setLightColor [1.0, 0.0, 0.0];
_lightsource lightAttachObject [_redLight, [0,0,0]];
// Save objects in gl
_gl setVariable ["DLib_pj_trigger",_trigger];
_gl setVariable ["DLib_pj_greenLight",_greenLight];
_gl setVariable ["DLib_pj_redLight",_redLight];
_gl setVariable ["DLib_pj_spawn",_spawn];
_gl setVariable ["DLib_pj_plane",_plane];
_gl setVariable ["DLib_pj_lightSource",_lightSource];
_gl setVariable ["DLib_pj_soundSource",_soundSources];

View File

@@ -0,0 +1,28 @@
/*
Author: Djeeberjr
Description:
Prepares a player to jump
Parameter(s):
0: OBJECT - the unit
1: OBJECT - the main gamelogic
*/
params ["_unit","_planeGl"];
_spawn = _planeGl getVariable "DLib_pj_spawn";
_unit setPosATL (getPosATL _spawn);
_unit playAction "PlayerStand";
enableCamShake true;
addCamShake [2, 9999, 4];
// Prevent player from opeing the cargo door
inGameUISetEventHandler ["Action", "
params ['_attachedObj','_caller','_index','_actionName','_localized','_priority','_showWindow','_hideOnUse','_shortcut','_visable','_ehName'];
if (typeOf _attachedObj isEqualTo 'C130J_static_EP1')then{
true;
}
"];
[_unit] spawn DLib_fnc_playerParaBackpack;

View File

@@ -0,0 +1,17 @@
/*
Author: Djeeberjr
Description:
Opens the cargo door of the plane
Parameter(s):
0: OBJECT - the main gamelogic
*/
params ["_gl"];
_plane = _gl getVariable "DLib_pj_plane";
playSound3D ["cup\airvehicles\cup_airvehicles_ch53e\data\sfx\Heli_CH53_ramp.wss",_plane,false,AGLToASL (_plane modelToWorld [0,4,-3.8])];
_plane animate ["ramp_bottom",1];
_plane animate ["ramp_top",1];

View File

@@ -0,0 +1,20 @@
/*
Author: Djeeberjr
Description:
Turns the light red inside of the plane
Parameter(s):
0: OBJECT - the main gamelogic
*/
params ["_gl"];
_lightSource = _gl getVariable "DLib_pj_lightSource";
_redLight = _gl getVariable "DLib_pj_redLight";
_greenLight = _gl getVariable "DLib_pj_greenLight";
_lightsource setLightAmbient [1.0, 0.0, 0.0];
_lightsource setLightColor [1.0, 0.0, 0.0];
_redLight setObjectMaterial [0,"a3\data_f\lights\building_landinglights_red.rvmat"];
_greenLight setObjectMaterial [0,"a3\structures_f_heli\items\airport\data\portablehelipadlight_01.rvmat"];

View File

@@ -0,0 +1,18 @@
/*
Author: Djeeberjr
Description:
Start the jump sequenze
Parameter(s):
0: OBJECT - the main gamelogic
1 (Optional): SCALAR - the delay between opening the ramp and green light
2 (Optional): BOOL - use radio voice lines from ai
*/
_this spawn {
params ["_gl",["_delay",10],["_useRadio",false]];
[_gl] call DLib_fnc_pj_openRamp;
sleep _delay;
[_gl] call DLib_fnc_pj_greenLight;
};

View File

@@ -0,0 +1,58 @@
/*
Author: Djeeberjr (Kex (based on cobra4v320's Ai HALO Jump script))
Description:
Puts the backpack on the chest and adds a parachute.
THIS FUNCTION HAS TO BE EXECUTED WHERE THE UNIT IS LOCAL!
Parameter(s):
1: OBJECT - the unit
*/
params ["_unit"];
_backpack_class = backpack _unit;
// Holtser weapon
_unit action ["SWITCHWEAPON",_unit,_unit,-1];
// Unit already has a parachute
if (backpack _unit != "" and {getText (configfile >> "CfgVehicles" >> backpack _unit >> "backpackSimulation") isEqualTo "ParachuteSteerable"}) then {_backpack_class = "";};
if (_backpack_class != "") then{
_container = backpackContainer _unit;
_weapon_cargo = getWeaponCargo _container;
_magazine_cargo = getMagazineCargo _container;
_item_cargo = getItemCargo _container;
removeBackpack _unit;
_unit addBackpack "b_parachute";
_packHolder = createVehicle ["groundWeaponHolder", [0,0,0], [], 0, "can_collide"];
_packHolder addBackpackCargoGlobal [_backpack_class, 1];
_packHolder attachTo [vehicle _unit,[-0.07,0.65,-0.55],"spine3"];
[_packHolder, [[0,-0.2,-1],[0,1,0]]] remoteExecCall ["setVectorDirAndUp", 0, _packHolder];
sleep 5; // Wait because sometime when you teleport a player high up on a plane he is going in "HaloFreeFall_non" state
waitUntil {animationState _unit == "HaloFreeFall_non" or (!alive _unit)};
_packHolder attachTo [_unit,[-0.12,-0.02,-.74],"pelvis"];
[_packHolder, [[0,-1,-0.05],[0,0,-1]]] remoteExecCall ["setVectorDirAndUp", 0, _packHolder];
waitUntil {animationState _unit == "para_pilot" or (!alive _unit)};
_packHolder attachTo [vehicle _unit,[-0.07,0.67,-0.13],"pelvis"];
[_packHolder, [[0,-0.2,-1],[0,1,0]]] remoteExecCall ["setVectorDirAndUp", 0, _packHolder];
waitUntil {isTouchingGround _unit or (getPos _unit select 2) < 1 or (!alive _unit)};
deleteVehicle _packHolder;
_unit addBackpack _backpack_class;
clearAllItemsFromBackpack _unit;
_container = backpackContainer _unit;
{_container addWeaponCargo [_x, (_weapon_cargo select 1) select _forEachIndex]} forEach (_weapon_cargo select 0);
{_container addMagazineCargo [_x, (_magazine_cargo select 1) select _forEachIndex]} forEach (_magazine_cargo select 0);
{_container addItemCargo [_x, (_item_cargo select 1) select _forEachIndex]} forEach (_item_cargo select 0);
}else
{
_unit addBackpack "b_parachute";
};