Arma 3
CBA ACE AI Surrender Script
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 ?
chazbotic  [author] May 10, 2023 @ 1:37am 
@Thoreaufare
there already is code to handle ACE_medical_isUnconscious unless the gvar changed and i missed that update. i'll review that and change it that so it's current.

edit: looks like the gvar did change, ah well. i'll update this script composition. thanks for pointing it out :)
Thoreaufare May 9, 2023 @ 7:52pm 
Hey man, just wanted to say this script worked almost perfectly for a little one-off FBI mission I was doing for my group.

It's simple, straight-to-the-point, and works in dedicated so it gets a :steamthumbsup: from me.

Only changes I made: added a check for unconscious units so you can't, uh, make unconscious people surrender and switched out the hints for BIS_fnc_showSubtitle
chazbotic  [author] Mar 10, 2023 @ 3:40am 
@Zhasik
a few times, however it would require a bit of a rewrite and i currently lack the time to bang it out. once i get some vacation time i'll probably revisit this once my DRO ACE updates are more complete.
Zhasik Mar 9, 2023 @ 10:23am 
Have you thought about releasing this script as a mod with CBA settings?
chazbotic  [author] Sep 17, 2022 @ 1:30pm 
@Sd.Alves
when players are not around they will eventually try to escape, but it takes time and will not work if they are not simulated (if you have dynamic simulation enabled for their group). the "escape" chance is 20% by default, although you can modify this by changing line 106 from 80 to 50 or something (non zero). the smaller the number, the higher the chance to escape, setting it too low will almost guarantee an escape attempt however this might be weird in some scenarios.

generally, i recommend if someone surrendered and aren't in custody, just ignore them and continue the mission.
Sd.Alves Sep 17, 2022 @ 1:06pm 
@chazbotic Yep man thanks i found it this composition, but im having some troblues with surrender civilians, they neverget out of surrender animation, even if i go to other place, they still stoped and never walk again =(, some idea how can i fix that??
chazbotic  [author] Sep 14, 2022 @ 2:11pm 
@Sd.Alves
it isn't a module. as it says in the description:

"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."
Sd.Alves Sep 14, 2022 @ 12:31pm 
How i can find this modules???
chazbotic  [author] Jun 5, 2022 @ 8:55pm 
admittedly, the idea is that you would have weapon discipline to not point it at things you don't intend to shoot, you can also make a civilian a "captive" so they ignore the pointed weapon.

but it's a good idea to have an interaction where you can tell them to go away or something so you don't waste a zip tie et c. the script is designed and intended to "run in the background" of a mission with no user interaction.
Vsauce ™ Jun 4, 2022 @ 11:59pm 
Hello, I mean to make the script works when I press a key, not necessarily forcing AI to surrender. It's a bit annoying that when I point gun accidentally on civilians they surrender
chazbotic  [author] Jun 4, 2022 @ 4:28am 
@Vsauce ™
do you mean force a surrender by pressing a key? sure, however that can be done without this script at all and just with a trigger or eventhandler that waits for the input.
Vsauce ™ Jun 4, 2022 @ 4:14am 
Hi! Is it possible to make it work by pressing a key?
chazbotic  [author] Mar 4, 2022 @ 6:55pm 
@TacticalRhodie
unfortunately this script requires both CBA_A3 and ACE3 to be loaded to function. i am not familiar with Direct Action, but if it is ACE compatible then you should be able to open a copy of the mission in the 3den editor, navigate to compositions and place it on the map somewhere, then save the mission and play it as singleplayer like normal.

the only downside is that some missions that have specific scripted sequences might get broken if the AI surrenders when they should instead be following the script...
TacticalRhodie Mar 4, 2022 @ 4:15pm 
Hello, I play singleplayer scenarios using Direct Action - Altis, and Direct Action Recon Ops, etc. Pretty much any open map Player/AI vs AI. How do I implement this script in the scenario so that the AI has a change to surrender and be taken captive? I don't have any modding or scripting abilities so I wasn't sure how to mesh it with another existing non ACE based mod.
Sayker Jan 6, 2022 @ 12:10pm 
okey thx ;)
chazbotic  [author] Jan 6, 2022 @ 8:20am 
@Bobzap/Sayker
units will not surrender if they are marked "captive" in the mission, or if you are not armed/aren't pointing a weapon at them. you can also interact with them with ACE to release prisoner as well.
Sayker Jan 6, 2022 @ 1:58am 
Heyyy !
I encountered a problem on an undercover mission. A unit was passing in front of me, and obviously it surrendered. It was not my wish. Do you think you have a solution or an add action for the action?

THX !! ;)
Vsauce ™ Nov 22, 2021 @ 12:35pm 
Alright, thank you!
chazbotic  [author] Nov 21, 2021 @ 10:14am 
@Vsauce
yes, although i would not recommend it without consideration that it will affect any cursorObject in range that otherwise meets the definition.

once placed in your mission, edit line 57 (_target distance _player < 12) to (_target distance _player < #) where # is the distance you prefer.
Vsauce ™ Nov 20, 2021 @ 5:19pm 
The range at which players can force AI to surrender
chazbotic  [author] Nov 18, 2021 @ 1:53pm 
@Vsauce
by action range do you mean the range at which players can force AI to surrender or some other range?
Vsauce ™ Nov 18, 2021 @ 10:58am 
Hi, is it possible to increase the action range?