Help with code to add objectives

  1. 7 years ago

    How would I modify this code to ID each objective created to something unique/different, so I can add multiple objectives?

    if (triggerActivated obj) then {{[_x,"addObjective", ["OPCOM_custom_1", getPos K4A, 100, "CIV", 100] ] call ALiVE_fnc_OPCOM; } foreach OPCOM_INSTANCES};
  2. Edited 7 years ago by SpyderBlack723

    "OPCOM_custom_1" => str random 10000

  3. You're a saint. Thank you!

  4. Edited 7 years ago by dev614

    Getting this error when activating the trigger,

    '...e") then { nil } else { _value },
    _hash |#|select 3] call (uiNamespace getVariable ...'
    Error Generic error in expression
    File /x/alive/addons/x_lib/functions/data/fnc_hashSet.sqf [ALiVE_fnc_hashSet], line 1824

    Any ideas?

  5. too little information from that to tell, make sure there are 3 arguments being passed to ALiVE_fnc_hashSet

  6. Edited 7 years ago by dev614

    How does one identify the OPCOM name? I tried renaming my military commander module to "OPCOM_Blu" in the editor, and using the following code in a trigger:

    [OPCOM_Blu,"addObjective", [str random 10000, getPos K4A, 100, "CIV", 100] ] call ALiVE_fnc_OPCOM;

    I only want the objective being placed for my BLUFOR units, the code before worked fine in the trigger I just don't want every OPCOM instance to recieve that objective, only BLUFOR.

    UPDATE: Got it working by unnaming mil commander module and using "OPCOM_1" instead of "OPCOM_Blu" in code. Thanks for the help, Spyder!

 

or Sign Up to reply!