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
    • Arma Reforger
    • 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 Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Green Sea
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • 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
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics
  • CREATEANDGENERATION's Intoduction
  • CREATEANDGENERATION's HAVEN EMPIRE (NEW CREATORS COMMUNITY)
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!
  • empire brotherhood occult +2349082603448's empire money +2349082603448
  • NET88's Twitter
  • DayZ Italia's Lista Server
  • DayZ Italia's Forum Generale

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 31 results

  1. CRATERS Hi all, This topic gave me an idea for scripting craters after an explosion. I share this code you can add in an sqf or a trigger set to TRUE, server only should work. I'll add a similar code in my "terrain & map interactive" MGI module. Parameters: none MGI_hashAmmo = createHashMapFromarray (("true" configClasses (configFile / "cfgAmmo")) apply {[configName _x, getNumber (_x/"hit")]}); ["MGI_craters", "onEachFrame", { _flyingProj = (8 allObjects 2); { if (isNil {_x getVariable "EH"} ) then { _x setVariable ["EH", _x addEventHandler ["explode", { params ["_proj","_pos","_vel"]; _pos deleteAt 2; private _hit = MGI_hashAmmo get typeOf _proj; private _calc = log ((sqrt vectorMagnitude _vel*sqrt _hit) max 1.1); [_proj,_calc,_pos] spawn { params ["_proj","_calc","_pos"]; sleep 0.1; private _crater = _pos nearestObject "#crater"; if (!isNull _crater) then { _pos = getPosASL _crater; private _surface = (configFile /"cfgSurfaces"/ (surfaceType _pos splitString "#")#0); private _depress = getTerrainHeightASL _pos - ((_calc/(getNumber (_surface / "surfaceFriction") max 1)*(getNumber (_surface /"dust") max 0.01 min 1)) min 3); _pos set [2,_depress]; (setTerrainHeight [[_pos],TRUE]) remoteExec ["call",2]; }; }; }] ]; }; } forEach _flyingProj; }] call BIS_fnc_addStackedEventHandler; This code creates craters after explosion on ground (where Arma craters are). So, not on vehicles, not on buildings. Note1: Firing AP shell (armor piercing one) doesn't lead to explosion (Arma engine), so you need to fire HE shell for craters. Note2: at this time, craters after crash (planes) don't fire the code. this code is for EXPLODING PROJECTILES only. Feedback are welcome! Have fun.
  2. Hello all, The command nearestAirport doesn't exist. Here is a little script for finding the nearest existing (native) airport or edited one (USS Freedom). MGI_fnc_nearestAirport = { params [["_plane",player,[objNull,[]],[2,3]],"_airport_pos","_airport_inter","_checkValue","_airportName","_airport_dir","_airport_or"]; private _world = (configFile / "cfgWorlds" / worldName); private _airports = [[0,getArray (_world / "ilsPosition"), getArray (_world / "ilsDirection")]]; private _airport_dist = 10^6; private _dynAirports = (allAirports #1); { _airports pushBack [_forEachIndex,getArray (_x / "ilsPosition"),getArray (_x /"ilsDirection")] } forEach ("true" configClasses (_world / "secondaryAirports")); if (_airports isNotEqualTo [] && ((count _airports !=1) or (_airports #0#1#0 != _airports #0#1#1))) then { _airports = _airports apply {[(_x#1) distance2D _plane,_x]}; _airports sort TRUE; _airport_dist = (_airports #0#0); _airport_pos = (_airports #0#1#1); _airport_dir = _plane getDir _airport_pos; _checkValue = (_airports #0#1#2); _airport_or = if ((_checkValue #2) != 0) then [{atan ((_checkValue #0)/(_checkValue #2))},{90}]; _airportName = text (nearestLocation [_airport_pos,"NameLocal"]); }; if (_dynAirports isNotEqualTo []) then { _airports = _dynAirports apply {[_x distance2D _plane,_x]}; _airports sort TRUE; _airport_inter = (_airports #0#0); if (_airport_inter < _airport_dist) then { _airport_pos = getpos (_airports #0#1); _airport_dir = _plane getDir _airport_pos; _airport_dist = _airport_inter; _airportName = "CVN"; _airport_or = (172+ getdir (_airports #0#1)) mod 360; }; }; [_airportName,round _airport_or,_airport_pos,round _airport_dist,round _airport_dir]; }; Usage: just call it like: call MGI_fnc_nearestAirport; // refers to player by default plane1 call MGI_fnc_nearestAirport; // refers to object plane1 [anyPosition] call MGI_fnc_nearestAirport; // any position must be an array inside the array of parameter (like: [getpos player] or [[xxx,yyy]]...) The function will return an array with: [name of the airport (location), orientation of the main runway/angle deck for CVN, position of the airport, distance, azimuth] Note: you can add it in cfgFunctions for better performance while calling it multiple times: In your description.ext (or cpp ,hpp in addons) class cfgFunctions { class MGI { class anyCategoryYouWant { file = "yourSubFolder(s)"; // "\yourSubFolder(s) for addon" class nearestAirport{}; }; }; }; Then place the code in an sqf named fn_nearestAirport inside your path (described as file). SQF starts with params line and ends with the returning array (must not be wrapped inside MGI_fnc_nearestAirport {...};) And same usage in scripts: plane1 call MGI_fnc_nearestAirport;
  3. Hi all, You'll not find too much topics about hashmap (see Halek's post) and I thought that could be useful to open this specific topic on this command group. Hashmap is a very powerful tool, not so difficult to script. You have full explanation on links but roughly, you're creating a table (hashmap) in which any call (get) for entry (key) is almost immediate and doesn't depend on the rank of what you're searching. The hashmap creation can take some times in process, as any other table creation. There is an added value if once in game you need to grab lines repetitively. I give you a little example: Let's say you want to grab compatibles mags for some primary weapons. There are different way for that. The first good question is to determine if you need these info repeatedly (for multiple units, events... as example): So, as practical example, for Arma vanilla (there are 376* primary weapons): 1st method (no need to create anything) use BIS_fnc_compatibleMagazines (or similar ones): Let's test some primary Weapons in debug console performance button: "srifle_DMR_01_F" call BIS_fnc_compatibleMagazines; // found in 0,0243 ms: ["10rnd_762x54_mag"] "sgun_HunterShotgun_01_sawedoff_F" call BIS_fnc_compatibleMagazines; // found in 0,0316 ms: ["2rnd_12gauge_pellets","2rnd_12gauge_slug"] "arifle_MXM_Hamr_LP_BI_F" call BIS_fnc_compatibleMagazines // found in 0.0716ms: ["30rnd_65x39_caseless_mag","30rnd_65x39_caseless_khaki_mag","30rnd_65x39_caseless_black_mag","30rnd_65x39_caseless_mag_tracer","30rnd_65x39_caseless_khaki_mag_tracer","30rnd_65x39_caseless_black_mag_tracer","100rnd_65x39_caseless_mag","100rnd_65x39_caseless_khaki_mag","100rnd_65x39_caseless_black_mag","100rnd_65x39_caseless_mag_tracer","100rnd_65x39_caseless_khaki_mag_tracer","100rnd_65x39_caseless_black_mag_tracer"] So, each time you need these mags, you must call the function then wait for the result. The delay depends on multiple factors: rank in cfgWeapons, muzzles, mags... I guess Now, let's "prepare tables": First of all, primary weapons: primWpns = ("getNumber (_x/'type') == 1 && {getNumber (_x/'scope') == 2}" configClasses (configfile /"cfgWeapons")) apply {configName _x}; Note*: some weapons don't have picture in gear (inventory) but are playable. Scope =1. You can add them if needed. then: CompatibleMagsTable = primWpns apply {[_x, _x call BIS_fnc_compatibleMagazines]}; As result, you'll obtain something like: [["srifle_DMR_01_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_ACO_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_MRCO_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_SOS_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_DMS_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_DMS_snds_F",["10rnd_762x54_mag"]], ["srifle_DMR_01_ARCO_F",["10rnd_762x54_mag"]],...and so on] Of course, it takes a long time (27 ms without any mod) to draw this table but you need to do that once, at mission start. So, that doesn't really matter in game. Then, during game: 2nd method - use the ready table finding the elements for the entry (weapon): CompatibleMagsTable select ( primWpns find "srifle_DMR_01_F") select 1 // found in 0.0009 ms CompatibleMagsTable select ( primWpns find "arifle_MXM_Hamr_LP_BI_F") select 1 // found in 0.038 ms CompatibleMagsTable select ( primWpns find "sgun_HunterShotgun_01_sawedoff_F") select 1 // found in 0.059 ms Truly, the result depends on the rank of the tested primary weapon inside the result for configClasses (primWpns). The code exits as soon as the weapon is found and there is no difficulty for grabbing the mags. BUT, if you compare the results for 1st and 2nd methods, is there a great added value in term of average performance ? Probably yes if your table is more complex, (with multiple things to grab for an entry)... Anyway, forget this 2nd method. Now, the core of the topic. Hashmaps are introduced since Arma 2.01. 3rd method - Let's create a hashMap, as we created a table above: Starting with the primary weapon classes as reference: primWpns = ("getNumber (_x/'type') == 1 && {getNumber (_x/'scope') == 2}" configClasses (configfile /"cfgWeapons")) apply {configName _x}; Now the hashmap where all these classes will be keys of entry: MGI_Hash_Mags = primWpns createHashMapFromArray (primWpns apply {_x call BIS_fnc_compatibleMagazines}); It's very similar to the former table and it takes also 27 ms for preparing it. But... Now you have a hashmap and you can call what you need like this: MGI_Hash_Mags get "srifle_DMR_01_F" // found in 0.0007 ms MGI_Hash_Mags get "arifle_MXM_Hamr_LP_BI_F" // found in 0.0007 ms MGI_Hash_Mags get "sgun_HunterShotgun_01_sawedoff_F" // found in 0.0011 ms Performance friendly isn't it? Have fun.
  4. Hello all, Here is a little script enabling AIs for rearming when out of ammo. If I'm right, the vanilla behavior is: - AI leaders sometimes order their AI subordinates for rearming at crates (probably only simple crates/vehicles with accurate magazines). Anyway they don't succeed in that (or barely). What I experienced is AIs running after vehicles, AIs stuck, AIs disobeying... If you have better experience on that, please share. - as playing leader of AIs, you can order your units to rearm at... known abandoned weapons, crates,... no matter if you don't know where they are and how far. The list can be looooong (as a day without bread) , and the, totally useless. you can see you AI crossing the map without few chance for actually rearming. Well, I'm trying here another approach, in this way: - first of all, I limit the script to AIs with played leader. (Just avoiding too many codes on server, but feel free to test what ever units you want); - only AI units owning a primary weapon are concerned: No player, no tourist; - When the AI has less than 10 remaining shots in its primary weapon, if magazines or weapons can be picked, within 100 m of the unit (anytime), the AI will move and pick them up. The possibilities and priorities are: - Any object stated as Arsenal (virtual crates/ vehicles with arsenal code...), is scouted as priority 1. That means the AI will reload at this object, with compatible mags, no matter the content of the arsenal crate/vehicle. At this time, and possibly for ever, I don't make any filter about possible limitation on arsenal. That means any enemy (concerned AI) can rearm at any arsenal. - The priority 2 is crates/vehicles fitted with compatible mags. The rearm action on a crate can empty it. This action is the standard behavior of Arma's engine. If you want more, see module! Anyway, the mags can be inside uniforms, vests, backpacks inside the crate or the vehicle. Not so bad. - the priority 3 is friendly fallen corpses... There is neither arsenal, nor crate but some fellows are lying on ground with compatible mags. That's the last chance for AI to keep their actual primary weapon; - the last priority (4) is any weapon found on ground, inside crate or vehicle. This weapon is different from the original. If several choices, the AI will pick one at random... At this time, I don' have filter for all possible cases and skills of AIs... It's just out of my scope. anyway this weapon can be inside a backpack, inside a crate... I added a mandatory mag for this weapon as I don't want the AIs out of ammo, then picking a weapon, out of ammo then... in a boring cycle. Furthermore, at this time, the abandoned weapon is deleted. Note 1: Vehicles are considered as crates if engine off! Note 2: You can stop an AI (stop order), so he will not continue his search for mags or weapons (but he will not fight without ammo). Of course, as I'm scripting also for my mod: MGI Advanced Modules, I added a Rearm Module enabling more possibilities: - You can easily choose different units (to be upgraded perhaps); - When your AI rearms, the secondary weapon (if any) is refilled in tube (so 1 shot). The AI receives up to 3 first aid kit and hand grenades or smokes. The AI grabs also up to 6 grenades for GL if any. - the rearm and switchweapon vanilla actions are replaced by animations (same ones) and custom scripts avoiding vanilla inventory (too many mags, no grenades, poor fak) Known limitations: - the hand guns are not treated at all; - the GL and launchers are treated in module, but only in case of low primary weapon ammo which stays the triggering factor; Compatible for MP (the treated units are local on each PC/Server), compatible with mods. Depending on mods, you can experience some little difference: - compatibles mags means... compatible mags and some vanilla mags can be used instead of specific ones, for arsenal. I'm not responsible of these choices. - on the other hand, there are several "FirstAidKit" along with mods. Some of them keep the class name and modify the aspect, some of them modify the whole stuff (for nuts,imho). Your AI can receive firstAidKit instead of "blabla_holyKitofTheGreatesModEverWritten" . They will not make difference, and you'll see that if you pick items on dead AI fellow. Have fun! Version: 28 / 07/ 21 in init.sqf
  5. Hi all, Here is a script you can run for each player (initPlayerLocal.sqf is just fine!) This script allow to lock / unlock any door of any house. Works fine in Arma3. I added a little workaround for WW2 houses like in CUP core used by IFA3 mod. That probably worth for ant Arma2 houses, not tested. There is just one parameter: TRUE means players must have the item "Keys" in their inventory. And no, I will not script for specific keys for due houses! Say it's a pass. FALSE allows players to lock - unlock the doors of the houses without keys. NOTE : you can also manage just some houses (see below) 0 = FALSE spawn { params [["_needKeys",FALSE],"_houses",["_house",objNull]]; while {true} do { if (isNull objectParent player) then { _houses = ((nearestObjects [player, ["house"], 50]) select {isNil {_x getVariable "securedHouse"}}); if (count _houses > 0) then { _house = _houses select 0; _house setVariable ["securedHouse",_needKeys]; [ _house, "Lock-unlock door", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", " call { private _intersects = []; private _intersect = ''; private _door_anim = ''; private _is_door = FALSE; private _dist = 4; { _intersects = ([_target, _x] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]); if (count (_intersects select 0) > 0) exitwith { _intersects } } forEach ['FIRE','GEOM','VIEW']; if (count _intersects > 0) then { _intersect = _intersects select 0 select 0; _dist = _intersects select 0 select 1; _is_door = ('door' in toLowerANSI _intersect); if (_is_door && _dist < 4) then { if ('ww2_' in toLowerANSI typeOf _target) then { _door_anim = format ['%1_anim', _intersect]; } else { _door_anim = format ['%1_rot', _intersect]; }; }; }; if (_this distance _target < 15 && {_door_anim !=''} && {_target animationPhase _door_anim == 0} && {'keys' in magazines _this or !(_target getVariable 'securedHouse')}) then { _target setVariable ['MGIselDoor',[_intersect,_door_anim]]; true } else {false}; }; ", "true", {}, {}, { if (_target getVariable ["MGIselDoor",[]] isnotEqualTo []) then { (_target getVariable "MGIselDoor") params ["_door","_door_anim"]; private _doorState = format ['bis_disabled_%1',_door]; if (_target getVariable [_doorState,0] == 0) then { _target setVariable [_doorState,1,true]; if ("ww2_" in toLowerANSI typeOf _target) then { [_target,_doorState,_door_anim] spawn { params ["_target","_doorState","_door_anim"]; while {alive _target && _target getVariable _doorState == 1} do { _target animate [_door_anim,0,TRUE]; sleep 0.1; }; }; }; } else { _target setVariable [_doorState,0,true]; }; }; }, {}, [], 5, nil, false, false ] call BIS_fnc_holdActionAdd; }; }; sleep 2; }; }; For specific houses, you want to secure (w. or w/o keys): The general parameter determines the need of keys if you want to skip this code for most of the houses except those which are in a trigger area (example trg1), just replace the line: _houses = ((nearestObjects [player, ["house"], 50]) select {isNil {_x getVariable "securedHouse"}}); by: _houses = ((nearestObjects [player, ["house"], 50]) select {isNil {_x getVariable "securedHouse"} && _x inArea trg1 }); Have fun!
  6. Hi all, Here is a new module in MGI Advanced Module addon, for spawning any groups you want, any time... (done) This module allows: - to spawn any group, even customized, on any side, - spawning on multiple possible areas (triggers) - with a wide randomized choice or a very specific group. You can place several modules on the map, each of them have their own parameters; 1. Choose the side (applies to all groups spawned from a module, no matter the initial vanilla side). So civilian units can be aggressors. 2. decide if you want to spawn: * at total random (so the groups are picked in cfgGroups, but for the side you chose (normal limitation) * at randomized or specific faction(s) . They must exist in cfgGroups (not all factions from cfgFactionClasses are available for groups). All factions (cfgGroups) are available so not depending, here, on the final side * You can filter these first possibilities by the type(s) of groups. For example, "infantry" and/or "motorized" and/or "armored"... But, these types must exist in the cfgGroups. * you can choose to spawn a specific group (from cfgGroups).. or even an array of units, vehicles... or even an edited group (with all customized textures, pylons, loadouts...) * linked group(s) on module, customized or not, will be candidates for spawning. That's fine for spawning not existing groups such as air or sea patrols. 3. Choose the attitude: behavior, combat mode, formation... 4. choose the repeat sequence (limitation and delay) 5. decide on what condition groups module can spawn (not only at start, but any time!) 6. decide for a simple task (or not). Chase players, enemies, defend... 7. run a code for each group (useful for specific task) MODULE(S) IN 3DEN - Position/ area of the module(s) if no synced trigger area. Direction of the module, in 3den, is the direction of the group (if no synced trigger area) SYNCED TRIGGER AREA(S) - The position, area and direction of the module doesn't matter any more. The group(s) are spawning at randomized positions in randomized trigger area(s), with the direction of the trigger area. SYNCED UNIT(S) - In 3den, you can place (customized or not) group(s) with the module(s). No matter if you synced one (leader or not) or several units of a group, with the module. The group will be candidate for spawning. PARAMETERS SIDE - Definitely the side of your group(s) for this module. No matter the choice you did (edited group, chosen faction(s), or type(s) of group or group(s)..) What ever you spawn we belong to this side. --> But, if you let the module at full random (no synced group, no, faction, no type, no group), in this case, the randomized group is picked among the native possibility from cfgGroups. So, if you just select a side (say EAST), you'll spawn randomized groups(s) from OPFOR. HOW MANY GROUPS - The number of group(s) to be spawned at each occurrence. Randomization will depend on the possibility of what you want to spawn, so your choice) Min 1 max 12 (limited for performance saving when spawning heavy customized groups. Feel free to add other modules) NOTE: The modules works with edited groups or existing configs/classes of groups in cfgGroups (see config viewer from console). So, scripted groups have always the architecture: configFile >> "cfgGroups" >> "side" >> "faction"* >> "type of group" >> "group" ... then units/vehicles for each group Example: side like "Indep" , faction like "IND_E_F", type like "infantry", group like "I_E_InfSquad" FACTION(S)* - If empty, no filter about them. If filled without any more details (type(s), group(s) ) all available factions in cfgGroups can be used to spawn any child type, then any child group. But ⚠️ all current faction names can't work. Some existing factions in cfgFactionClasses are not present in cfgGroups. For example: "CIV_IDAP_F" (IDAP civilian faction has no group) or even "OPF_V_F" (Arma Viper) can't work in the architecture of cfgGroups. (for Viper, the only group defined in: configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "SpecOps" >> "OI_ViperTeam" exits. So at faction level, there is nothing to do). You can fill the parameter with a working class like: "OPF_F" , or the config (configfile >> "CfgGroups" >> "East" >> "OPF_F"), or an array of these possibilities. Not case sensitive. TYPE(S) - if more a filter about what you want to spawn. That should be simple as "infantry" or " motorized or mechanized" or "armored". That doesn't. Even in Arma vanilla, you can find exotic classes as "motorized_MTP". Any dev has his own mind to sort the groups by types. The reason is probably the way you can find sorted groups in 3den's right panel. But, it's just impossible (or needs an updated list of hundreds of names) to filter groups easily. You have to do that job, if you want to do so, writing a config or a class or an array of that, for filtering the type(s). Not case sensitive but do not make typo's error! If wrong, there is no more filter. You can fill the parameter with a working class (not the config) like: "specops", or an array of these possibilities. SPECIFIC GROUP(S) - a step more for less randomization. You are at the group level. As factions, you can fill it with class (of group) or config or an array of these possibilities. Much more, you can add arrays of units/vehicles class(es). That's also a way to customize some groups, but one the contrary of synced edited ones, you'll not able to define appearance for vehicles or pylons payload at this moment. RADIUS AREA - radius of the module area, so the spawn area if no synced trigger areas. Useless if any trigger area synced. GROUP(S) DIRECTION - orientation of the module in 3den (shift mousse drag) . Do not write anything on field (it's a result, not an entry). Useless if any trigger area synced. GROUP(S) SKILL - As 3den, skill for whole group, with +/-10% randomized on each units. ENABLE DYNAMIC SIMULATION - As in 3den. See Biki for detailed explanation (recommended) CONDITION FIELD - checked every 2 seconds. So, much more convenient than a simple condition of presence at start! Feel free to do what you want but return a boolean. Examples: * spawning only at night : sunOrMoon < 0.5 * strengthening weakened side : INDEPENDENT countSide allGroups < 3 * waiting for more players : count allPlayers > 2 * even checking for 1000 m distance at least from any player: private _possAreas = _logic getVariable "possAreas"; (count allPlayers > 0 && allPlayers findIf {private _plyr = _x; _possAreas findIf {_plyr distance _x#0 < 1000} == -1} == -1) but that will not despawn or hide or disable the groups! See the dynamic simulation instead. REPEAT OCCURRENCE - the added times for re-spawning the same groups (not at the same place) . 0 means no more occurrence. -1 means infinite repeat. So if you want to spawn 3 times a group, set it to 2 (1 shot + 2 added) INTERVAL FOR REPEAT - A delay between 2 consecutive spawns , if the condition are met. If not, the spawn will wait for condition to be TRUE, then spawn, then wait for interval duration, then check for condition... min 30 sec max 2 hours. FORMATION OF THE GROUP - As usual. Sometimes this setting is reinitialized to default wedge. I didn't identify why. So check twice before OK button and save scenario. BEHAVIOR - (or behaviour, sorry) Same as usual COMBAT MODE - same as usual SPEED MODE - As usual. same little problem as formation. Check twice. INSIGNIA - I hope that works fine everywhere... CODE FOR GROUP - Blank of any code (without {}). Passes parameters are <group> <<leader>, <vehicles of the group> . For example, just write: params ["_grp","_lead","_vehs"]; private _wp = _grp addWaypoint [<aPosition>,0]; _wp setWaypointType "MOVE"; _lead forceFlagTexture "\A3\Data_F\Flags\Flag_red_CO.paa"; {_x setFuel 0.2} forEach _vehs No bracket, just like this. BASIC TASK - can be: * Do Nothing (the preferred one of dumb AIs) * Attack nearest known enemy. So the group will start after an enemy knowledge acquisition. Not before. I hope I managed air assets for chasing air assets... I can't imagine infantry running after a jet. * Chase nearest enemy. Same as above but the position of nearest enemy is known (for spawning attack waves for example) * Attack nearest Player (known enemy) . The group must acquire the detection of a hostile player. * Chase nearest player (enemy). The group will start the hunting on player's (updated) position. * Defend this area. some SAD waypoints in the area of the group(s). known difficulties - Mods like Unsung or CUP or RHS (all in fact) requires a sharp attention for the name of the factions/groups but also Types... of groups. You can't imagine hundreds of names for stupid things like "infantry" "armored" "mechanized" ... That should be normalized, but not! - Too many mods, even non used by mission, but just loaded on server (so ticked), will affect the randomization for nuts, and lead to unwanted results like Arma or CUP units during Unsung play. know bugs all corrected so far To do list: - respawn without delay on whole group death - add a filter for mods... A lot of work. Enjoy! All feedback welcome. [RELEASED]
  7. Hi all, I decided to give some time on existing Navy assets in community, even if Arma is much more a Land force milsim,... with few air assets. First of all, BI has produced: - the CVN Freedom, an object not really dynamic, but stated as a "dynamic airport" with some added components as radar or AA defenses from BI, but also cats and arresting wires. - the FA 18 Black Wasp II , the only aircraft with a tail hook (mandatory if you want to stay aboard 😉) On the other hand, the community produced, at least: - the USS Nimitz, unfortunately also a "static dynamic airport", but with much more possibilities (moving excepted) than the USS Freedom, - many outstanding mods, with plenty of aircraft, but for Navy, so planes with tail hook, the award is for Unsung one. In fact, I'm not sure you will find any other mod with Navy jets and planes able to land on deck of a carrier. After that... some mods are worth the trial, sometimes with better aerodynamics and realism: RHS, IFA3, CUP... Why all aircraft carrier are static? Probably make them sailing and able to recover some played (or AI) aircraft is far too complex.(We are not on DCS). The Vehicle In Vehicle possibility (since Apex) is for transportation but doesn't really meet the requirement for deck handling. Can we make them move (for a scenery or an attack by enemy)? Yes, at least for CVN USS Freedom. Here is a little code I wrote for a pattern. The CVN start a leg of x seconds, turns left or right, and so on. The position is at the first leg start, choose the orientation of the pattern (no matter the orientation of the object (Land_Carrier_01_base_F) in editor, the leg duration (in sec.) , and the direction of the turn (right = true). This pattern is optimized for 60FPS which make it U-turn in 5 minutes (fast but realistic) and move the CVN at 60 km/h (roughly). I'd rather write 32 knots. CVN PATTERN (CVN1 is the name of the BI aircraft carrier) MGI_CVN_PATTERN = { params [["_CVN",objNull],["_firstDir",0],["_leg",300],["_rightTurn",TRUE]]; if (!isServer) exitWith {}; _CVN setdir ((_firstDir + 180) mod 360); _CVN setVariable ["CVNPattern",[_firstDir, getDir _CVN]]; _CVN setVariable ["CVNTrueDir",_firstDir]; _CVN setVariable ["CVNTimer",0.1 - diag_tickTime]; ["movingCarrier","onEachFrame", { private _CVN = _this param [0,objNull]; private _leg = _this param [1,300]; private _rightTurn = _this param [2,TRUE]; private _dir = _CVN getVariable "CVNTrueDir"; private _t = _CVN getVariable "CVNTimer"; _CVN setdir ((_dir + 180) mod 360); _CVN setPosWorld ASLToATL (_CVN getpos [0.3,_dir]); [_CVN] call BIS_fnc_Carrier01PosUpdate; if (((diag_tickTime + (_CVN getVariable "CVNTimer")) mod _leg) < 0.1) then { _CVN setVariable ["CVNTimer", - diag_tickTime]; _CVN setVariable ["CVNTrueDir",_dir + ([-0.01,0.01] select _rightTurn)]; if (abs((360 +(_CVN getVariable "CVNTrueDir") mod 360) mod 360 - (_CVN getVariable "CVNPattern")#1) < 0.5) then { _CVN setVariable ["CVNTrueDir",(_CVN getVariable "CVNPattern")#1]; reverse (_CVN getVariable "CVNPattern"); _CVN setVariable ["CVNTimer",0.1 - diag_tickTime]; }; }; }, [_CVN,_leg,_rightTurn] ] call bis_fnc_addStackedEventHandler; }; [CVN1,45,120,FALSE] call MGI_CVN_PATTERN; So, the dynamic airport starts to be dynamic. I added also the rescue helicopter "pedro" , following the CVN. You can take control on it, or let it do his job. It takes few seconds to be on station, at start. PEDRO RESCUE: MGI_rescuePedro = { params [["_helo",objNull],["_CVN",objNull]]; if (!isServer or [_helo,_CVN] findIf {isNull _x} > -1) exitWith {}; currentPilot _helo disableAI "radioProtocol"; _helo setdir (getdir _CVN +180); _helo setpos (_CVN modelToWorld [200,0,35]); _helo flyInHeight 30; _helo flyInHeightASL [50,50,50]; [_helo,_CVN] spawn { params ["_helo","_CVN"]; waitUntil {!isNil{_CVN getVariable "CVNTrueDir"} or !alive _helo}; while {alive _helo} do { _dir = _CVN getVariable "CVNTrueDir"; _helo move (_CVN modelToWorld [200,-400,35]); _helo limitSpeed (diag_fps * (1+ (0.005 * ((_helo distance2D (expectedDestination _helo #0))-500)))); sleep 5 } } }; [this,CVN1] call MGI_rescuePedro; What about deck landing? You can test an approach, even a touch, but you can't stay aboard as for any other moving objects. Now, for the fun you can attach the jet on deck. I did a little trigger, itself attached to the CVN, but that is not really sexy. What about USS Nimitz (mod)? Unfortunately, I didn't succeed in making it sail properly... The result is a full flush deck, as the bridge dives... No time for workaround relative positions of all the parts. So, we are still far from a realistic Navy ambiance. For example, the main tool for a deck landing: the Optical Landing System (OLS) is missing. In a second step, I will comment the airplane simulation. I'm not a modder but there are some tips which could improve the game playability and immersion. That's not incompatible. Have fun. All comments and remarks welcome as usual. Pierre
  8. Hi all, Perhaps I missed something, but, for whatever reason, it's impossible to make difference between sides or factions for an OPFOR Katiba and a BLUFOR MX . So weapons haven't side. I never found something useful in cfgWeapons to make a filter for faction, side, even group or unit using such or such weapon. I imagine that if you want to filter all BLUFOR used weapons for arsenal or any loot script, you have to grave in marble the array of all weapons you want to manage... Typically, that's what I want to avoid: elaborating fixed lists for any mods... boring! So If you have a solution... thanks for sharing it. At this time, I have a little workaround, not the best I'm afraid. If you want weapons used by BLUFOR: private _wpnsWestList = []; private _cfgMen = "getNumber (_x >> 'scope') >=2 && configName _x isKindOf 'SoldierWB'" configClasses (configFile >> "cfgvehicles"); { _cfgWpnsW = getArray (_x >> "weapons"); {if (getNumber (configfile >> "cfgWeapons" >> _x >> "type") in [1,2,4]) then {_wpnsWestList pushBackUnique _x}} forEach _cfgWpnsW; } forEach _cfgMen; _wpnsWestList = _wpnsWestList - ["B_Patrol_Soldier_HeavyGunner_weapon_F"]; Note: I was surprised to find such unit classes like "B_Patrol_HeavyGunner_F" and its "B_Patrol_Soldier_HeavyGunner_weapon_F" as primary weapon which is a simple "LMG_Zafir_F". Don't ask me why this exception... For OPFOR, anyway, change 'SoldierWB' to 'SoldierEB' (and remove the last line of course) , and for INDEP, 'SoldierGB' will do the trick. Any improvement or better idea is welcome! Thanks
  9. DETONATING CORD Hi all, This topic gave me the idea to script a little for a detonating cord. So, you can add this code in init.sqf or else. Just be sure your unit(s) created before running the code. Parameters: UNITS / PROJECTILE / SAFETY DISTANCE / CORD LENGTH MGI_fnc_detCord = { params [["_units",[],[objNull,[]]],["_thrownEnd","SmokeShellOrange"],["_safetyDist",15],["_cordLength",60]]; if (_units isEqualType objNull) then {_units = [_units]}; MGI_passToEhCord = [_thrownEnd,_safetyDist,_cordLength]; { _x addEventHandler ["firedMan", { params ["_unit", "", "", "", "", "_magazine", "_projectile"]; MGI_passToEhCord params ["_thrownEnd","_safetyDist","_cordLength"]; if (_magazine == _thrownEnd) then { [_unit,_projectile,_safetyDist,_cordLength] spawn { params ["_unit","_projectile","_safetyDist","_cordLength"]; private _veh = if (isNull objectParent _unit) then [{"B_UAV_01_F" createVehicleLocal getpos _unit},{objectParent _unit}]; if (_veh isKindOf "B_UAV_01_F") then {_veh hideObject true}; private _rope = ropeCreate [_veh,[0,0,0],_projectile,[0,0,0],_cordLength,["",[0,0,10]]]; uisleep 6; private _segs = (_veh nearObjects ["ropesegment",_cordLength]) select {_x distanceSqr _veh > _safetyDist^2}; if !(_segs isEqualTo []) then { _unit addAction ["detonate cord",{ params ["_target", "_caller", "_id", "_args","_exploEnd"]; _args params ["_rope","_veh","_segs","_projectile"]; _target removeAction _id; for "_i" from 0 to count _segs -1 do { _explo = createVehicle ["mini_grenade",getpos (_segs #_i),[],0,"CAN_COLLIDE"]; _explo hideObjectGlobal true; if (_i == count _segs -1) then {_exploEnd = _explo}; }; waitUntil {isNull _exploEnd}; if (_veh isKindOf "B_UAV_01_F") then {deleteVehicle _veh}; deleteVehicle _rope; deleteVehicle _projectile; },[_rope,_veh,_segs,_projectile],0,true,false,"","alive _target"]; }; }; }; }]; } forEach _units; }; player call MGI_fnc_detCord; // example Have fun!
  10. MAGAZINES REPACK Hi all, Here is a simple script for repacking magazines by double-clicking on them in inventory. Just add it in init.sqf or better, in initPlayerLocal.sqf parameters: NONE MODIFIED 01/11/19 Have fun!
  11. 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.. ... or respawning AIs, in waves or at once.. 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. MODULES on Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1682280809 The summary is just here. The modules are described and explained in an updated documentation: DOCUMENTATION LINK Have fun! Pierre MGI
  12. 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);
  13. 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!
  14. 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
  15. 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
  16. 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
  17. 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.
  18. 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=
  19. 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.
  20. 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 UPDATED: new version 20/12/2019 Corrected 25/06/2020 on Larry0503 feedback for uniforms with multiple classes (present in all sides) parameters: NONE fnc_otherUnif = { params ["_type","_return"]; if (_type == 0) exitWith { MGI_button = _return #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 (_uniforms isEqualType [] && {!(_uniforms isEqualTo [])}) then { [_idc,_text,_picture,_index,_uniforms] spawn { params ["_idc","_text","_picture","_index","_uniforms",["_selectedUnif",""],"_unifConts",["_uniformObject",objNull],"_otherItems","_g0"]; private _currentUnif = uniform player; private _currentInvent = uniformItems player; _currentInvent = (_currentInvent arrayIntersect _currentInvent) apply {private _v= _x;[_x]+[{_v isEqualTo _x} count _currentInvent]}; private _selectedUnif = ((_uniforms select {toLower (gettext (_x >> "picture")) splitString "\"joinString "\" == _picture}) apply {configName _x}); if (_selectedUnif isEqualTo []) exitWith {}; if !(pl_container isKindOf "CAManBase") then { _unifConts = (everyContainer pl_container select {getNumber (configFile >> "CfgWeapons" >> _x #0 >> 'ItemInfo' >> 'type') == 801}); _uniformObject = objNull; private ["_cnt","_selectedCfg"]; scopeName "main"; for "_i" from 0 to count _selectedUnif -1 do { _cnt = 0; _selectedCfg = _selectedUnif #_i; for "_j" from 0 to _index do { if (lbText [_idc,_j] == _text) then { _cnt = _cnt +1; _uniformObject = _unifConts select {_selectedCfg == (_x #0)} select (_cnt -1) select 1; if (!isnil "_uniformObject" && {!isNull _uniformObject}) then { _selectedUnif = _selectedCfg; breakTo "main" }; }; }; _uniformObject = objNull; }; } else { _selectedUnif = _selectedUnif #0; _uniformObject = uniformContainer pl_container }; if (!isNull _uniformObject && !(player isUniformAllowed _selectedUnif)) then { private _itemsAndMags = (_uniformObject call MGI_orderItsAndMgs) params ["_selectedItems","_selectedMags"]; if !(pl_container isKindOf "CAmanbase" or isNull pl_container) then { private _its = getItemCargo pl_container; private _mgs = magazinesAmmoCargo pl_container; private _unifItems = _unifConts apply {_x #0}; private _vestConts = (everyContainer pl_container select {getNumber (configFile >> "CfgWeapons" >> _x #0 >> 'ItemInfo' >> 'type') == 701}); private _vestItems = _vestConts apply {_x #0}; _otherItems = +(_its #0) - _unifItems - _vestItems; _otherItems = _otherItems apply {[_x,_its #1#(_its #0 find _x)]}; private _conts = _unifConts + _vestConts; for '_i' from 0 to count _Conts -1 do { if (_conts #_i #1 == _uniformObject) exitWith { _conts deleteAt _i }; }; pl_container setVariable ["MGIallContForWear",[]]; { private _itsAndMgs = ((_x #1) call MGI_orderItsAndMgs) params ["_its","_mgs"]; (pl_container getVariable "MGIallContForWear") pushBack [_x #0,_its,_mgs]; } forEach _conts; _g0 = pl_container; clearItemCargoGlobal _g0; } else { _g0 = createVehicle ['WeaponHolderSimulated_Scripted', (player modelToWorld [0,1,1]), [], 0, 'CAN_COLLIDE'] }; player forceAddUniform _selectedUnif; private _unif = uniformContainer player; {_unif addItemCargoGlobal [_x#0,_x#1]} count _selectedItems; {_unif addMagazineAmmoCargo [_x#0,_x#2,_x#1]} count _selectedMags; call { if (pl_container isKindOf "CAManBase") exitWith { removeUniform pl_container }; { _x params ["_cont",["_it",[]],["_mag",[]]]; pl_container addItemCargoGlobal [_cont,1]; private _createdCont = pl_container call MGI_lastCont; {_createdCont addItemCargoGlobal [_x#0,_x#1]} count _it; {_createdCont addMagazineAmmoCargo [_x#0,_x#2,_x#1]} count _mag; } forEach (pl_container getVariable "MGIallContForWear"); {_g0 addItemCargoGlobal [_x #0,_x #1]} forEach _otherItems; }; _g0 addItemCargoGlobal [_currentUnif,1]; _lastCont = _g0 call MGI_lastCont; {_lastCont addItemCargoGlobal [_x #0,_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_orderItsAndMgs = compileFinal " params [['_uniformObject', objNull,[objNull]]]; private _items = getItemCargo _uniformObject; private _mags = magazinesAmmoCargo _uniformObject; private _selectedItems = (_items #0) apply {[_x,_items #1#(_items #0 find _x)]}; private _selectedMags = (_mags arrayintersect _mags) apply {private _v= _x;_x+[{_v isEqualTo _x} count _mags]}; [_selectedItems,_selectedMags]; "; 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...
  21. MGI GUN RUN Last update: 01/05/2020 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 career). - 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: MGI_CAS_MODULE_1 = this; MGI_CAS = compileFinal " if !(GUNRUNCAS) exitWith {}; private _isVirtual = ({_x isKindOf 'air'} count synchronizedObjects MGI_CAS_MODULE_1 ==0); private _pilot = player getVariable 'BIS_SUPP_selectedProvider'; private _veh = vehicle _pilot; private _home = getPos MGI_CAS_MODULE_1; private _trts = (_veh WeaponsTurret [-1]) select { getText (configfile >> 'CfgWeapons' >> _x >> 'nameSound') == 'cannon'}; waitUntil {!isNil {_pilot getVariable 'BIS_SUPP_requester'} && {!isNull (_pilot getVariable 'BIS_SUPP_requester')}}; private _requester = _pilot getVariable 'BIS_SUPP_requester'; 'Gun run requested' remoteExec ['hint',_requester]; waitUntil {!isnil {_pilot getVariable 'BIS_SUPP_supportRunCoords'}}; private _coords = _pilot getVariable 'BIS_SUPP_supportRunCoords'; private _alt = getTerrainHeightASL _coords; private _limit = [40,90] select (_veh distance2D _coords < 2500); _pilot setCombatMode 'BLUE'; _veh flyInHeightASL [_alt +500,_alt +500,_alt +500]; waitUntil {_veh distance2D _coords < 2000}; if (!isNil 'BIS_SUPP_laserTGT') then {deleteVehicle BIS_SUPP_laserTGT; BIS_SUPP_laserTGT = nil}; private _timer = diag_tickTime; _veh flyInHeightASL [_alt +100,_alt +100,_alt +100]; private _resultOK = false; 'In sight' remoteExec ['hint',_requester]; private _typeForIndep = (WEST getFriend RESISTANCE >0.6); private _tgttype = ['laserTargetE','laserTargetW'] select (side _veh == WEST or (side _veh == RESISTANCE && _typeForIndep)); private _tgt = createVehicle [_tgttype,_coords,[],0,'none']; if (count _trts > 0) then { _trt = _trts select 0; private _mags = (getArray (configfile >> 'CfgWeapons' >> _trt >> 'magazines')) arrayIntersect (_veh magazinesTurret [-1]); comment ""private _cnt = getNumber (configFile >> 'cfgMagazines' >> _mags select 0 >> 'count')""; _pilot setCombatMode 'RED'; _pilot reveal [_tgt,4]; _veh selectWeaponTurret [_trt,[-1]]; private _cnt =_veh magazineTurretAmmo [_veh currentMagazineTurret [-1],[-1]]; while {diag_tickTime < _timer + _limit} do { _tgt setPosASL (getPosASL _tgt vectorAdd [0,0,(0.18 * (_veh distance2D _tgt)) -270]); _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 120; deleteVehicle _veh}; "; 0 = MGI_CAS_MODULE_1 spawn { while {true} do { GUNRUNCAS = false; waitUntil {uiSleep 0.2; !isnil {player getVariable "BIS_SUPP_selectedProvider"}}; waitUntil {!isNil {player getVariable "BIS_SUPP_request"} && {(player getVariable "BIS_SUPP_request") #0 == "CAS_Bombing"} && {!isnull (player getVariable "BIS_SUPP_selectedProvider")}}; private _pilot = player getVariable "BIS_SUPP_selectedProvider"; private _veh = vehicle _pilot; private _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; isNil {player getVariable "BIS_SUPP_selectedProvider"} or {!isNil {player getVariable "BIS_SUPP_selectedProvider"} && 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
  22. 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!
  23. MGI HALO JUMP 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 : MGI_HALO = { 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]; _plyr setVariable ['lockInv', _plyr addEventHandler ['InventoryOpened', {true}]]; if (backpack _plyr != '') then { _whs = createVehicle ['WeaponHolderSimulated_Scripted',getpos _plyr vectorAdd [0,-2,1],[],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; if (!isNull _whs) then { detach _whs; _whs setPos (_unit modelToWorld [0,-2,1]); _unit action ["AddBag",objectParent _bpk, _bpktype]; sleep 2; deleteVehicle _whs; }; _unit removeEventHandler ['inventoryOpened',_unit getVariable 'lockInv']; } else { uisleep 2; _unit allowdamage true; }; }; } forEach _MGI_units; openmap [false,false]; false },_parameters] call bis_fnc_addStackedEventHandler; waitUntil {sleep 1; !visibleMap}; ["Jump","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; },[_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; if (!isNull _whs) then { detach _whs; _whs setPos (_unit modelToWorld [0,-2,1]); _unit action ["AddBag",objectParent _bpk, _bpktype]; sleep 2; deleteVehicle _whs; }; _unit removeEventHandler ['inventoryOpened',_unit getVariable 'lockInv']; } else { uisleep 2; _unit allowdamage true; }; }; openmap [false,false]; false },_parameters] call bis_fnc_addStackedEventHandler; waitUntil {sleep 1; !visibleMap}; ["Jump","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; },[_jump_alt,_jump_safety], 5,false, true,"","vehicle _this == _this"]; }; 0 = [this,2000,90] spawn MGI_HALO Now, you can choose in game if you HALO jump solo or in group (AI fellows within 100 meters). EDITED : version nov 19th 2020 Have fun
  24. 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)
  25. 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
×