Best way to "end mission" in large scale assault?

  1. ‹ Older
  2. 8 years ago
    Edited 8 years ago by SpyderBlack723

    Replace EAST with GUER

    It's possible to check for having all installations destroyed, but you'd have to figure either delay execution of it or figure out a way for it to avoid ending the mission immediately since there are no installations at mission start.

  3. What if you start off with Insurgent buildings via placement? Like low level installations to begin with?

  4. Edited 8 years ago by SpyderBlack723

    Untested, but worth a try

    In your init.sqf put

    [] execVM "script.sqf";

    In your script.sqf (in the root of your mission), put the contents of this link
    https://gist.github.com/SpyderBlack723/b15f59b6a1928842aeae

    All you have to do is change

    private _asymmFaction = "OPF_G_F";

    to whatever faction you have for the insurgents.

    This script begins checking after 20 minutes into the game to avoid an instant ending mission.

  5. Sweet, thanks Spyder.

  6. Edited 8 years ago by DaVidoSS

    Undefined variable _OPCOM_HANDLER?
    Exiting with ALiVE_installationsActive = true where
    ALiVE_installationsActive is defined as true already make any sense?
    I am asking because i am interested to implement any end mission to alive insurgency

  7. Edited 8 years ago by SpyderBlack723

    Ah, forget to change a variable name.

    Switch all instances of _OPCOM_HANDLER to _objective

  8. How to simply count current insurgents installations?

  9. Hi.

    I am trying to find a way to define dominant faction while mission is running.
    For now i have this:

    fnc_getdominant = {
    
    private ["_objectivePosW", "_aliveunitsW", "_entitiesCountW", "_objectivePosE", "_aliveunitsE", "_entitiesCountE", "_w", "_profiledEntCountW", "_profiledVehCountW", "_e", "_profiledEntCountE", "_profiledVehCountE", "_return"];
    
    	_objectivePosW = [];
    	_aliveunitsW = [];
    	_entitiesCountW = 0;
    	_objectivePosE = [];
    	_aliveunitsE = [];
    	_entitiesCountE = 0;
    
    	for "_w" from 0 to count ([OPCOM_instances select 0,"objectives",[]] call ALiVE_fnc_hashGet) -1 do {
    
    		_objectivePosW pushback (((([OPCOM_instances select 0,"objectives",[]] call ALiVE_fnc_hashGet) select _w ) select 2) select 1);
    		_profiledEntCountW = count ([_objectivePosW select _w, 500, ["WEST","entity"]] call ALIVE_fnc_getNearProfiles);
    		_profiledVehCountW = count ([_objectivePosW select _w, 500, ["WEST","vehicle"]] call ALIVE_fnc_getNearProfiles);
    		_entitiesCountW = _entitiesCountW + (_profiledEntCountW + _profiledVehCountW);
    
    	};
    
    	{
    		if (side _x == West) then {
    			
    			_aliveunitsW pushBack _x;
    		}
    	} forEach allunits;
    
    	
    	for "_e" from 0 to count ([OPCOM_instances select 1,"objectives",[]] call ALiVE_fnc_hashGet) -1 do {
    
    		_objectivePosE pushback (((([OPCOM_instances select 1,"objectives",[]] call ALiVE_fnc_hashGet) select _e ) select 2) select 1);
    		_profiledEntCountE = count ([_objectivePosE select _e, 500, ["EAST","entity"]] call ALIVE_fnc_getNearProfiles);
    		_profiledVehCountE = count ([_objectivePosE select _e, 500, ["EAST","vehicle"]] call ALIVE_fnc_getNearProfiles);
    		_entitiesCountE = _entitiesCountE + (_profiledEntCountE + _profiledVehCountE);
    
    	};
    
    	{
    		if (side _x == East) then {
    			
    			_aliveunitsE pushBack _x;
    		}
    	} forEach allunits;
    
    	_return = [_entitiesCountW + (count _aliveunitsW), _entitiesCountE + (count _aliveunitsE)];
    	_return
    };

    This is returning count of alive units + profiled for each side in format :

    [west, east]
    example:
    [145,193]

    Is that anyway useful to define dominant faction couple times under game play and even end the mission on some big difference between this two indexes?

  10. Edited 8 years ago by SpyderBlack723

    Try this

    _fnc_getGlobalUnitCountBySide = {
    	private _west = 0;
    	private _east = 0;
    	private _indep = 0;
    
    	// count spawned units
    
    	{
    		switch (side _x) do {
    			case EAST: {_east = _east + 1};
    			case WEST: {_west = _west + 1};
    			case GUER: {_indep = _indep + 1};
    		};
    	} foreach allUnits; // use foreach so you only need to iterate through allUnits once
    
    	// count inactive profiles
    
    	private _inactiveProfilesBySide = ([ALiVE_profileHandler,"profilesInActiveBySide"] call ALIVE_fnc_hashGet) select 2;
    	_east = _east + (count ((_inactiveProfilesBySide select 0) select 1));
    	_west = _west + (count ((_inactiveProfilesBySide select 1) select 1));
    	_indep = _indep + (count ((_inactiveProfilesBySide select 2) select 1));
    
    
    	[_east,_west,_indep]
    };

    You could also change the allUnits loop to allGroups if you want to only count groups (probably the better option since counting profiles is only taking account a single group, and not each individual unit)

  11. Thanks Spyder works perfect.

  12. 5 years ago

    Hi!

    I don't know if this thread is alive anymore but I had couple of questions of the scripts above.

    I tried these scripts on my radio trigger (The vanilla mode where you activate it with radio commands alpha or beta).

    _profilesWest = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] call ALIVE_fnc_profileHandler);
    _profilesEast = count ([ALiVE_profileHandler, "getProfilesBySide", "EAST"] call ALIVE_fnc_profileHandler);
    hint format ["Force Matchup \n West: %1 total groups \n East: %2 total groups", _profilesWest, _profilesEast];
    
    _forcePool1 = [ALIVE_globalForcePool, _faction1] call ALIVE_fnc_hashGet;
    _forcePool2 = [ALIVE_globalForcePool, _faction2] call ALIVE_fnc_hashGet;
    hint format ["Forcepool Values \n West: %1 total groups \n East: %2 total groups", _forcePool1, _forcePool2];

    It seemed to work when I tested in local but doesn't work on our dedicated server. The first script gives "scalar" instead of numbers and the second script gives "<nil>" instead of numbers.

    I am not an expert using scripts in Arma/Alive so any help is welcome. :)

 

or Sign Up to reply!