M

Mats391

Member

Last active 4 years ago

  1. 9 years ago
    Tue Nov 4 09:36:06 2014
    M Mats391 posted in Combat support init code.

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

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

  2. Mon Nov 3 19:37:34 2014
    M Mats391 started the conversation Combat support init code.

    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?

  3. Mon Nov 3 19:32:52 2014
    M Mats391 joined the forum.