Easy way to remove gear across a faction?

  1. 7 years ago
    Edited 7 years ago by Dimitrius

    Greetings ALiVE Team,

    Dimitrius from Tacticalgamer.com here with another set of questions for you. First of all, we use your framework on many of our missions and are happy to report it works well for our mission devs.

    So my question is not about removing certain roles by classname, but equipment instead. Is there an easy way in a COOP Mission to prevent any AI spawned for a faction to not have night vision?

    So basiclly, I want to place a TAOR and have enemies spawn in it using a mil or civ objective module, but I do not want them to have NVGs.

    Followup Question: Are there any working, recent Fast Rope scripts that anyone can recommend?

    Thank you in advance if you have time to answer my question.

    Regards,

    Dimitrius
    Mission Dev
    Tacticalgamer.com

  2. @Dimitrius Is there an easy way in a COOP Mission to prevent any AI spawned for a faction to not have night vision?

    Paste the code below in your init.sqf. No clue if it actually works but the CBA_fnc_addClassEventHandler function should point you in the right direction.

    ["CAManBase", "init", {
        (this select 0) unassignItem "NVGoggles";
        (this select 0) removeItem "NVGoggles"
    }] call CBA_fnc_addClassEventHandler;
  3. Hmm so if I put that in an object then it would work?

    I can try. I will report back.

    Thanks!

  4. Edited 7 years ago by incontinenetia

    If that doesn't work, here's what I've been using:

    Description.ext:

    class Extended_InitPost_EventHandlers {
         class CAManBase {
    		init = "_this call (compile preprocessFileLineNumbers 'postInitXEH.sqf')";
    	};
    };
    

    Then create postInitXEH.sqf in your mission root with this in it:

    params [["_unit",objNull]];
    
    private _factions = ["YO_FAC_NAMZZZ","P_HOBO_F"]; //List of factions you want to run the script on
    
    if (faction _unit in _factions) then {
         _unit unassignItem "NVGoggles";
         _unit removeItem "NVGoggles"; 
         //Plus any other code you want to run on units of this faction
    };

    @marceldev89's solution is way cleaner than mine but just in case you have any trouble with it, this should work too.

  5. Edited 7 years ago by Nichols

    I have an sqf that one of the guys in my community worked on that works to both remove and refit the faction/individual unit when run correctly. Will post it on here when I get a second.

 

or Sign Up to reply!