Jump to content
Sign in to follow this  
guttersnipe

Remove Alive Custom Objective via trigger

Recommended Posts

Hi, I'm trying to use a trigger to remove a custom objective named CustomObjectiveTatters

I've been calling the script (described here - (http://alivemod.com/forum/2684-alive-and-scripting/0)

with this in the trigger activated option

["CustomObjectiveTatters","GUER"] call cjb_RemoveObjectiveToSides;

I'm getting this error

20:39:08 File C:\Users\Pete\Documents\Arma 3 - Other Profiles\Pistol%20Pete\mpmissions\Checkpoint%20Sandybottom.Takistan\Scripts\opcomrem.sqf, line 17
20:39:08 Error in expression <ctive", _id] call ALiVE_fnc_OPCOM;
};
} forEach _factions;
} forEach OPCOM_INSTA>
20:39:08 Error position: <forEach _factions;
} forEach OPCOM_INSTA>
20:39:08 Error Generic error in expression

I've packed up the script in a .sqf named opcomrem (below)

 

-----------------------------------------------------------------------------------

//Example:["ID_Name","SIDE"] call cjb_addObjectiveToSides;

cjb_RemoveObjectiveToSides =
{
 private["_factions","_faction","_opcom","_opcomSide"];
 _id = _this select 0;
 _factions = _this select 1;
 {
  _opcom = _x;
  {
   _faction = _x;
   _opcomSide = [_opcom,"side",""] call ALiVE_fnc_HashGet;
 
   if( _opcomSide == _faction) then {
    [_opcom, "removeObjective", _id] call ALiVE_fnc_OPCOM;
   };
  } forEach _factions;
 } forEach OPCOM_INSTANCES;
};

--------------------------------------------------------------------------------------

 

 

I've been using the other 'addobjective' option via a similar script described on that page in the same trigger without difficulty, but can't figure out what's wrong with the remove option.

Can anyone help and or suggest another option to switch off an objective no longer required in scenario?

Many thx

Share this post


Link to post
Share on other sites

Hi! This is not a great place to get help for this. I'd recommend coming over here: http://alivemod.com/forum/

 

On the ALiVE wiki, there is an example code for adding a custom objective post init, so perhaps you can suss out how to delete one using the example?: http://alivemod.com/wiki/index.php?title=Script_Snippets

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×