Jump to content

Search the Community

Showing results for tags 'mgi scripts'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Server tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Chernarus
  • TKO's Livonia
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 21 results

  1. AI VEHICLE RESPAWN SP/MP Hi all, Did you ever try the BI respawn vehicle module? That works well on empty ones, as far as you linked the vehicles to the module. With some disappointment trying to link a flying helicopter and see it (them!) falling to the ground. A little code in the "expression field" and, yeah, you create a new crew and a helo just hovering now! But, what if you want, not only the standard crew, but also the airborne assault squad into it? When? Where on helo track (waypoints)? And, why not respawning a crate? and the loadout for any respawned vehicle/crate? I suggest the following script to allow AI vehicle, manned or empty, but no player on board), respawning according to parameters. This works in SP or MP. Only vehicles (+ full crew if any) / crates are concerned as far as the respawn for killed infantry AI units is the object of a this other script. version December 06th 2018 parameters: VEHICLES / POSITIONS / DELAY / RESPAWN WHEN DISABLED / EMPTY VEHICLES (ALL) Examples: [] spawn MGI_fnc_vehicleRespawn // [] passed as parameter equals to [ [ ], "death", 10, false, true] All empty vehicles can respawn on their position at death, after 10 sec delay, without possibility to respawn if just disabled. [ [WEST,EAST], ["mrk1","death","start",""], nil, false,false ] spawn MGI_fnc_vehicleRespawn // equals to [ [WEST,EAST], ["mrk1","death"], 15, false,false] here, only WEST & EAST ai vehicles can respawn: - on the marker "mk1" if any, (on death position if marker not present), for BLUFOR vehicles - on the position of death for OPFOR vehicles, (other strings in positions array are useless), 10 second delay (default), without respawn when disabled. Code to be run on server (eventually on Headless Client). example: initServer.sqf if no HC. or inside a simple trigger in 3den, server only, non-repeatable, condition true ___________________________________________________________________ FIRST SCRIPT for a basic MGI_fnc_vehicleRespawn (with standard loadout, crew and waypoints, but no kept appearance, pylons, actions ,arsenal...): ___________________________________________________________________ SECOND SCRIPT (instead of first one) for MGI_fnc_vehicleRespawn (now adding skin, appearance, loadout, pylons and turrets config, actions menu). Tha's a step further, with integration of the two functions MGI_fnc_getVehicleLoadout and MGI_setVehicleLoadout for recovering the vehicle loadout after respawn: Enjoy! Pierre MGI Notes: - If you choose to respawn the disabled vehicles, these will be destroyed (then respawned), probably earlier than for the normal destruction. Destruction occurs sooner but not before the crew leaves the vehicle. So, if you allow crew staying inside immobilized vehicle, this "respawn on disabled" is postponed until destruction by enemy or abandon. - using the second scrip^t, some behaviors like custom loadout and actions menu needs to fire the EH handle damage. That is to say, you have to damage the vehicle in-game (firing at it), not using a simple setDamage via debug console (this command doesn't trigger the EH). Also, let some seconds after mission start (Arma engine actions menu returm something for the actionParams). Version 13112018: added possibility to "respawn" the code written in init field of a vehicle. You just need to write it this way: instead of <your code> write: this setVariable ["MGIcustomCode", ' <your code> ' ]; call compile (this getVariable "mgiCustomcode") Pay attention for double and single quote! Example: in normal init field, you can write: 0 = [] spawn {waitUntil {!isNull player}; hint ("hello "+ (name player))} Here you need to write: this setVariable ["MGIcustomCode", ' 0 = [] spawn {waitUntil {!isNull player}; hint ("hello "+ (name player))} ' ]; call compile (this getVariable "mgiCustomcode") Version 06122018: improved jets respawn. Version 09102019: spawning vehicles on carrier at sea. Version 13103019: fuel management and some extra cases
  2. AI REVIVE/HEAL SP/MP Last update 26th/11/2018 Hi all, Here is a script to allow AIs reviving and healing bros, according to parameters. This works in SP or MP. Compatible so far with AI RESPAWN script (see tag) Don't override the respawn system (MP) Incapacitation: This script relies on incapacitated status for players or AIs. This status is created when not existing (SP, or MP Ais) to allow revive scenario. parameters: REACT / HEAL DELAY / AI CAN REVIVE / KIT NEEDED / NEED MEDIC / AI CAN HEAL EXTRA GRP / BROS / WHITE FLAG ON MEDIC IN ACTION Parameters can be added to description.ext, class Params, just add what you want in classes: "react" "bleedOut" "noReviveForAI" "AiKit" "AiMedic" "bros" "whiteflag". So you can choose them while in lobby. Anyway, if you pass parameters calling the function, these params will override the lobby ones (except for bros class, see below). Code must run on all PCs. So, init.sqf, (trigger, non-repeatable, condition true)... Totally reworked (see below). EDITED: version with added parameter (see spoiler above. Should work fine in MP. Feedback welcome. Added possibility for multiple call lines. Last version with waypoints instead of domove + added parameter "white flag". Added one check more for distance form medic to wounded. What's a bro? - A bro is a unit (AI or player) who can be revived while unconscious, if some conditions are met (hard coded like within 200 m of another bro, or configured). In case of several healer candidates, the closer is elected. - That's also a unit able to heal unconscious unit (SP/MP) under the same conditions. But here, player(s) are not engaged in the process. They can heal but if an AI meet the conditions, this one will start the process. So, healer/healed is the same family: Bros. In which, the players are free to heal or not. How bros work (7th param or description.ext param class: bro ) - in SP, bros are switchable units by default. You can override this, passing a 7th param when calling MGI_fn_Revive, as shown in example (last code line). - in MP, * if bros class is present in description.ext, you can't override it; You have to choose one of the two settings: playable units or side player. Your description.ext should look like this (specifically for bros class): Bros = all players as default parameter means you can have different side and bros can heal anywhere.. if conditions are met. Keep on mind that disabled AI (slots) in lobby don't have existence and playableUnits = allPlayers (all playing guys), and not all playable units as in editor. So, each time you can let the slot as AI enabled, it's better. The list is updated anyway. The other possible parameter is set as WEST here. * if these parameters are not fine for your scenario, you can modify the bros class but you have to change the working line referring to your values: In the main function MGI_fn_Revive, look for: if (MGI_bros isEqualType 0) then { MGI_bros = [switchableUnits+playableUnits, WEST] select ("bros" call BIS_fnc_getParamValue); <<<<< THIS LINE CAN BE MODIFIED: [<your default array of bros>,<another choice>] select ("bros" call BIS_fnc_getParamValue) } else { MGI_bros = _MGI_bros }; * You can also delete the bros class in description.ext, and sets the 7th parameter as shown in the following example: [nil,nil,nil,nil,nil,nil,east] call MGI_fn_Revive; This way, here EAST will take place of the missing (and non over-writable) bros class. The other parameters are set to nil, for not overriding the other existing classes. * Don't forget, there is nothing mandatory, neither description.ext parameters, nor function parameters (See default above). You can add any unit in "bros" team, just setting a variable: yourUnit (or cursorTarget) setVariable ["passedBros",true,true]; Extra Examples: call MGI_fn_Revive // parameters are default ones, or defined by your description.ext: standard usage in MP (allowing parameters in description.ext) [nil,nil,nil,nil,nil,nil,east] call MGI_fn_Revive; // MP reworked/added side , class bros removed, other classes in description.ext [30,60,true,0,false,1,independent] call MGI_fn_Revive; // this will override the mission MP parameters in lobby, except the independent if bros class exist! Better usage for SP or even, in MP: [nil,nil,nil,nil,nil,nil,west,false] call MGI_fn_Revive; sleep 2; [nil,nil,nil,nil,nil,nil,east,false] call MGI_fn_Revive; Don't forget! bros class must be inactive/deleted in description.ext
  3. Hi all, Here is a new mission for Iron Front AIO at Omaha Colleville (CUP terrains). The SP / MP revive heal should work fine! Have fun! https://steamcommunity.com/sharedfiles/filedetails/?id=1537586400
  4. 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.
  5. MGI ADVANCED MODULES Hi all, Here is an addon for mission makers. If you need to easily spawn some factions, some civilian life or just add randomized weapons loot in houses... If you want an advanced AI heal & revive, for SP or MP mission, able to heal players or bros.. If you want a transport support on any vehicle... A vehicle respawn system with crew, waypoints, loadouts, addActions, arsenal.... Friendly kill sanction... AI cannons able to fire HE shells on infantry... Some generators able to switch on/off a district... or adapt silencers to combat behavior... or perhaps a simple tool for reading all map object classes/display names/p3d model names... Other tools like tire puncture on barbed wires? ... And of course, MP compatible, favorite mods compatible... Here you are. https://steamcommunity.com/sharedfiles/filedetails/?id=1682280809 Adapt silencers to stealth/combat situation No video SP/MP compatible - all mods Advanced locations (spawning factions on areas) See video SP/MP compatible - all mods Advanced transport See video SP/MP compatible - all mods AI can respawn No video SP/MP compatible - all mods Civilian life See video SP/MP compatible - some known mods Drop vehicle instead of crate See video SP/MP compatible - all mods Enhanced Turrets No video SP/MP compatible - all mods (so far. feedback welcome) Flip overturned vehicle No video SP/MP compatible _ all mods HALO jump No video SP/MP compatible - all mods Heal & revive see video SP/MP compatible - check for mods... Modded units are not a problem. But some mods like ACE have their own scripts and could be incompatible. Furthermore, I scripted for some conditions about the presence of FirstAidKit and MediKit. This module is complex enough. I didn't grab into mods for exotic classes of items (and I will not). Of course, you can choose to skip these conditions. Kill punishment See video SP/MP compatible -all mods Loot weapons & items in houses See video SP/MP compatible - some mods (CUP UNSUNG IFA3 RHS R3F) Marker to Task See video SP/MP compatible - all mods Respawn vehicles No video (see an old one about script to have an idea) SP/MP compatible - all mods Important note: This module uses EH handleDamage. This EH doesn't work if you apply something like: testedVehicle setDamage 1 from console. The script needs some hits on parts (updating vehicle data before destruction). So, crew and waypoints will be respawned after a current kill/disabled vehicle in game. SP simple respawn No video Single Player only Switch ambient lights See video SP/MP compatible - all mods so far... Tire puncture No video SP/MP compatible - some mods Touch of class! See video SP/MP compatible - all mods Wear what you want No video SP / MP compatible - all mods (not all. Some weird mods don't have true uniforms but some skinned units... Nothing to do with that) One man tank No video SP/MP compatible - all mods with Tanks or APCs Prisoners See video SP/MP compatible (not fully tested in MP) - all mods so far Have fun! Pierre MGI
  6. MGI HALO JUMP Last update 17/09/2018 Hi all, Here is a little script to make an object as HALO JUMP base. All AI group units with 100 m of the caller will perform the jump. Other players are not concerned. Required: at least one object to add this HALO jump action. parameters: JUMP ALTITUDE / SAFETY ALTITUDE / THIS (object init field) / AI GROUP example: 0 = [this,2000,90] execVM "MGI_HALO.sqf" // in init field of a pole. or simply: car1 execVM "MGI_HALO.sqf" // 2000 ,90 and true are params by default. MGI_HALO.sqf : params [["_pole",objNull,[objNull]],["_jump_alt",2000,[0]],["_jump_safety",90,[0]]]; MGI_compHALO = compileFinal " _plyr = _this; MGI_fnc_orient = { _obj = _this select 0; _p = _this select 1; _obj setVectorDirAndUp [ [ 0,cos _p,sin _p], [[0,-sin _p,cos _p],0] call BIS_fnc_rotateVector2D ] }; _plyr setVariable ['bpk',unitBackpack _plyr]; if (backpack _plyr != '') then { _whs = createVehicle ['WeaponHolderSimulated_Scripted',getpos _plyr,[],0,'can_collide']; _plyr action ['DropBag', _whs, typeOf (_plyr getVariable 'bpk')]; ['EHid','onEachFrame', { params ['_plyr','_whs']; if (backpack _plyr != 'B_parachute') then { _plyr action ['dropBag', _whs, typeOf (_plyr getVariable 'bpk')]; _plyr action ['AddBag', _whs, 'B_Parachute'] }; call{ if (stance _plyr == 'UNDEFINED') exitWith { _whs attachTo [_plyr,[-0.1,-0.05,-0.7],'leaning_axis']; [_whs,-180] call MGI_fnc_orient }; if (stance _plyr != 'UNDEFINED') exitWith { _whs attachTo [_plyr,[-0.1,0.75,-0.05],'leaning_axis']; [_whs,-90] call MGI_fnc_orient }; }; if (isNil {_plyr getVariable ['bpk',nil]}) then { ['EHid', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler }; },[_plyr,_whs] ] call BIS_fnc_addStackedEventHandler }; "; waitUntil {time >0 && count allPlayers >0 }; _pole addAction ["<t color='#00ffff'>HALO jump for group (AI)</t>",{ params ["_target","_caller","_id","_parameters"]; openmap [true,false]; titleText["Select Map Position", "PLAIN"]; _parameters params ["_jump_alt","_jump_safety"]; ["Jump","onMapSingleClick", { 0 cutText ["","black",0.01,true]; params ["","_pos","","","_jump_alt","_jump_safety","_MGI_forSquad"]; _caller = player; _MGI_units = (units _caller) select {local _x && alive _x && _x distanceSqr _caller < 100000 && isnull objectParent _x}; { [_x,_forEachIndex,_pos,_jump_alt,_jump_safety] spawn { params ["_unit","_index","_pos","_jump_alt","_jump_safety"]; private ["_bpk","_bpktype","_whs","_para"]; if (isPlayer _unit) then { _unit call MGI_compHALO; }; uisleep 2; _unit allowDamage false; _unit setPos [(_pos select 0)-60 + random 30,(_pos select 1) -60 + random 30, (_jump_alt max 200) + (12 *_index)]; waitUntil {(getpos _unit select 2) > _jump_safety -50}; uisleep 0.2; if (isPlayer _unit) then { _bpk = _unit getVariable "bpk"; _bpktype = typeOf (_unit getVariable "bpk"); _whs = objectParent _bpk; _unit addBackpackGlobal "B_parachute"; }; 0 cutText ["","black in",1,true]; waitUntil {(getpos _unit select 2) < ([_jump_safety max 90,_jump_safety] select (isPlayer _unit)) +20 or (!isnull objectParent player) }; if (!isplayer _unit) then { uisleep 0.8; _chute = createVehicle ["Steerable_Parachute_F", getpos _unit, [], 0, "can_collide"]; _unit moveInDriver _chute; } else { _unit allowDamage true; if (!isTouchingGround _unit) then { _unit action ["OpenParachute", _unit]; } }; _para = objectParent _unit; waitUntil {!isnull _para}; _para allowDamage false; waitUntil {sleep 0.5; (isTouchingGround _unit && isNull _para) or surfaceIsWater (getpos _unit) or !alive _unit}; if (isPlayer _unit) then { _unit setVariable ["bpk",nil]; waitUntil {isNull _para}; deleteVehicle _para; sleep 0.5; detach _whs; if (!isNull _whs) then { _unit action ["AddBag",objectParent _bpk, _bpktype]; sleep 2; deleteVehicle _whs; }; } else { uisleep 2; _unit allowdamage true; }; }; } forEach _MGI_units; openmap [false,false]; ["Jump","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; false },_parameters] call bis_fnc_addStackedEventHandler; },[_jump_alt,_jump_safety], 5,false, true,"","vehicle _this == _this"]; _pole addAction ["<t color='#00ffff'>HALO jump solo</t>",{ params ["_target","_caller","_id","_parameters"]; openmap [true,false]; titleText["Select Map Position", "PLAIN"]; _parameters params ["_jump_alt","_jump_safety"]; ["Jump","onMapSingleClick", { 0 cutText ["","black",0.01,true]; params ["","_pos","","","_jump_alt","_jump_safety","_MGI_forSquad"]; _caller = player; [_caller,_pos,_jump_alt,_jump_safety] spawn { params ["_unit","_pos","_jump_alt","_jump_safety"]; private ["_bpk","_bpktype","_whs","_para"]; _unit call MGI_compHALO; uisleep 2; _unit allowDamage false; _unit setPos [_pos select 0,_pos select 1, (_jump_alt max 200)]; waitUntil {(getpos _unit select 2) > _jump_safety -50}; uisleep 0.2; _bpk = _unit getVariable "bpk"; _bpktype = typeOf (_unit getVariable "bpk"); _whs = objectParent _bpk; _unit addBackpackGlobal "B_parachute"; 0 cutText ["","black in",1,true]; waitUntil {(getpos _unit select 2) < _jump_safety max 90 or (!isnull objectParent player) }; _unit allowDamage true; if (!isTouchingGround _unit) then { _unit action ["OpenParachute", _unit]; }; _para = objectParent _unit; waitUntil {!isnull _para}; _para allowDamage false; waitUntil {sleep 0.5; (isTouchingGround _unit && isNull _para) or surfaceIsWater (getpos _unit) or !alive _unit}; if (isPlayer _unit) then { _unit setVariable ["bpk",nil]; waitUntil {isNull _para}; deleteVehicle _para; sleep 0.5; detach _whs; if (!isNull _whs) then { _unit action ["AddBag",objectParent _bpk, _bpktype]; sleep 2; deleteVehicle _whs; }; } else { uisleep 2; _unit allowdamage true; }; }; openmap [false,false]; ["Jump","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; false },_parameters] call bis_fnc_addStackedEventHandler; },[_jump_alt,_jump_safety], 5,false, true,"","vehicle _this == _this"]; Now, you can choose in game if you HALO jump solo or in group (AI fellows within 320 meters). Have fun
  7. Hi all, Need some tools to create your mission or spice it? I created an addon for mission markers. Do not hesitate to ask how things work and report any bug. I'll reply to suggestions and I'll share scripts as usual.
  8. IN GAME TASKS ON MARKERS Hi all, Here is a little script to create some tasks while in game, just placing markers on map. EDITED: 23/12/2018 parameters: none There is no parameters. Just place some map markers. The available markers are "OBJECTIVE" "AMBUSH" "DESTROY" "PICK UP" "JOIN" (like actions for units). All others remain standard markers. Channel: As markers come with selectable channel "GLOBAL" "SIDE" "COMMAND" "GROUP" "VEHICLE", the automated task will be displayed for the same channel. So, don't forget a global marker will create a global task, and so on. Task deletion: There are 2 ways for deleting a task: - try to delete the red circle marker below the task marker. Not easy. Usually works when you catch the marker owner name in MP. - go to task description and click on "Delete task" It's an active link. Associated action: At this time, there is no difference between the type of tasks. These tasks are like some 3D markers and are displayed as tasks. But there is no condition for completion. That means, these tasks can be CREATED or ASSIGNED but never COMPLETED or CANCELED. They can be deleted. Extra feature: In task description, you can click on "GO GO GO" link. This will order the concerned units (CHANNEL) to move at the task destination. You can order a task for the side, then order another task for your group. This, you can have two different objectives. But, please, keep on mind AIs will obey to the last order. So, have some players coordination in MP. That's the main reason why the move order is not automatic. You can create all tasks you need as 3D markers, then decide to order or not a movement for units. All comments, ideas are welcome! Run this code on initPlayerLocal.sqf or any script running with interface (player). A condition true trigger works also. Thanks Pierre MGI
  9. ADAPT SILENCERS TO COMBAT/STEALTH SITUATION Hi all, Did you remark that AIs don't adapt their muzzle sound suppressor (silencer) with the ordered situation (STEALTH / COMBAT)?. Here is a little code for adding/removing existing silencer on current weapon. Notes: - by "existing", I means the silencer must be on weapon or inside unit's gear. Furthermore, as you can start with an already equipped silencer and no more room in gear, this script will record that in a variable and will be able to re-fit the silencer on weapon instead of losing him due to the lack of room. (a kind of extra pocket). - MP compatible but I intentionally worked at idle for better performance. If your unit's localization (PC owning it) is supposed to change, You'll need to make the variable broadcast (adding true as 3rd parameter). And, that's for the specific case your unit need the "extra pocket". - players are not concerned, but it's easy, for automatic adapted muzzle, to remove the isPlayer condition. - for performance, this script is not "on each framed". It could be. I chose to fire the code using the "animChanged" EH. In some cases, the unit can start to fire without changing its animation. So, try to order the new behavior in advance (Anims often change anyway). - some silencer can be non-removable, hard-coded with model, or simply don't exist! There is nothing to do with that. It's up to you to choose the right weapon. Tested on Vanilla and CUP. For other mods, have your own test. This will depend on how silencer classes are named. version Nov. 20th 2018 parameters: NONE { _x addEventHandler ["AnimChanged", { params ["_unit","","_silencer"]; if (!isplayer _unit) then { if (isnil {_unit getVariable "MGI_silencer"}) then { _unit setVariable ["MGI_silencer",[]] }; _silencers = (items _unit select {["_snds",_x] call bis_fnc_instring}) + (weapons _unit apply {_unit weaponAccessories _x param [0, ""]} select {_x != ""}) + (_unit getVariable "MGI_silencer"); call { if (behaviour _unit == "COMBAT" && {isNull objectParent _unit} && {_unit weaponAccessories currentMuzzle _unit param [0, ""] != ""}) exitWith { _silencer = _unit weaponAccessories currentMuzzle _unit param [0, ""]; call { if (currentWeapon _unit isEqualTo primaryWeapon _unit) exitWith { _unit removePrimaryWeaponItem _silencer; }; if (currentWeapon _unit isEqualTo handGunWeapon _unit) exitWith { _unit removeHandGunItem _silencer; }; }; call { if (_unit canAddItemToBackpack _silencer) exitWith { _unit addItemToBackpack _silencer; }; if (_unit canAddItemToVest _silencer) exitWith { _unit addItemToVest _silencer; }; if (_unit canAddItemToUniform _silencer) exitWith { _unit addItemToUniform _silencer; }; (_unit getVariable "MGI_silencer") pushBackUnique _silencer; }; }; if (behaviour _unit == "stealth" && {isNull objectParent _unit} && {_unit weaponAccessories currentMuzzle _unit param [0, ""] == ""}) exitWith { {_unit addWeaponItem [currentWeapon _unit,_x]} count _silencers; _silencer = _unit weaponAccessories currentMuzzle _unit param [0, ""]; if (_silencer in (_unit getVariable ["MGI_silencer",[]])) then { _unit setVariable ["MGI_silencer", (_unit getVariable "MGI_silencer") - [_silencer]]; } else { if (_silencer in items _unit) then {_unit removeitem _silencer}; }; }; }; }; }] } forEach (playableUnits + switchableUnits);
  10. Hi all, If you used to play on Kunduz, Afghanistan map, you remarked the doors of any building are not active. Here is a simple code to add in initPlayerLocal.sqf to make them work. (Create it in mission root if missing) if (modParams ["@Kunduz, Afghanistan", ["active"]] param [0,false]) then { inGameUISetEventHandler ["action"," private _intersects = []; if (_this select 4 == 'Close Door' or _this select 4 == 'Close Window') then { _anims = 'true' configClasses (configfile >> 'CfgVehicles' >> typeof cursorObject >> 'AnimationSources') apply {configName _x}; { _intersects = ([cursorObject, _x] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]); if (count (_intersects select 0) > 0) exitwith {_intersects} } forEach ['VIEW','GEOM','FIRE']; if (count _intersects > 0) then { _select_door = (_intersects select 0) select 0; { if (count _anims > 0 && {[_select_door,_x] call Bis_fnc_inString}) exitWith { cursorObject animateSource [_x, 0];true}; false } forEach _anims; }; }; if (_this select 4 == 'Open Door' or _this select 4 == 'Open Window') then { _anims = 'true' configClasses (configfile >> 'CfgVehicles' >> typeof cursorObject >> 'AnimationSources') apply {configName _x}; { _intersects = ([cursorObject, _x] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]); if (count (_intersects select 0) > 0) exitwith {_intersects} } forEach ['VIEW','GEOM','FIRE']; if (count _intersects > 0) then { _select_door = (_intersects select 0) select 0; { if (count _anims > 0 && {[_select_door,_x] call Bis_fnc_inString}) exitWith { cursorObject animateSource [_x, 1];true};false } forEach _anims; }; }; "]; }; Have fun on this beautiful map. Updated Nov. 20th 2018 (see comments)
  11. Hi all, Remember FURY? An American Sherman, lost in core of Germany, surrounded by Nazi troops. STEAM link: https://steamcommunity.com/sharedfiles/filedetails/?id=1560958858 Here, the scenario takes place at Zargabad, (a fine CUP map). Your crew of 4 plus a US soldier are stuck in the middle of a Taliban's nest. Your Abrams is out of order and out of gas. Challenge is simple: Repair the Abrams, refuel it and escape!... Perhaps. The mission is SP or MP up to 5 players, with HEAL & REVIVE feature for AIs and player(s)! You can heal or be healed in both SP MP but it's preferable to play in "MP one player" for mission parameters. You will be leader what ever the slot you choose. In SP, you don't die. AIs fellows can heal you as you're unconscious. If not, you'll respawn after 2 minute bleed out. You can heal them as well. You can enable/disable Arsenal crates for players. So, required mods are CUP only (+CBA as dependency). I recommend also: - enhanced movement (even if this is not the best corner of map for using it); - MGI tactical pack, for beginners or smart players (not using the whole stuff, but you can stick charges on vehicles) Have fun!
  12. Hi all, As announced in DAGUET scenarii, (see mgi missions red tag), this is the Vanilla version of the ALAMO style scenario. This mission remains a coop for 9 max at MALDEN, but can be accomplished in SP. However, the difficulty can appear at higher level, due to the choice of the position of the camp. Your mission is to hold the abandoned labs, north of Malden. Already known feature: SP or MP with HEAL & REVIVE feature for AIs and player(s)! In SP, you don't die. AIs fellows can heal you as you're unconscious. If not, you'll respawn after 2 minute bleed out. You can save them as well. You can enable/disable Arsenal crates for players. So, no required mods but strongly recommended ones: - JSRS sound mod (a must for vanilla missions, imho); - enhanced movement (even if this is not the best corner of map for using it); - MGI tactical pack, for beginners or smart players (not using the whole stuff). Have fun! https://steamcommunity.com/sharedfiles/filedetails/?id=1546429976
  13. Hi all, Mission coop for 9 max at SHAPUR, but can be accomplished in SP. SP or MP with HEAL & REVIVE feature for AIs and player(s)! Yes! In SP, you don't die. AIs fellows can heal you as you're unconscious. If not, you'll respawn after 2 minute bleed out. You can save them as well. Your mission is to hold the factory as Alamo point. You can enable/disable Arsenal crates for players. See on Steam for all required mods (R3F except bugged R3F objects, RHS, CUP terrain for Shapur, EricJ talibans for uniforms) . Have fun! https://steamcommunity.com/sharedfiles/filedetails/?id=539562506
  14. Hi all, Here is a versatile mission, working in SP or MP with HEAL & REVIVE feature for AIs and player(s)! Yes! In SP, you don't die (except out of oxygen) and AIs fellows can heal you as you're unconscious. You can save them as well. Your mission is to establish a F.O.B. then reconquer Malden. The main objective is the Northern Red Airfield but you can raid over the map and accept some secondary objectives. There is a civilian life here. Not really cooperative; Sometimes hiding a kamikaze! So stay sharp! You can disable these features in MP parameters. It's possible to HALO jump from base and FOB, solo or in group. Have fun with that! Just discover other in game possibilities, like jumping into a friendly helo and ordering where you want to go. You can enable/disable Arsenal crates for players, find equipment loot in houses... Supply drop support has been modified. Read Hints & Tips at Briefing. NO MOD REQUIRED. Have fun! https://steamcommunity.com/sharedfiles/filedetails/?id=1410293352&searchtext=
  15. AI INFANTRY RESPAWN SP/MP Hi all, Here is a script to allow AIs respawning according to parameters. This works in SP or MP. Only infantry (on foot AI) concerned as far as the killed AIs while in vehicles is the object of a second script. parameters: SIDES / POSITIONS / DELAY / MIN UNITS IN GROUPS / REMAINING LOADOUT Examples: [] spawn MGI_fnc_unitRespawn // [] passed as parameter equals to [ [WEST,EAST,RESISTANCE,CIVILIAN], "start", 10, 144, false] All ai units can respawn on their position at start, after 10 sec delay, with their initial loadout. [ [WEST,EAST], ["mrk1","death","start",""], nil, 3 ] spawn MGI_fnc_unitRespawn // equals to [ [WEST,EAST], ["mrk1","death"], 15, 3, false] here, only WEST & EAST ai units can respawn: - on the marker "mk1" if any, on death position if not, for BLUFOR - on the position of death for OPFOR, (other strings in positions array are useless), 10 second delay (default), if their group headcount is below 3 (delay already started at death), with their initial loadout. Code to be run on server. (trigger, server only, non-repeatable, condition true) or initServer.sqf
  16. REPACK and AUTO REPACK scripts Hi all, Here are two scripts (addon is scheduled) for those you want to repack their magazines. First one is a simple auto-repack. No action needed. Based on a simple EH, the code runs when the player fires, so the auto-repack needs has a "one round latency" to work. Not a real problem. Second one is more "realistic". Player must open the inventory and double click on each kind of mags to be repacked. Parameters: NONE AUTO-REPACK to be placed in initPlayerLocal.sqf or in init.sqf when player is defined. player addEventHandler ["fired",{ if (player == _this select 0 && vehicle player == player) then { _mags = magazinesAmmo player; _inv = _mags select {(_x select 0) in getArray (configFile >> "cfgWeapons" >> currentWeapon player >> "magazines")}; if (count _inv > 1) then { _sort = [_inv,[],{_x select 1},"ASCEND"] call BIS_fnc_sortBy; _lowest_mag = _sort select 0 select 0; _lowest_cnt = _sort select 0 select 1; _mags_space = _sort select [1, count _sort - 1]; _full_tot = 0; _remain_tot = 0; {_full_tot = _full_tot + getnumber (configFile >> "cfgmagazines" >> _x select 0 >> "count")} forEach _mags_space; {_remain_tot = _remain_tot + (_x select 1)} forEach _mags_space; _full_space = _full_tot - _remain_tot; if (_lowest_cnt <= _full_space) then { for "_i" from 0 to count _mags_space - 1 do { if (_lowest_cnt > 0) then { _current_mag = _mags_space select _i select 0; _current_ammo = _mags_space select _i select 1; _current_space = getnumber (configFile >> "cfgmagazines" >> _current_mag >> "count") - _current_ammo; if (_current_space > 0) then { _mags_space set [_i,[_current_mag,_current_ammo + _lowest_cnt]]; _lowest_cnt = _lowest_cnt - _current_space; }; }; }; {player removeMagazineGlobal (_x select 0)} forEach (magazinesAmmo player select {(_x select 0) in getArray (configFile >> "cfgWeapons" >> currentWeapon player >> "magazines")}); {player addMagazine _x} forEach _mags_space; }; }}; }]; MAGAZINE REPACK to be placed in initPlayerLocal.sqf or in init.sqf when player is defined. MGI_fnc_repack = { _idc = ctrlIDC (_this select 0); _selectedIndex = _this select 1; player setVariable ["MGImags", +((magazinesAmmoFull player) select {(lbdata [_idc,_selectedIndex]) in _x})]; player setVariable ["MGIselect", true]; false }; 0 = [] spawn { while {true} do { waitUntil {!(isnull (finddisplay 602)) && isnil {player getVariable "MGIselect"}}; ((findDisplay 602) displayCtrl 619) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; ((findDisplay 602) displayCtrl 633) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; ((findDisplay 602) displayCtrl 638) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; waitUntil {!isnil {player getVariable "MGIselect"} or isNull (findDisplay 602)}; if (!isnil {player getVariable "MGIselect"}) then { private ["_mag","_wpnType","_wpn"]; if (player getVariable ["MGImags",[]] isEqualTo []) then { _mag = ""; _wpn = "" } else { _cnts = 0; _mag = (player getVariable "MGImags") select 0 select 0; _fullcnt = getnumber (configFile >> "cfgmagazines" >>_mag >> "count"); if (_fullcnt > 0) then { { _wpnType = _x select 3; switch (_wpnType) do { case 1: {_wpn = primaryWeapon player}; case 2: {_wpn = handGunWeapon player}; case 4: {_wpn = secondaryWeapon player}; default {_wpn =""}; }; _cnts = _cnts + (_x select 1); player setammo [_wpn,0]; } count (player getVariable ["MGImags",[]]); _remainingShots = _cnts mod _fullcnt; {player removeMagazineGlobal _mag} count (player getVariable ["MGImags",[]]); player addMagazines [_mag, floor (_cnts/_fullcnt)]; if (_remainingShots >0) then { player addMagazine [_mag,_remainingShots]; }; reload player; }; }; player setVariable ["MGIselect", nil]; }; }; }; Double click on any magazine in your inventory.
  17. WEAR WHAT YOU WANT Hi all, Fed up with the cloth restriction? You can kill civilians but not wear their clothes! You want to infiltrate enemy player places but you can't wear their uniforms. You can't count the threads about forceAddUniform with any interest in game, except for some specific action... If you want to wear what you find on corpses, crates, or ground.. just add the following code for each allowed players (initPlayerLocal.sqf seems great). Just make sure player is already defined. version Mar 13th 2018 updated 21/06/18 parameters: NONE fnc_otherUnif = { params ["_type","_return"]; if (_type == 0) exitWith { MGI_button = _return select 1; false }; if (_type == 1 and !isnil "MGI_button" && {MGI_button == 1}) then { disableSerialization; _control = _return select 0; _index = _return select 1; private _idc = ctrlIDC _control; private _text = lbText [_idc, _index]; private _picture = lbPicture [_idc,_index]; private _uniforms = ("getText (_x >> 'displayName') == _text && getNumber (_x >> 'ItemInfo' >> 'type') == 801" configClasses (configFile >> "CfgWeapons")); if (count _uniforms > 0) then { [_idc,_text,_picture,_index,_uniforms] spawn { params ["_idc","_text","_picture","_index","_uniforms","_selectedUnif","_unifContClasses",["_uniformObject",objNull],["_selectedInvent",[]],"_items","_otherItems","_g0"]; _currentUnif = uniform player; _currentInvent = uniformItems player; _selectedUnif = ((_uniforms select {toLower (gettext (_x >> "picture")) splitString "\"joinString "\" == _picture}) apply {configName _x}) select 0; if !(pl_container isKindOf "CAManBase") then { _unifContClasses = (everyContainer pl_container select { (_x select 0) select [0,2] == "U_" or ["_U_",(_x select 0)] call bis_fnc_instring or ["uniform",(_x select 0)] call bis_fnc_instring}); _cnt = 0; for "_i" from 0 to _index do { if (lbText [_idc,_i] == _text) then { _cnt = _cnt +1; _uniformObject = _unifContClasses select {_selectedUnif == (_x select 0)} select (_cnt -1) select 1 }; }; } else { _uniformObject = uniformContainer pl_container }; _selectedInvent = []; {_selectedInvent pushback _x} foreach (itemCargo _uniformObject); if (magazineCargo _uniformObject isEqualType []) then { {_selectedInvent pushback _x} foreach (magazineCargo _uniformObject); }; if !(pl_container isKindOf "CAmanbase") then { _items = +itemCargo pl_container; _unifItems = _unifContClasses apply {_x select 0}; _vestContClasses = (everyContainer pl_container select { (_x select 0) select [0,2] == "V_"}); _vestItems = _vestContClasses apply {_x select 0}; _otherItems = +_items - _unifItems - _vestItems; pl_container setVariable ["allconts",_unifContClasses+_vestContClasses]; for "_i" from 0 to count (_unifContClasses+_vestContClasses) -1 do { if (((pl_container getVariable "allconts") select _i) select 1 == _uniformObject) exitWith { (pl_container getVariable "allconts") deleteAt _i }; }; pl_container setVariable ["allconts", +(pl_container getVariable "allconts") apply {[_x select 0, itemCargo (_x select 1), magazineCargo (_x select 1)]}]; _g0 = pl_container; clearItemCargoGlobal _g0; } else { _g0 = createVehicle ["WeaponHolderSimulated_Scripted", (player modelToWorld [0,1,1]), [], 0, "CAN_COLLIDE"] }; player forceAddUniform _selectedUnif; {player addItemToUniform _x} forEach _selectedInvent; call { if (pl_container isKindOf "CAManBase") exitWith { removeUniform pl_container }; { _x params ["_cont",["_it",[]],["_mag",[]]]; pl_container addItemCargoGlobal [_cont,1]; _createdCont = pl_container call MGI_lastCont; {_createdCont addItemCargoGlobal [_x,1];true} count _it; {_createdCont addMagazineCargoGlobal [_x,1];true} count _mag; } forEach (pl_container getVariable ["allconts",[]]); {_g0 addItemCargoGlobal [_x,1]} forEach _otherItems; }; _g0 addItemCargoGlobal [_currentUnif,1]; _lastCont = _g0 call MGI_lastCont; {_lastCont addItemCargoGlobal [_x,1]} forEach _currentInvent; if (_g0 isKindOf "WeaponHolderSimulated" && {(count itemCargo _g0 + count magazineCargo _g0 + count weaponCargo _g0 + count backpackCargo _g0) == 0}) then { deleteVehicle _g0 }; }; }; }; MGI_button = 0; false }; MGI_lastCont = compileFinal " params [['_cont',objNull]]; private '_lastCont'; _invent = (everyContainer _cont - (everyBackpack _cont apply {[typeOf _x,_x]})); if !(_invent isEqualTo []) then { _lastCont = _invent select (count _invent -1) select 1; } else { _lastCont = _cont; }; _lastCont "; player addEventHandler ["InventoryOpened", { params ["_unit", "_container"]; pl_container = _container; [] spawn { waitUntil {!(isNull findDisplay 602)}; disableSerialization; {(findDisplay 602 displayCtrl _x) ctrlAddEventHandler ["MouseButtonClick", "[0,_this] call fnc_otherUnif"]} forEach [632,640]; {(findDisplay 602 displayCtrl _x) ctrlAddEventHandler ["LBSelChanged", "[1,_this] spawn fnc_otherUnif"]} forEach [632,640]; }; }] USAGE: just right click on uniform you want to wear. NOTE: seems a long code for forcing to wear a uniform? Just feel free to optimize without downgrading a working code on crates, corpses, or ground without multiplying gears or losing items...
  18. MGI ENHANCED TURRET Last update 09/05/2018 Hi all, Here is a little script allowing AI gunners to fire HE shells on infantry. I hoped Tank DLC will improve some AI features about targeting and ammo firing possibilities, but it seems not. So, running this script makes gunners load some accurate shells to fire with cannon. It's complementary to MGs. On the other hand, I tried to overwrite the targeting engine as far as the present BI one consider a team leader more dangerous than an AT soldier... The result is disastrous, of course. I gave up with this idea. If it's easy to choose the best threat to be shot, it's impossible to override the engine to order the gunner to watch, aim, fire at the chosen target. Engine has its own life... as usual, commands do nothing persistent (working) on that. parameters: none (at this time) Script can be added in init.sqf or initServer.sqf 0=[] spawn { while {true} do { uiSleep 4; _allCannonVehicles = vehicles select {local _x && isNil {_x getVariable "admitVeh"} && !(_x isKindOf "WeaponHolderSimulated") && (getText (configfile >> "CfgVehicles" >> typeOf _x >> "editorSubcategory") in ["EdSubcat_APCs","EdSubcat_Tanks","EdSubcat_Artillery"])}; { _x setVariable ["admitVeh",true,true]; _x spawn { params [["_tk",objNull],["_tgt",objNull]]; private _wpnTrt = _tk weaponsTurret [0]; private _cannon = (_wpnTrt select {getText (configfile >> "CfgWeapons" >> _x >> "nameSound") == "cannon"}) select 0; if (isnil "_cannon") then {_cannon = ""}; if (_cannon != "") then { _cannonMags = getArray (configFile >> "cfgweapons" >> _cannon >> "magazines"); _cannonReloadTime = getNumber (configfile >> "CfgWeapons" >> _cannon >> "magazineReloadTime"); _magsDetail = magazinesAmmo _tk; _magsDetail apply { _class = (configfile >> "CfgAmmo" >>getText (configfile >> "CfgMagazines" >> _x select 0 >> "ammo") >> "aiAmmoUsageFlags"); _usage = if (istext _class) then [{(getText _class) splitString " + "},{[str(getNumber _class)]}]; _x pushback _usage;_x }; while {alive (_tk turretUnit [0])} do { _gunner = _tk turretUnit [0]; if (!((_tk targets [true,700]) isEqualTo []) && !isPlayer _gunner) then { _tgts = (_tk targets [true,700]) apply {[_tk aimedAtTarget [_x],_x]}; _tgts sort false; _tgt = _tgts select 0 select 1; _magsDetail = _magsDetail select {(_x select 1) > 0}; if (((_tgt isKindOf "landVehicle") or (_tgt isKindOf "CAManBase" && diag_tickTime mod 30 <= 6)) && _tk currentWeaponTurret [0] != str _cannon) then { _tk selectWeaponTurret [_cannon,[0]] }; call { if (_tgt isKindOf "landVehicle" && !(_tgt isKindOf "car")) exitWith { for "_i" from 0 to count _magsDetail -1 do { if ("512" in (_magsDetail select _i select 2) && (_magsDetail select _i select 0) in _cannonMags) exitWith { _tk loadMagazine [[0],_cannon,_magsDetail select _i select 0]; }; }; }; if (secondaryWeapon _tgt != "" && diag_tickTime mod 30 <= 6) exitWith { for "_i" from 0 to count _magsDetail -1 do { if ("64" in (_magsDetail select _i select 2) && (_magsDetail select _i select 0) in _cannonMags && !(_tk getVariable ["loaded64",false])) exitWith { _tk loadMagazine [[0],_cannon,_magsDetail select _i select 0]; }; }; }; if (_tgt isKindOf "landVehicle") exitWith { for "_i" from 0 to count _magsDetail -1 do { if ("128" in (_magsDetail select _i select 2) && (_magsDetail select _i select 0) in _cannonMags) exitWith { _tk loadMagazine [[0],_cannon,_magsDetail select _i select 0]; }; }; }; if (_tgt isKindOf "CAManBase" && diag_tickTime mod 30 <= 6) exitWith { for "_i" from 0 to count _magsDetail -1 do { if ("64" in (_magsDetail select _i select 2) && (_magsDetail select _i select 0) in _cannonMags) exitWith { _tk loadMagazine [[0],_cannon,_magsDetail select _i select 0]; }; }; }; }; uiSleep _cannonReloadTime; } else { uiSleep 2; }; }; }; }; } forEach _allCannonVehicles; }; }; Feedback welcome.
  19. MGI GUN RUN Last update: 01/02/2018 Hi all, Here is another script to add a specific gun run, calling a virtual or real CAS. This script is to copy/paste inside BI init CAS module. Nothing more to do! The code will search for "cannon" or "Gatling" in the pilot's weapon. So far, it doesn't work for gunners. You can see "no pilot cannon" in the sub-menu. If you find some non-listed pilot's cannon, let me know. Tips: - Always place your module/aircraft at 2 km from a target area. It's far better for a straight-in approach. You can even place them outside of the map. - Don' try to repeat the CAS too soon with a real aircraft. It will turn around the target without aiming it. Don't forget, pilots are dumb (I can say that referring to my own carrier). - At this time, Buzzard is far more precise than Wipeout which generously spread ammo with poor efficiency. Code to copy/paste in init field of the CAS module: 0 = this spawn { MGI_CAS_MODULE = _this; MGI_CAS = compileFinal " if !(GUNRUNCAS) exitWith {}; private _isVirtual = ({_x isKindOf 'air'} count synchronizedObjects MGI_CAS_MODULE ==0); _pilot = player getVariable 'BIS_SUPP_selectedProvider'; _veh = vehicle _pilot; _home = getPos MGI_CAS_MODULE; _trts = (_veh WeaponsTurret [-1]) select { getText (configfile >> 'CfgWeapons' >> _x >> 'nameSound') == 'cannon'}; waitUntil {!isNull (_pilot getVariable 'BIS_SUPP_requester')}; _requester = _pilot getVariable 'BIS_SUPP_requester'; 'Gun run requested' remoteExec ['hint',_requester]; waitUntil {!isnil {_pilot getVariable 'BIS_SUPP_supportRunCoords'}}; _coords = _pilot getVariable 'BIS_SUPP_supportRunCoords'; _alt = getTerrainHeightASL _coords; _limit = [40,90] select (_veh distance2D _coords < 2500); _pilot setCombatMode 'BLUE'; _veh flyInHeightASL [_alt +500,_alt +500,_alt +500]; waitUntil {_veh distance2D _coords < 2000}; _timer = diag_tickTime; _veh flyInHeightASL [_alt +100,_alt +100,_alt +100]; _resultOK = false; 'In sight' remoteExec ['hint',_requester]; _tgttype = ['laserTargetE','laserTargetW'] select (side _veh == WEST or (side _veh == RESISTANCE && WEST getFriend RESISTANCE >0.6)); _tgt = createVehicle [_tgttype,_coords,[],0,'none']; if (count _trts > 0) then { _trt = _trts select 0; _mags = (getArray (configfile >> 'CfgWeapons' >> _trt >> 'magazines')) arrayIntersect (_veh magazinesTurret [-1]); _cnt = getNumber (configFile >> 'cfgMagazines' >> _mags select 0 >> 'count'); _pilot setCombatMode 'RED'; _pilot reveal [_tgt,4]; while {diag_tickTime < _timer + _limit} do { _tgt setPosASL (getPosASL _tgt vectorAdd [0,0,(0.18 * (_veh distance2D _tgt)) -270]); if (!isNil 'BIS_SUPP_laserTGT') then {deleteVehicle BIS_SUPP_laserTGT; BIS_SUPP_laserTGT = nil}; _veh selectWeaponTurret [_trt,[-1]]; _veh doTarget _tgt; if ((_veh weaponDirection _trt vectorCos (AGLToASL _coords vectorDiff (eyepos _pilot))) > 0.999) then { [[_veh,_trt], BIS_fnc_fire] remoteExec ['call',_veh]; if (_veh magazineTurretAmmo [_veh currentMagazineTurret [-1],[-1]] < _cnt) then {_resultOK = true}; } else { _pilot lookAt _tgt }; uiSleep .01; }; }; if (!_resultOK) then {_pilot setVariable ['BIS_SUPP_failed',true]}; (['Gun run aborted','Gun run terminated, resuming support'] select _resultOK) remoteExec ['hint',_requester]; if !(_isVirtual) then { waitUntil {waypointType [group _veh,currentWaypoint group _veh] == 'MOVE'}; [group _veh,currentWaypoint group _veh] setWaypointPosition [_home,0]; [group _veh,currentWaypoint group _veh] setWaypointStatements ['true','']; _veh setFuel 1; {_veh setAmmo [_x, 2000]} forEach _trts; }; _pilot setVariable ['BIS_SUPP_supporting',false]; if (_isVirtual && alive _veh) then {uiSleep 180; deleteVehicle _veh}; "; _this spawn { while {true} do { GUNRUNCAS = false; waituntil {uiSleep 0.2; ((player getVariable "BIS_SUPP_request") select 0 == "CAS_Bombing") && {!isnull (player getVariable "BIS_SUPP_selectedProvider")}}; _pilot = player getVariable "BIS_SUPP_selectedProvider"; _veh = vehicle _pilot; _trts = (_veh WeaponsTurret [-1]) select { getText (configfile >> "CfgWeapons" >> _x >> "nameSound") == "cannon"}; private _cooldown = time - (_this getVariable ["BIS_SUPP_lastCall",time -122]) - ((_this getVariable ["BIS_SUPP_cooldown",0]) max 60); BIS_SUPP_commMenu = BIS_SUPP_commMenu + [ [ ["Gun run request",["No pilot cannon!",format ["wait for %1 sec",-(round _cooldown)]] select (_cooldown < 0)] select (count _trts == 0 or _cooldown <0), [4], "", -5, [[ "expression","GUNRUNCAS = true; [] spawn MGI_CAS; player setVariable ['BIS_SUPP_ammoType', 0]" ]], "1", ["1","0"] select (count _trts == 0 or _cooldown < 0), "\A3\ui_f\data\IGUI\Cfg\WeaponCursors\cannon_gs.paa" ] ]; uiSleep 0.1; showCommandingMenu "#USER:BIS_SUPP_commMenu"; waituntil {uiSleep 0.2; isnull (player getVariable "BIS_SUPP_selectedProvider")}; }; }; }; Seems to be short? It took me a lot of hours to find this solution. Feel free to test, comment, ask for some implementation. Pierre
  20. NO MORE SINGLE DEATH (SP/MP) - PLAYER CAN AUTO-REVIVE Hi all, Did you play some "ESCAPE MALDEN" in MP while single player and get the frustration of "lost mission on death"? Sure, you're alone and nobody will revive you. Respawn kills you and the game is over! Same for some SP session of complex mission. If you don't have the switch units possibility, game is over at first death. The script overrides this fate. Just choose (or not) the two parameters set at the first line. parameters: REVIVE DELAY / CLEAR AREA Revive delay: Simply change the first value in first line. This value is also a delay for captive status. i hard-coded a minimum: (min set to 20 sec. for cinematic if MP revive allowed, 10 sec. min if not). Clear area: the enemy infantry will be killed within this radius. That's useful for reviving inside a hornet's nest. Can be set to 0. Recommended value: 20 m. Usage: Copy/ paste the code in one of these places: running script for player(s) / trigger set to true / init.sqf / initPlayerLocal.sqf / console Example, for ESCAPE MALDEN, enable debug console in parameters and copy /paste the code, exec local. NOTES: - in MP, this script will work as long as there is an unique player. If some JIP, the script will be stopped. - Not compatible with other damage event handlers. If you want, you can try to make it work along with some other damage EHs, just removing the 6th line: player removeAllEventHandlers "handleDamage"; [5,50] call { params [["_delay",20,[0]],["_clear",0,[0]]]; if (count (call bis_fnc_listPlayers) != 1) exitwith {}; MGI_ReviveDelay = [_delay max 10,_delay max 20] select (player call BIS_fnc_reviveEnabled); MGI_clearArea = _clear; player removeAllEventHandlers "handleDamage"; MGI_fn_revive = compileFinal " params ['_unit']; waituntil {lifeState _unit == 'incapacitated' or !alive _unit or (!(_unit call BIS_fnc_reviveEnabled) && damage _unit >=0.86)}; if (!(_unit call BIS_fnc_reviveEnabled)) then { _unit setUnconscious true }; if (lifeState _unit == 'incapacitated') then { _unit setCaptive true; _unit allowdamage false; _unit setVariable ['inc',false]; {_x setDamage 1} forEach (( _unit nearEntities ['CAManBase', MGI_clearArea]) select {side _x getFriend playerSide < 0.6 && side _x != civilian}) - [_unit]; uisleep 3; _unit allowDamage true; if (_unit call BIS_fnc_reviveEnabled) then { ['#rev',1,_unit] call BIS_fnc_reviveOnState; _unit setCaptive true; _unit allowdamage false; } else { _unit setDamage 0; _unit setUnconscious false; }; }; uiSleep MGI_reviveDelay; _unit allowdamage true; _unit setCaptive false; "; player addEventHandler ["handleDamage", { params ["_unit","","_dam"]; if (count allplayers !=1) exitWith { player removeEventHandler ["handleDamage",_thiseventHandler] }; _veh = objectParent _unit; if (!isnull _veh && isNil {_veh getVariable ["incVeh",nil]} && (damage _veh > 0.7 or (!canfire _veh && !canMove _veh) or _dam > 0.3)) then { _veh setVariable ["incVeh",true]; _unit allowdamage false; _unit setCaptive true; [_unit,_veh] spawn { params ["_unit","_veh"]; _unit action ["GetOut", _veh]; _tim = diag_tickTime; waitUntil {isnull objectParent _unit or diag_tickTime > _tim + 3}; uiSleep 2; _veh setVariable ["incVeh",nil]; _unit allowdamage true; _unit setCaptive false; }; }; if (!(_unit getVariable ["inc",false]) && isNull objectParent _unit) then { _unit setVariable ["inc",true]; _unit spawn MGI_fn_revive; }; _dam min 0.86 }]; }; Enjoy!
  21. FUNCTIONS FOR GETTING / SETTING VEHICLE LOADOUT Hi all, Here is a script for getting the loadout of any vehicle or crate (any container in fact) then transfer it on another vehicle or crate. This works in SP or MP. This functions work also for virtual arsenal, edited, or scripted with addAction command. If any uniform, vest or backpack with their own custom loadout inside it, you'll recover the exact loadout for each one. (I didn't push to keep the same ammo count on each mag...) So, it's compatible and consistent with some automatic loaded backpacks, which will be loaded as you let them instead of their auto-default loadout. NB1: The loadout of the receiving container will be replaced by the loadout you get. NB2: see also the respawn vehicle script for integration of these two functions on respawning vehicles. (script to be issued soon). parameters: one objet <vehicle or crate, preferable> applying to getVehicleLoadout, two objects <new vehicle or crate, old vehicle or crate> applying to getVehicleLoadout Limitations: The object you picked the loadout with getVehicleLoadout must not be deleted before you apply the setVehicleLoadout on another object. Not tested, crates and vehicles overall load limitations, if any. I didn't see any of them so far. Examples: car1 call MGI_fnc_getVehicleLoadout; // you pick the current loadout of a vehicle; cursorTarget call MGI_fnc_getVehicleLoadout; // if you're pointing at a backpack on ground, you pick its loadout (must stay on cursorTarget for transferring the whole backpack in a named vehicle/crate); [car2,crate1] call MGI_fnc_setVehicleLoadout; // you call the loadout of crate1, previously recorded with MGI_fnc_getVehicleLoadout; The two objects must be present, not applicable on player or infantry units (see BI commands getUnitLoadout / setUnitLoadout) you apply the loadout of crate1 on car2, these two objects have now the same loadout. [car2,cursorTarget] call MGI_fnc_setVehicleLoadout; // see above. If you are still on same cursorTarget, you pass the container to the new object (so,new vehicle must be named for debug console usage). Codes to be run anywhere you need it, locally, preferably on server. MGI_fnc_getVehicleLoadout MGI_fnc_setVehicleLoadout
×