AI Respawn Custom Loadout

  1. 8 years ago

    I know this has been covered in many placed, but I can't seem to get it to work. Currently, I have an AI squad working with me, and have been able to set up a helicopter reinforcement script as used here (bottom of the page).
    My squad starts out with a custom load out I have set up in the arsenal. Is there any way I can setup the AI to respawn with that custom load out again? Or better yet with what they were carrying at death? Currently they just spawn with default gear. I have given them specific variable names, and assume it has to do with the array, but just don't know much scripting.

    Thanks in advance.

  2. Try this:
    https://forums.bistudio.com/topic/186769-spyder-addons/

    Specifically:

    Loadout Organizer
    - Create folders to store loadouts and other folders

    - Save, Load, Delete, and Name loadouts

    - View class gear before loading it

    - Transfer loadouts and folders to other players and AI (configurable)

    - Access Virtual Arsenal (configurable)

    - Choose a loadout to automatically load class on respawn

    Usage: Sync module to object to add the loadout manager action to it

  3. So this works great minus one thing. After I respawn, I no longer have access to the loadout manager. Any idea as to why this is?

  4. Edited 8 years ago by SpyderBlack723

    It's because the action does not persist through death. It's usually recommended to add the action to a flagpole or ammo box so it is always available at a permanent static location.

  5. Wow that was a fast response. Thanks!

    Is there anyway to make it persist through death via a trigger or something? I know the support requestor module (the vanilla one not alive) maintain through respawn.

  6. I tried the following with no success.

    this addEventHandler ["respawn", _this synchronizeObjectsAdd ["SpyderAddons_sup_loadout"]];

    It tells me Local Variable in global space. No idea what that means.

  7. Edited 8 years ago by DaVidoSS

    Set variable name to SpyderAddons_sup_loadout and then try to synchronize witch its variable name using correct eventhandler syntax

    addEventHandler ["respawn", { _this synchronizeObjectsAdd [modulevariablename]}];
  8. I get an error "type array, expected object" when I set it up like that.

  9. Won't really work like that since it only applies the action upon module initialization

  10. Edited 8 years ago by SpyderBlack723
    this addEventHandler ["respawn", {
    	_x setVariable ["LoadoutManager_Settings", [true,true]];
    	_x addAction ["Access Loadout Manager", {[nil,"open", _this] call SpyderAddons_fnc_loadoutManager}];
    }];
 

or Sign Up to reply!