Here are some general ideas and code snippets that might help. This is not the entire code or even valid code all of it:
1. Place something, eg. another logic or marker, let's call this BeforeBasePos. The logic which has the real pos of the base let's call that AfterBasePos. Place all the squads and units in relation to BeforeBasePos. E.g. if Squad A should start 200m left of the base then place it 200m left of BeforeBasePos. Now what you want to do is teleport all units up to the new base. Example pseudo-code:
PHP Code:
_fromPos = getPos BeforeBasePos;
_toPos = getPos AfterBasePos;
{
_squad = _x;
{
//Single unit is _x - also don't use _x for coordinate in here
//Find relative pos to before base, eg. if unit was 50m N and 100m W of BeforeBase then would be [50, -100].
_newPos = [getPos _x select 0 - _fromPos select 0, getPos _x select 1- _fromPos select 1, 0];
//Now add this to the after base pos:
_newPos = [_newPos select 0 + _toPos select 0, _newPos select 1 + _toPos select 1, 0];
//Now move the unit
_x setPos _newPos;
} forEach _squad;
} forEach [SquadA, SquadB, SquadC, SquadD];
The trick is that if the unit has waypoints you would need to do the same to them. I recommend moving them first then the unit. Also if the squads in question patrols the base and you used the fact that the squads original position is a hidden waypoint in your patrol then you might want to create an explicit waypoint on their own position.
2. In your snippet _newComp contains all the objects created in the composition. So you can go through all objects to check if it can have a gunner:
PHP Code:
_mannableGuns = [];
{
_className = typeOf _x;
//Has gunner then add it
if (getNumber (configFile >> "CfgVehicles" >> _className "hasGunner") == 1) then {
_mannableGuns set [count _mannableGuns, _x];
};
} forEach _newComp;
if (count _mannableGuns > 0) then {
//There were some guns. Create units to man and assign them to guns.
_baseDefenseSquad = createGroup east;
{
_defender = _baseDefenseSquad createUnit [.......];
_defender assignAsGunner _x;
_defender moveInGunner _x;
} forEach _mannableGuns;
};
3. Here's the quick and dirty, but MP friendly version.
Add the evidence to the map. Add an action to it (addAction) e.g. in it's init. However, make sure the condition of the addAction is "isNil 'MAP_FOUND'". When the action is triggered you should:
PHP Code:
MAP_FOUND = true;
publicVariable "MAP_FOUND";
You should also create a trigger with
CONDITION: isServer && MAP_FOUND
ON ACT: createMarker .......
However, not sure this is JIP safe - depends on whether you use beta or not I would guess.