Combat support init code

  1. 10 years ago

    Hi,
    i am trying to add combat supports with custom init code to my mission. I followed this tutorial: http://alivemod.com/wiki/index.php/Combat_Support and got the chopper i am using to be recognized as combat support. However the init code does not work. According to the wiki article you just set that as a long string for "CS_CODE" and thats what i did.

    _unit = _this select 0;
    _callsign = _this select 1;
    _height = _this select 2;
    
    _unit setVariable["CS_TYPE", "TRANSPORT"];
    _unit setVariable["CS_CALLSIGN", _callsign];
    _unit setVariable["CS_HEIGHT", _height];
    _unit setVariable["CS_CODE", "clearItemCargo this; clearWeaponCargoGlobal this; 
    clearMagazineCargoGlobal this; clearBackpackCargoGlobal this;"];

    This is the error from rpt file:

    Error in expression <clearItemCargo this; clearWeaponCargoGlobal this; 
    clea>
      Error position: <this; clearWeaponCargoGlobal this; 
    clea>
      Error Undefined variable in expression: this
    Error in expression <clearItemCargo this; clearWeaponCargoGlobal this; 
    clea>
      Error position: <this; clearWeaponCargoGlobal this; 
    clea>
      Error Undefined variable in expression: this

    Can anyone give me a hint at how to add the init code?

  2. Tupolov

    3 Nov 2014 Administrator

    Try _this or _entry instead of this in the CS_CODE string

  3. @Tupolov Try _this or _entry instead of this in the CS_CODE string

    It seems to be "_this select 0" to get the vehicle.

 

or Sign Up to reply!