Error on transport helicopter init

  1. 4 weeks ago

    I am using grumpy rhino's "medium helicopter mods" which has a nice selection I use for Vietnam era scenarios. The crew spawned with the Huey choppers are vanilla pilots.
    The problem is that at night all wear NVG. Which is grossly incompatible with a vietnam mission.

    I have typed this into the transport helicopter init:

    {this unassignItem "NVGoggles"; this removeItem "NVGoggles";} foreach crew this;

    But I keep getting an error message that is missing a } or a ; which makes no sense. And at night pilots wear the NVG.

    What am I doing wrong?

    Thanks.

  2. 3 weeks ago

    SavageCDN

    Oct 24 Moderator

    You'll need to do something like this:

    http://alivemod.com/wiki/index.php/Script_Snippets#Adding_Custom_Inits_to_Spawned_Units

  3. The code is executed on the chopper itself, so this is the actual vehicle, not the pilots/crew.

    Try something like this:

    {
        _x unassignItem "NVGoggles";
        _x removeItem "NVGoggles";
    } forEach (crew this);
  4. Savage, Thanks a lot. your proposed soluction works perfectly. Had to figure a couple of things, but finally got there. :)
    whigital. your proposal was one of the first things I tried, but unfortunately it did not work.

 

or Sign Up to reply!