Home   Help Search Login Register  

Author Topic: Enemy AI surrender and capture script (ACCEPTED)  (Read 9710 times)

0 Members and 1 Guest are viewing this topic.

Offline norrin

  • Tutorial Writer
  • **
Enemy AI surrender and capture script (ACCEPTED)
« on: 05 Feb 2008, 01:52:30 »
Surrender script.

Description
A script that allows you to set an enemy group so that it surrenders after a certain number of group members are dead.  Once the conditions are met the surrendering units drop their weapons on the ground, put their hands behind their heads and are set as captives. You can then move up to them and get them to join your group and move them to a friendly prison or drop-off point.  The captured units can at no time carry weapons, drive vehicles or operate on-board weapon systems.

Script

You can get the latest version of surrender script from here: http://home.iprimus.com.au/simonnsl/ACE/capture_test_10.Intro.zip

Instructions for test mission
Move south and shoot an OPFOR unit from each of the two enemy groups. The remaining units will drop there weapons and then put hands behind their heads and will be made setCaptive true (ie. turn blue on the map). Move next to one and an action to "take prisoner" should appear. Capture and then wait a few seconds the prisoner will join your group. Then take him back north and send him just between the barbed wire in front of the tents. He should resume the hands behind head animation and then after a couple of seconds he will disappear. You will get a message POW returned for interrogation. If you shoot units that have surrended you will get a message. If you order a POW to take a weapon he will immediately put it down again so he cannot be used as a BLUFOR unit.

You can change the number of OPFOR units that need to be shot before the group surrenders in the init.sqf in the line:

{[_x, 2, _allies] execVM "NORRN_capture\group_surrender.sqf"} forEach _enemy_groups_high_morale;

You'll need a player in the leader's slot (or you'll have to shoot the AI leader so leadership passes down the group) or have the AI disabled.

To implement
* Copy across the text from the init.sqf and NORRN_capture folder to your mission file.

*All the units in the surrendering groups will have to be named in the editor as well as the surrender groups themselves eg east_1 = group this.

*Update the code in the init.sqf - you have to put allies and enemys generic unit types and also the names of the enemy groups that you want to surrender in _enemy_groups_high_morale and _enemy_groups_low_morale lines. There's two lines as you may want different groups to surrender when different numbers of troops die.

*You'll need a marker on the map called "prison". This is where the enemy units will leave your group.

*Make sure that the rank of the group leader of friendly units is higher than the rank of the captured units

*If you don't want captured units boarding a vehicle or chopper in the gunner or driver slots you'll need to put this code in the int line of the vehicle.Code:
this addEventHandler ["GETIN", {if ((_this select 1) == "driver" && (_this select 2) isKindOf "soldierEB" || (_this select 1) == "gunner" && (_this select 2) isKindOf "soldierEB") then {(_this select 2) action ["GETOUT", (_this select 0)] }}];

- you may need to adapt this if the surrendering units are not OPFOR

Tested
On both ArmA 1.08 and 1.09 and JIP
« Last Edit: 25 Feb 2008, 01:07:49 by Loyalguard »

Offline Loyalguard

  • Former Staff
  • ****
Re: Enemy AI surrender and capture script (TESTING)
« Reply #1 on: 06 Feb 2008, 14:11:55 »
Looks promising Norrin!  I will DL and start testing within a few days.

Offline terran4999

  • Members
  • *
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #2 on: 29 Nov 2008, 09:16:29 »
the script doesn't work after I load the saved mission, anyone help me??

Offline norrin

  • Tutorial Writer
  • **
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #3 on: 29 Nov 2008, 22:50:04 »
Just checked on a local server and it seems to be working fine in ArmA 1.14 - are you using any addons that may conflict with the script, have you changed the test mission in any way or in your saved mission used it with different sides as you may need to change some of the settings?  If its your own mission do you want to send it to norrin@iinet.net.au and I'll see if I can fix it for you.

norrin


Offline terran4999

  • Members
  • *
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #4 on: 30 Nov 2008, 02:17:33 »
I bought ARMA Gold and its version 1.08 I downloaded a lot of addon units but no mods. In my mission I did not use any of the addon units. Do you think ver 1.08 will conflict with your script.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #5 on: 30 Nov 2008, 03:41:15 »
1.08 is, well, an old version of the game, so noone really wants to be using it. 1.14 is a full release (not beta) so there is no excuse. Certainly, you won't find anyone interested in the extra work to make their stuff backwards compatible with it, though for 1.09-1.12 (beta releases) a lot of people didn't intentionally use the new features in their scripts.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline alanb

  • Members
  • *
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #6 on: 11 Jan 2010, 18:49:03 »
Edit: got it sorted by using Class name of individual soldier, just need to know how to do it so I can have more than one type of soldier per unit?

Hi,

I have downloaded this from http://www.ofpec.com/ed_depot/index.php?action=details&id=531  what do I need to do so that it works for OPFOR rather than Civilians?  I see there is a line in init.sqf which is _enemies           = "civilian";   I guess I need to change this but I don't know what to, I have tried "East" and "OPFOR" and neither work.

Any help with this would be great.

Thanks

Ab
« Last Edit: 11 Jan 2010, 19:34:04 by alanb »

Offline diegovet

  • Members
  • *
Re: Enemy AI surrender and capture script (ACCEPTED)
« Reply #7 on: 24 Dec 2010, 07:38:47 »
I click the links ...says page not found, can u pass me the right one?
thanks!!