Alright here we go, it looks complicated but I just have a tendency to put a ton of information since I don't know your experience level with scripting.
First you need to define this function which you can do just by placing it in your init.sqf ( I usually put it at the bottom so you don't crowd the file (and so the sleep command which is explained later doesn't hold up the bulk of your init.sqf)).
cjb_addObjectiveToSides = {
private["_objectiveParams","_factions","_faction","_opcom","_opcomSide"];
_objectiveParams = _this select 0;
_factions = _this select 1;
{
_opcom = _x;
{
_faction = _x;
_opcomSide = [_opcom,"side",""] call ALiVE_fnc_HashGet;
if( _opcomSide == _faction) then {
[_opcom, "addObjective", _objectiveParams] call ALiVE_fnc_OPCOM;
};
} forEach _factions;
} forEach OPCOM_INSTANCES;
};
Then, also in the init.sqf you need to do this for each objective you are going to add
[["obj_1", getMarkerPos "Markername", 100,"CIV"],["WEST","INDEP","EAST"]] call cjb_addObjectiveToSides;
For each objective you will have to change a few things to make sure they are each unique
1. "obj_1"
-- this can just be changed to ex. "obj_2"
,"obj_3"
just add 1 each time you add another objective
3. 100
is the size, you can change the size up or down depending on the size of objective you want
4. ["WEST","INDEP","EAST"]
This is the sides that the objective is made aware of to, the current setup will do it for all sides. However, if you make it ["EAST"] then it will only be made aware to the EAST side. If you make it ["EAST","WEST"] then both EAST and WEST will attempt to occupy the objective.
-----------------------------------------------------------------------------------------------------------------------
An example of this being used is
[["obj_1", getMarkerPos "Marker1", 100,"CIV"],["EAST"]] call cjb_addObjectiveToSides;
[["obj_2", getMarkerPos "Marker2", 100,"CIV"],["EAST"]] call cjb_addObjectiveToSides;
This will make two objectives at Marker1 and Marker 2 with a size of 100 square meters that is only occupied by the EAST side.
2. getMarkerPos "Markername"
, you need to change "Markername" to the marker where this objective will be added -- this defines the location of the objective
IMPORTANT
Since ALiVE initializes during mission init, if it is called immediately it will fail since ALiVE has not initialized the OPCOM (Military AI Commander) module yet. To get around this ( I couldn't figure out another automatic way) you can simply put a sleep command before calling this.You may need a longer sleep time if your mission takes a long time to load, haven't really tested it so I am not sure how long on average ALiVE would take to initialize.
sleep 60;
[["obj_1", getMarkerPos "Marker1", 100,"CIV"],["EAST"]] call cjb_addObjectiveToSides;
[["obj_2", getMarkerPos "Marker2", 100,"CIV"],["EAST"]] call cjb_addObjectiveToSides;
This will create the objectives 60 seconds after you press "Launch" in the Editor/MP.