[SOLVED] Multispawn "respawn enemy check" or how to disable respawn if enemy close by

  1. ‹ Older
  2. 8 years ago

    *insert random political statement*

    If I have to choose between Donald Trump or Hillary Clinton next November, I may have to study up on those wacky centimeter/kilometer thingys as I'll be applying for Canadian citizenship.

  3. Ha! I was thinking the same thing the other day when Gawker had that article about the guy that moved to Canada when Bush W got elected.

  4. Edited 8 years ago by Asmodeus

    Back to the topic! :)

    I found a nice way to "dynamically" disable/enable player respawns by SYNCing a trigger to BIS Respawn position (Modules -> Multiplayer -> Respawn position).

    Using the code snippet
    ((count ([getposATL thisTrigger, 300, ["GUER","entity"]] call ALIVE_fnc_getNearProfiles)) == 0);
    I first saw here Best way to "end mission" in large scale assault?, has proved to be very useful in many scenarios :)

    Here's but one way to create multiplayer respawns that get disabled/enabled according to the enemy presence near a respawn:

    create a trigger that is Repeatable and in the Condition field add the code snippet

    ((count ([getposATL thisTrigger, 300, ["GUER","entity"]] call ALIVE_fnc_getNearProfiles)) == 0);
    • 300 is the radius or area where, if enemy is present, the respawn should be disabled
    • change GUER to represent the enemy faction (eg. EAST, GUER, NATO) or anything that is supposed to represent an entity that should enable/disable the player respawn
    • use == 0 for call ALIVE_fnc_getNearProfiles (in short: when eg. GUER profiles is 0 inside the trigger area respawn will be available, when GUER profiles is more than 0 respawn will be disabled)

    Then place one BIS Respawn position as close as possible the trigger you just created and sync it to the trigger and you're done!

    This method has so far worked flawlessly for disabling player respawns when there's enemy profiles (virtualized or spawned) inside the trigger area. Naturally when there's no more enemy profiles inside the trigger area the player respawn will once again become available.

 

or Sign Up to reply!