Arma 3
Not enough ratings
CBA ACE AI Surrender Script
   
Award
Favorite
Favorited
Unfavorite
Data Type: Composition
Meta: Dependency
File Size
Posted
Updated
15.932 KB
Aug 19, 2021 @ 8:26pm
Jan 3 @ 12:15am
6 Change Notes ( view )

Subscribe to download
CBA ACE AI Surrender Script

Description
This composition consists of a game logic and comment describing the contents.

When placed in your mission, the game logic allows players to force AI to surrender and drop their current weapon, ready to be taken prisoner. Unattended captives might try to escape, and might arm themselves if the area isn't free of weapons. Affects both civilians and enemy AI, but not players or friendly AI. Compatible with ACE and RHS flashbangs to encourage surrendering when AI are in the affected radius. Well equipped, high morale, or AI that are part of a large group might not surrender immediately. Additionally, "hardcore" AI might not surrender unless outnumbered, outgunned, out of ammo, caught by surprise, or injured.

Note that if you want certain AI to be unaffected by the script, make that AI a "captive" in its attributes. The script is compatible with agents as well, so using the civilian presence module is okay, and generated agents will surrender as expected, although might behave oddly sometimes or play weird animations. AI will show a "hint" when surrendering which can be edited in the script to suit your tastes.

Uses CBA and ACE which is required for both server and clients. Compatible with both singleplayer and multiplayer, including dedicated servers. Can also work with headless clients, but you must be sure that ownership of groups and units do not change too frequently. Only the mission-maker needs the composition: once placed in a mission and the mission published/distributed, the script is copied to clients and servers via the mission file itself just like any other game logic, module, or mission object.

Should be compatible with AI mods like VCOM, but not guaranteed.

To use, under modules -> compositions -> steam workshop, find this composition and place it in your mission. Then as a player, have a weapon and get close enough to a non-captive civilian or enemy AI to threaten it with your weapon. To update an existing mission with the game logic already placed, just delete the old composition and place the updated composition then save/publish your mission again.
32 Comments
chazbotic  [author] Jan 3 @ 12:17am 
@coldstream_81
you can do something like _this setCaptive true in a unit's init to have the script ignore them if you are making a mission if that's what you mean.

but for the whole side would require some logic rework. i've updated the script to support such a situation, but keep in mind that this can sometimes be inconsistent if you have someone on the player's side that's a teamkiller or somehow gets a negative rating.
coldstream_81 Jan 2 @ 5:59am 
Is it possible to not include green force in this script?
Francois Apr 29, 2024 @ 11:25pm 
Thanks for clarification!
chazbotic  [author] Apr 29, 2024 @ 2:47pm 
@Francois
also to directly answer your question, you would have to modify the Antistasi mission in the editor to include this script object then export the mission as a customized Antistasi mission for your use. without re-writing it, it will not work if executed using a module to a mission that is already running.
chazbotic  [author] Apr 29, 2024 @ 2:45pm 
@Francois
the game logic object must be initialized on mission start, so it can't be added during a mission without refactoring. however, yes it's perfectly compatible with the Zeus game mode if you're building the mission in the editor. be aware that you might have unusual situations if you forget to set a unit to "captive" (like surrender of an AI that is doing an animation of sitting will break that animation cycle and probably embed the AI in an object or something weird).

for any such AI, i recommend executing "this setcaptive true;" from the server or wherever it is local. Zeus enhanced can do this with a module iirc.

if you do not have any special AI like that, it will work with any normal AI spawned. i originally wrote this script for my own Zeus missions where players can surrender enemy AI or civilians, et c; but any special AI that i wanted to be ignored by the script (animated AI, cutscenes, hardcore spec ops guys, et c) would be captives in their init.
Francois Apr 29, 2024 @ 10:48am 
@chazbotic
Hi! Quick question (I don't understand moding and scripting of Arma that much and am not much wiser from forums), is it possible to use this in Zeus (not Eden)? I would love to implement surrender system like this to our Antistasi LAN. Thx in advance for any answer.
chazbotic  [author] Feb 9, 2024 @ 6:12am 
@Avibird
i think the animation you want is "Acts_AidlPsitMstpSsurWnonDnon04".
Avibird Feb 9, 2024 @ 4:54am 
I see. I don't really use Ace. I have my own unique revive system I use it's a modified AIS wound system that the playable units will never fully die only stay unconscious the mission ends when all playable units are unconscious. I refer to it as last man standing mode. I understand a lot of people like Ace but I play with a lot of AI and in my opinion Ace is better with only players and with AI. Thanks for your response. I'm working on a basic and action that if an enemy unit is wounded and currently healing themselves if you can get up to 1 m next to them you can use the add action to make them a prisoner.

Just having a hard time finding the animation that sit the unit on the floor with her hands behind their back. I have the one that the unit is standing up with the weapons on their back with their hands behind their head working okay but I would like to find the other one. Do you happen to know that code for that animation. avibird
chazbotic  [author] Feb 8, 2024 @ 3:30pm 
@Avibird
probably, however it's written with CBA and ACE explicitly in mind for animations and functions and would require a re-write to separate it from ACE easily.
Avibird Feb 8, 2024 @ 3:08pm 
is there are way not to have this with ace ?