Removing NVG script for Alive?

  1. 8 years ago
    Edited 8 years ago by silentghoust

    I got my computer yesterday, after installing all my software/hardware. I finally got around to getting back into Arma 3 and scripting again. I'm pretty rusty and had been reviewing new features of AliVe and typing up scripts again. I wanted to remove OPFOR side, and have wrote up the typical set up for it, however this seems to take them only from units that spawn in from profiled. Not that you really notice out of debug range.

    while {true} do {
    {
    if (side _x == east) then
    {
    _x unlinkItem "NVGoggles_OPFOR";
    _x removePrimaryWeaponItem "acc_pointer_IR";
    _x addPrimaryWeaponItem "acc_flashlight";
    };
    }foreach allUnits;

    sleep 5;
    };

    Is there any more efficient way of doing this for AliVe? I would prefer to remove them at a profiled level if possible.

  2. So you want to remove the NVGs from virtualised units? Or is this script not working for units you've placed manually?

  3. Not really possible to remove them from profiles since the profiles only hold the unit classnames. Removing them on spawn is the best you can do.

  4. You can do it with a script.
    First, make a file called my_script.sqf *You can choose your own name if wanted.
    Place this code inside the file:

    params ["_unit"];

    if ((side _unit == EAST) && (vehicle _unit == _unit)) then {
    _unit unassignItem "NVGoggles_OPFOR";
    _unit addPrimaryWeaponItem "acc_flashlight";
    };

    Now place this line of code into you description.ext

    class Extended_Init_EventHandlers {
    class Man {
    init = "_this call (compile preprocessFileLineNumbers 'my_script.sqf')";
    };
    };

    Again, if you make it with another name, change the SQF file name in the description.ext file.

  5. Tupolov

    13 Feb 2016 Administrator

    that might overwrite another init. try myinit = ....

 

or Sign Up to reply!