Search the Community
Showing results for tags 'supoprt'.
Found 1 result
-
mgi scripts [HOW TO... SOLVED] drop a car instead of a crate with standard BI module
pierremgi posted a topic in ARMA 3 - QUESTIONS & ANSWERS
Hi all, I'm frequently scripting around BI modules overriding. I scripted some "multiple bombs" + "napalm" CAS for thus who knows MGI tactical pack addon. Today, I'd like to share a little script if you would like to drop a car (any vehicle) instead of a crate. Place a BI support module (virtual drop). It should work also with a real support. Not tested. Name it. Don't forget the BI support requester, sync modules as usual. In the BI module, write all vehicle types you want (helicopter classes existing in your cfgVehicles); In my example, as I'm fond of UNSUNG: ["uns_ach47_m200","uns_ch47_m60_army"] and this remark: the APEX V44 Blackfish ("B_T_VTOL_01_armed_F") is a plane but you can use it for faster drop! add what you want in the crate init, for example, I like to signal the crate with smoke/flare and add virtual arsenal on it: [_this,{ _this addAction ["<t color='#ffff11'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal},nil,10,false,true,"", ""]} ] remoteExec ["call"]; _flare = if (sunOrMoon <0.5) then [{"F_20mm_Yellow"},{"smokeShellYellow"}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]; Remark: this code is for standard drop of a crate, but will be overridden with vehicle code. add a simple calling code in the Vehicle init of the module (here vehicle is the helicopter, not the parcel!): _this spawn MGI_fnc_dropVeh with the following remark: I use to compile sqf in init.sqf: MGI_fnc_dropVeh = compileFinal preprocessFileLineNumbers "MGI_fnc_dropVeh.sqf"; (You can also directly execVM it, writing _this execVM "MGI_fnc_dropVeh.sqf" in vehicle init of the module). Now, the sqf code: MGI_fnc_dropVeh.sqf: Last version 03rd/08/18 _veh = _this; if !(_veh isKindOf "uns_ach47_m200") exitWith {}; comment "choose the helicopter class you want for car drop, the other ones will drop simple crates."; _home = getpos _this; _grpVeh = group _veh; sleep 3; _currentwpt = [_grpVeh, currentWaypoint _grpVeh]; _currentwptPos = waypointPosition _currentwpt; _currentwptdesc = waypointDescription _currentwpt; deleteWaypoint _currentwpt; _wpt = _grpVeh addWaypoint [_currentwptPos,0]; _wpt setWaypointDescription _currentwptdesc; _wpt setWaypointStatements ["TRUE", " if (isServer) then { [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', 'B_MRAP_01_hmg_f', this getVariable 'BIS_SUPP_selectedModule'] spawn { _pilot = _this select 0; _wpPos = _this select 1; _chuteType = _this select 2; _crateType = _this select 3; _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; _flare = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{'smokeShellYellow'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]""; comment 'optional remove the _crateCode line if you dont want an arsenal'; _oldDist = _pilot distance _wpPos; while {_oldDist >= _pilot distance _wpPos} do { _oldDist = _pilot distance _wpPos; sleep 0.1 }; _pilot setVariable ['BIS_SUPP_supporting', FALSE]; _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY']; _chute setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50]; _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE']; vehicle _pilot setVariable ['MGI_crate',_crate,true]; _crate call _crateCode; comment 'to be removed also, if the _crateCode line is removed above.'; _crate attachTo [_chute, [0, 0, 0]]; waitUntil {position _crate select 2 < 3 || isNull _chute}; detach _crate; _chute setVelocity [0,5,0]; vehicle _pilot setVariable ['MGI_crate',nil,true]; }; }; "]; _grpVeh setCurrentWaypoint _wpt; _wp2 = _grpVeh addWaypoint [_home, 0]; _wp2 setWaypointType "Move"; _wp2 setWaypointBehaviour "SAFE"; _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"]; _veh land "none"; waitUntil {!isnil {_veh getVariable "MGI_crate"}}; sleep 60; {deleteVehicle _x} forEach crew _veh; deleteVehicle _veh; Hope you'll have fun with that. An adapted version is now included in the MGI advanced Modules addon.