Forum Jump :

Author Message


Posts: 65
Rank:


Level: Member

Country: uk
Location: Wakfield
Occupation: Armahollic :)
Age:
In-game name:

 
#1 Posted at 2007-09-03 01:40        
     
Hi guy's

Just wondering if anyone can tell me how to make units surrender using a trigger if ther are only say 10 men left, and move to a location on the map. Thing is i have used the dgc_reloaded and i want them to move to a prison camp area.

Is this possible at all if so can you guys give me some pointers or possibly a solution.


Author Message

fence  



Posts: 51
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2007-09-03 07:06        
     
I am surprised I searched "surrender" going back a year and got nothing. I have not gone down this road yet. I have played with setting unit animations. Thats straight forward on the Biki. When you set a unit captive using "setcaptive" enemy units won't shoot at him.

You would need a script to keep track of how many enemy units were alive or dead. You probably new that though.:blush

I found a link here that might be of some help to you. I am sure some others will come along soon that could give you a more defined explanation. Maybe even some code for it. I would have to trial and error for myself. Before I could help much more.

Also Yes it can be done I have seen it done very well.

Ah I found something here also searching "setcaptive"!

Sorry I can't be much more help. Just something I haven't played with yet. I am fairly new to scripting myself.

This post was edited by fence (2007-09-03 07:18, ago)


Advertisement


Author Message

Myke  

Mc Script


Posts: 1034
Rank:


Level: Member

Country: ch
Location: St. Gallen
Occupation: Armaholic addon tester
Age: 47
In-game name: Myke

 
#3 Posted at 2007-09-03 18:20        
     
To detect if there were 10 or less surviving enemies, set up a trigger covering your area, make it "SIDE" present repeatedly, where "SIDE" will be the enemy side. Now down in the Condition line, remove "this" and write in:
count thislist <= 10
and in the on activation what should happen, i.e.:
{removeallweapons _} foreach thislist; {_x setcaptive TRUE} foreach thislist; {_x move getmarkerpos "MARKERNAME"} foreach thislist


Myke out

This post was edited by Big (2007-09-04 08:47, ago)


Author Message


Posts: 65
Rank:


Level: Member

Country: uk
Location: Wakfield
Occupation: Armahollic :)
Age:
In-game name:

 
#4 Posted at 2007-09-04 08:41        
     
Thanks Myke that works a treat, i thought it would be simple


Author Message


Posts: 25
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2008-04-17 14:41        
     
I have a question:
Is it possible to make AIs drop their weapons instead just remove them?
I know there is an action "Dropweapon", but I don't know how to use it here


Author Message

W0lle  

call me evil


Posts: 1944
Rank:


Country: de
Location:
Occupation: CWR² Project Lead
Age: 102
In-game name:

 
#6 Posted at 2008-04-17 15:28        
     
I modified a surrender script from Mr-Murray a while back for a mission I made which makes the unit drop the weapon and then surrenders:

; surrender.sqs
; Original Skript & Idea by Mr-Murray 2006
; modified for Knock Knock by W0lle
; 
; www.mapfact.net
; www.mr-murray.de.vu

?(!(local server)):exit

_Enemy = _this select 0

? not alive _enemy : exit
_enemy action ["DROPWEAPON", _enemy, primaryWeapon _enemy]
~2
_Removeall >= 1 : removeallWeapons _enemy
_enemy playmove "AmovPercMstpSsurWnonDnon"
_enemy setCaptive true
_enemy disableAI "ANIM"
_enemy disableAI "MOVE"

exit

You call it in a trigger etc with

[this] exec "surrender.sqs"


Author Message


Posts: 25
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2008-04-18 07:18        
     
so I create a .sqs file called Surrender
then paste first code part in.

And then I create a trigger in game
activation OPFOR
put something like this in condition

count thislist <= 15

and paste second codes into On act.

did I do right?


Author Message


Posts: 24
Rank:


Level: Member

Country: us
Location: TX
Occupation: Airborne
Age: 29
In-game name:

 
#8 Posted at 2008-04-18 15:24        
     
wolle, I couldnt seem to get that working. I was wondering if you could script the event like this the same way so we could just call the script from a trigger activated by an side?

When only 1 or 2 men remain in a group they have a 50% chance of surrendering immediately and a 30% chance of fleeing. Upon fleeing if one of them gets killed the other will stop and surrender or if one takes damage only the one shot will then stop and remove their weapons, be set to captive and then perform the surrender anim. The 30% that surrender immediately will just be set to captives, remove their weapons and perform the animation. When a player/group leader comes within a few meters of any surrendering personnel the captive will get a marker position called "prison" or basecamp or w/e and move to it and be disabled. I would mention an action to send the POW(s) manually but it might be difficult for friendly AI group leaders to use it. This way they can be told to just move close to the POW(s). The lesser 20% of enemies will just keep fighting untill they are killed or maybe untill they are shot as well, then they surrender too.
I am not a good scripter so I am not sure how this would play out but(in theory) it doesnt sound hard for anyone with skill :)


Author Message


Posts: 29
Rank:


Level: Member

Country: ca
Location:
Occupation:
Age: 38
In-game name:

 
#9 Posted at 2013-09-24 08:56        
     
wow this had been breaking my brain for the past few hours. I did it a different but similar way.

Anyway my set up is this: (FIXED and WORKING)

trigger - (countdown 5, civilian present, on activation: 8 = count thislist
(sync) (sync also with task failed)
game logic - civcount = 8; // 8 civilians in area
(sync)
trigger - ( countdown 5 , civilian present, condition: count thislist <= civcount-1
(sync)
Task Failed
(sync)
Task created
(sync)
Player

So as it shows I want the mission to fail if a civilian is killed.
Here's the catch though. It works like 1 out of ever 10 times. I don't even care to get to get it working. I just want to know why it works only sometimes lol.

I should add that I'm playing ARMA 3 but I couldn't find an ARMA 3 post about this.

EDIT: in the first trigger I replaced "civcount" with the number 8 (my number of civies) and so far it's working. Well, it missed once, but that's 9/10. Any ideas on the inconsistency? 9/10 is not bad, but not what I want.

Editx2: OK to fix the inconsistency issue I synced both triggers back to the "task failed". So far 6/6 times complete.

Editx3: The biggest issue was not in the code, but as I found out, an unmanned blufor ghost hawk somehow blocked the trigger. When I moved the trigger outside the heli LZ it worked. Watch out for that unseen issue.

Fixing original code.

This post was edited by {HoD}Ferocious (2013-09-24 10:17, ago)