spookygnu 563 Posted June 12, 2016 Hi all, can anybody help me with parajumps please. I ultimatley would like the backpack on the players after they land but cannot for the life of me work out ace 3 with zades addon and the fsf ventral addon. Tried both and i cannot figure them out. I will say i am new to ace so i'm not sure if i'm using it right. Also the fsf mod is able to work from the air. As aircraft dont work properly yet through the editor. I was thinking of just dropping in from the air. So without the mods persay, how would i drop in with the chute then get the players to have their backpacks on them after they land? Thanks. Share this post Link to post Share on other sites
tryteyker 28 Posted June 12, 2016 You don't really need to worry about saving backpacks if parachutes are open from the start, as units are simply moved into the parachute as driver (since it's a vehicle). It's a bit trickier with HALO as you'll need to make it visually appealing in the process. The actual behind-the-scenes stuff isn't hard, since all you'll need to do is store the backpack items from the units backpack and apply it once the unit has landed. However, since you'll want the backpack to show during flight, you need to use setVectorDirAndUp and a lot of jazz which is basically trial and error to attach the weapon holder (which has a backpack in its cargo) to the front of the unit as it HALOs into the AO. I've got 3 functions from our framework ready to use depending on what you want to do, although the halodrop.sqf function may require additional tweaking with attachTo to make the backpack a snug fit. Also halodrop.sqf scatters units somewhat randomly (uses +random 100 on both x- and y-axis for each individual unit) to prevent any collisions, although a static radius like in fn_paradrop would probably be better. fn_paradrop.sqf: /* * Author: Kingsley * Paradrops the given groups/units at the given position and height * * Arguments: * 0: Units, groups or side to paradrop <GROUP/OBJECT/SIDE> * 1: Position to drop units at <POSITION ATL/MARKER NAME> * 2: Height to drop units from (meters) <NUMBER> * 3: Radius in meters <NUMBER> * * Return Value: * None * * Example: * [[grpOne, grpTwo, unitOne, unitTwo], [0,0,0], 500] call ARC_fnc_paraDrop; * [west, [0,0,0], 250, 1000] call ARC_fnc_paraDrop; * * Public: Yes */ if (!isServer) exitWith {}; params [ ["_objects", [], [[], sideUnknown]], ["_position", [], [[], ""]], ["_height", 250, [0]], ["_radius", 500, [0]] ]; if (_position isEqualType "") then {_position = getMarkerPos _position}; if (count _position == 0) exitWith {}; _height = _height + round (random 50); private _dzMarker = createMarker [format ["ARC_paraDropDZ_%1", _position], _position]; _dzMarker setMarkerSize [_radius, _radius]; _dzMarker setMarkerShape "ELLIPSE"; _dzMarker setMarkerAlpha 0; private _units = []; if (_objects isEqualType sideUnknown) then { {_units pushBackUnique _x; false} count (allUnits select {side _x == _objects}); } else { { private _item = _x; if (_item isEqualType grpNull) then { {_units pushBackUnique _x; false} count (units _item); } else { if (_item isEqualType objNull) then { _units pushBackUnique _item; }; }; false } count _objects; }; { private _paraPos = [_dzMarker] call CBA_fnc_randPosArea; private _parachute = createVehicle ["Steerable_Parachute_F", (_paraPos vectorAdd [0, 0, _height]), [], 0, "NONE"]; [_x, _parachute] remoteExec ["moveInDriver", _x]; false } count _units; deleteMarker _dzMarker; fn_halodrop.sqf: /* Author: tryteyker Description: This script gives units parachutes, saves their backpackas and drops them at the specified position at the given height. Parameter(s): 0: GROUP, OBJECT or SIDE - units to use 1: POSITION - positin to drop units at 2: NUMBER - height to drop at Returns: BOOLEAN - true once all units have been processed Example _done = [west, 250] call ARC_fnc_haloDrop; */ private ["_units","_pos","_height"]; _units = switch (typeName (_this select 0)) do { case "GROUP": {units (_this select 0)}; case "OBJECT": {[(_this select 0)]}; case "SIDE": {allUnits}; }; _pos = _this select 1; _height = _this select 2; _processUnit = { private ["_haloPos","_backpackItems","_backpackType","_emptyShell"]; params ["_unit","_pos","_height"]; _haloPos = [(_pos select 0) + (random 100), (_pos select 1) + (random 100), (_pos select 2) + _height]; _backpackItems = backpackItems _unit; _backpackType = backpack _unit; _emptyShell = createVehicle ["GroundWeaponHolder", getPosATL _unit, [], 0, "CAN_COLLIDE"]; _emptyShell addBackpackCargoGlobal [_backpackType, 1]; removeBackpack _unit; _emptyShell attachTo [_unit, [-0.1, 0.8, 0.8]]; // This part may require tweaking as backpack may not end up in front of the unit. _emptyShell setVectorDirAndUp [[0,0,-1], [0,1,0]]; // This part adjusts the backpack to be upright. _unit addBackpack "B_Parachute"; _unit setPosATL _haloPos; // Unit starts dropping at this point. [_emptyShell, _backpackType, _backpackItems, _unit] spawn { params ["_emptyShell", "_backpackType", "_backpackItems", "_unit"]; while {(backpack _unit) == "B_Parachute"} do { sleep 1; switch (stance _unit) do { case "STAND": { _emptyShell attachTo [_unit, [-0.1, 0.8, 0.8]]; }; case "CROUCH": { _emptyShell attachTo [_unit, [-0.1, 0.9, 0.38]]; }; case "UNDEFINED": { // Stance during parachuting is 'undefined' _emptyShell setVectorDirAndUp [[0,-1,0], [0,0,-1]]; _emptyShell attachTo [_unit, [-0.1, -0.1, -0.6]]; }; }; }; _unit addBackpack _backpackType; clearAllItemsFromBackpack _unit; {_unit addItemToBackpack _x} forEach _backpackItems; deleteVehicle _emptyShell; }; }; if (typeName (_this select 0) == "SIDE") then { {if (side _x == (_this select 0)) then {[_x, _pos, _height] call _processUnit}} forEach _units; } else { {[_x, _pos, _height] call _processUnit} forEach _units; }; fn_haloprep.sqf (saves backpack, gives parachute, but does not drop unit above AO): /* Author: tryteyker Description: This script is a light version of the HALO Drop one, with the unit only being given a parachute. Parameter(s): GROUP, OBJECT or SIDE Returns: BOOLEAN - true once all units have been processed Example _done = west call ARC_fnc_haloPrep; */ private ["_units"]; _units = switch (typeName _this) do { case "GROUP": {units _this}; case "OBJECT": {[_this]}; case "SIDE": {allUnits}; }; _processUnit = { private ["_unit","_backpackItems","_backpackType","_emptyShell"]; _unit = _this; _backpackItems = backpackItems _unit; _backpackType = backpack _unit; _emptyShell = createVehicle ["GroundWeaponHolder", getPosATL _unit, [], 0, "CAN_COLLIDE"]; _emptyShell addBackpackCargoGlobal [_backpackType,1]; removeBackpack _unit; _emptyShell attachTo [_unit, [-0.1, 0.8, 0.8]]; _emptyShell setVectorDirAndUp [[0,0,-1], [0,1,0]]; _unit addBackpack "B_Parachute"; [_emptyShell, _backpackType, _backpackItems, _unit] spawn { private ["_emptyShell","_backpackType","_backpackItems","_unit"]; _emptyShell = _this select 0; _backpackType = _this select 1; _backpackItems = _this select 2; _unit = _this select 3; while {(backpack _unit) == "B_Parachute"} do { sleep 1; switch (stance _unit) do { case "STAND": { _emptyShell attachTo [_unit, [-0.1, 0.8, 0.8]]; }; case "CROUCH": { _emptyShell attachTo [_unit, [-0.1, 0.9, 0.38]]; }; case "UNDEFINED": { _emptyShell setVectorDirAndUp [[0,-1,0],[0,0,-1]]; _emptyShell attachTo [_unit, [-0.1, -0.1, -0.6]]; }; }; }; _unit addBackpack _backpackType; clearAllItemsFromBackpack _unit; {_unit addItemToBackpack _x} forEach _backpackItems; deleteVehicle _emptyShell; }; }; if (typeName _this == "SIDE") then { {if (side _x == _this) then {_x call _processUnit}} forEach _units; } else { {_x call _processUnit} forEach _units; }; These should all work, used the paradrop one in session yesterday and nobody died (just make sure, and make doubly sure if you're using ACE, that the wind is set to something reasonable, otherwise you'll experience things worse than Vietnam) (commented some code, changed setVectorDirAndUp to attachTo as the former is only responsible for making the backpack stand upright) 1 Share this post Link to post Share on other sites
spookygnu 563 Posted June 12, 2016 Thats good stuff mate. Thankyou muchly! I will try these out later. At work right now. I would ideally like to halo in open chute have the backpack attached and then swap once they land. Thats the scenario i am picturing. I'd like the player to nav their way to the DZ target from the halo on mission start. Do i run these from the init.sqf then? Share this post Link to post Share on other sites
tryteyker 28 Posted June 12, 2016 You can run these from anywhere. AddAction, init.sqf, up to you. Just make sure you've got a marker set up at the DZ, and if you are using multiple units make sure they are grouped together (fn_halodrop.sqf doesn't support array specifically, dunno why I never added that tbh) and then use group player or similar. 1 Share this post Link to post Share on other sites
spookygnu 563 Posted June 12, 2016 Cool. Will be having a look at this later then. Thankyou for your advice. Hopefully i can work something out. I've been really frustrated with it the past 2 days. I know tanoa is early dev release. But the scope for SF, HALO missions etc is quite wide. Looking forward to seeing it working eventually. Share this post Link to post Share on other sites
spookygnu 563 Posted June 12, 2016 Got it working from a bit of help from someone I know. thanks for the srcipt dude, works really well. Share this post Link to post Share on other sites
kylania 568 Posted June 12, 2016 Here's the demo mission you'd asked for but then edited out. :) Removed the CBA requirement and fixed a few specific things. Haloprep is included, but probably not needed. It's all loaded as functions instead of scripts since you'd want that instead for something you use repeatedly. Share this post Link to post Share on other sites
spookygnu 563 Posted June 13, 2016 Aah thats brill kylania. Thankyou. I will look at it and get my head around it it better. Last night I was a little inpatient and found a mate of mine online who gave me the line for the init.sqf to get it working. I and anyone else just needs to make sure they land on the ground and not in the trees or you will be calling medic. Took a bad fall last night and thought, "that's not good!" Lol. Share this post Link to post Share on other sites