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

  1. 8 years ago

    What is the best/easiest way to end a mission if I'm doing a large scale military operation? I.e. Blufor needs to take 5 different cities/bases or Opfor wins if they take several Blufor targets.

    I've tried to do this w traditional triggers but since units may only be "virtual"in an area and not spawned it doesn't seem to work.

    Thoughts?

  2. Edited 8 years ago by SpyderBlack723

    You can use the script off the wiki for this type of detection

    http://alivemod.com/wiki/index.php/Script_Snippets#Detect_Virtual_Units_.28Profiles.29_in_a_Trigger_Area

    This only works on profiled units, whether they are virtualized or not.

    So if you want the trigger to activate when there are zero east groups within range of the trigger center you can do

    (((count ([getposATL thisTrigger, 250, ["EAST","entity"]] call ALIVE_fnc_getNearProfiles)) == 0) and ((count ([getposATL thisTrigger, 250, ["EAST","vehicle"]] call ALIVE_fnc_getNearProfiles)) == 0));

    With 250 being the range from the trigger center to check for any profiles.

  3. Ok, so all I would edit in that code is the range right? I can leave EAST (or WEST, or Independent) and entity and that would cover any factions used on that side correct?

  4. You got it... side should be the Enemy side being detected and as you mentioned adjust the 250m range to suit your mission.

  5. Edited 8 years ago by SpyderBlack723

    Yep, just put the range to the size of the area needed. Just change the EAST to whatever side the enemy is on. You can actually leave "entity" there, it defines what type of profiles to look for (one is entity and one is vehicles). Just make sure you change the info throughout the entire condition since it's actually two conditions mushed together.

  6. Very nice. Thanks fellas. I love creating missions, but I'm not the greatest scripting expert.

    These will work nicely for my Iron Front ALiVE missions as well to cover US, Nazi, or Russian offensives.

  7. On a side note....what would be the script if I wanted my friendly units to occupy these objectives, not just make sure no Opfor units are present? I.e cities/bases that are empty of either side must be occupied to win.

  8. Edited 8 years ago by SpyderBlack723

    You could do the same thing but with a check to make sure there is a group from your side within the area along with the condition already posted to make sure there are no enemies near.

    (((count ([getposATL thisTrigger, 250, ["EAST","entity"]] call ALIVE_fnc_getNearProfiles)) == 0) and ((count ([getposATL thisTrigger, 250, ["EAST","vehicle"]] call ALIVE_fnc_getNearProfiles)) == 0) and ((count ([getposATL thisTrigger, 250, ["WEST","entity"]] call ALIVE_fnc_getNearProfiles)) > 0) and ((count ([getposATL thisTrigger, 250, ["WEST","vehicle"]] call ALIVE_fnc_getNearProfiles)) > 0));

    Hopefully that works because I got lost in the parentheses and can't test right now. It checks to make sure there are no enemies nearby and that there is at least one group from side WEST in the area.

  9. You da man. Anxious to try these out when I leave the office today.

  10. I'd love to check out your IF + ALiVE missions if you are willing to share them.

  11. I'll get them up this week. Been testing with my small MP group.

  12. I'm having some trouble, as I'm not very savvy with scripting. I make a trigger and paste what Spyder posted in his first message with the correct range to look for 'East' entities, does that translate to 'Opfor'? Or is it literally having to do with east and west sides of the map.

    I put a trigger in the center of my insurgency mission hoping that once insurgents were taken out in the range, it would kick on and complete for me, but I get an instant mission complete on booting up the preview in the editor. Are there any other things to edit in the trigger box to make this work?

  13. East = opfor, west = blufor, independant = AAF side

    Use this new code

    Condition:

    if (isServer) then {count ([getposATL thisTrigger, 15000, ["EAST","entity"]] call ALIVE_fnc_getNearProfiles) == 0 && {count ([getposATL thisTrigger, 15000, ["EAST","vehicle"]] call ALIVE_fnc_getNearProfiles) == 0}} else {false};

    On Activation: if (isServer) then { ["end1","BIS_fnc_endMission",true,true] call BIS_fnc_MP};

  14. Holy crap, that was fast! Thanks for all the help the last couple days, Spyder, if it weren't for you I might still be trying to figure out how to put ALiVE modules down in the editor. I guess the only way to test if this works quickly is to either make the range smaller and clear it, or delete all enemy entities by removing their modules?

  15. Edited 8 years ago by SpyderBlack723

    Just make a quick scenario using custom objective to spawn one group, in your unit init line put
    this setCaptive true; so you won't be attacked
    Then kill all the units and it should 'win'

  16. Wow, it works well from the looks of it. Thanks. I wish I understood the scripting part better but I guess with time and experience, I will.

  17. Edited 8 years ago by ZeroG

    I got a related question:

    I am currently using an active force counter, kind of a ticket display on screen telling how many unvirtualized entities are alive on the whole AOR from each side:

    while {alive FCOUNTER} do {
    
    BLUE = {side _x == WEST} count allunits;
    RED = {side _x == EAST} count allunits;
    
    (uiNameSpace getVariable "BLUE") ctrlSetText format ["BLUE: %1",BLUE];
    (uiNameSpace getVariable "RED") ctrlSetText format ["RED: %1",RED]; 
    
    sleep 2;
    };

    Now, 2 questions:

    • How would I also count the virtualized units by side?
    • How would I also count the virtualized reinforcements by side?

    Besides: the related trigger spans over the whole map...

    Thanks!

  18. Edited 8 years ago by SpyderBlack723
    _profilesWest = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] call ALIVE_fnc_profileHandler);
    _profilesEast = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] 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];

    If you want to count forcepool by side, instead of faction, you will need to combine the forcepool of each faction that are on the same side and combine their count.

  19. Thank you for your quick help, Spyder. Though there is little to correct: missing closing brackets

    _profilesWest = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] call ALIVE_fnc_profileHandler);
    _profilesEast = count ([ALiVE_profileHandler, "getProfilesBySide", "WEST"] call ALIVE_fnc_profileHandler);
    hint format ["Force Matchup \n West: %1 total groups \n East: %2 total groups", _profilesWest, _profilesEast];
  20. 7 years ago
    Edited 7 years ago by ski2060

    Wow, glad I stumbled upon this while looking for win conditions for my mission.

    I have 2 enemy forces on my map. One is an Insurgency, one is an Occupation. I would like to set Win conditions for BluFor clearing the map, or at least a large portion (with a trigger area), and/or by destroying a certain number of Insurgent IED factories and HQ's.

    How would I go about doing something like that? I assume for the former win condition, just use the above code in my trigger for checking Enemy (IND) Units. Just replace EAST with IND in the above code?
    But how would it be used to check for Insurgent HQ/IED factories? Is that even possible?

    Thanks for all the awesome help!

  21. Newer ›
 

or Sign Up to reply!