Home   Help Search Login Register  

Author Topic: Execution of 10 Civilians  (Read 2682 times)

0 Members and 1 Guest are viewing this topic.

RaiN_MaN

  • Guest
Execution of 10 Civilians
« on: 14 Feb 2004, 01:45:43 »
Hi all :)

Once again i'm in big trouble and i hope omeone can help me find a way out of this damn situation.

I have two EAST Soldiers who should target and execute 10 civilians. Most of this works, just the fact tha the two EAST soldiers stop firing at random, sometimes the kill 3, sometimes 5 and sometimes 9, but till now it didn't happen that they killed all of the civilians. I'm using a simple script, and i tried and tried, so many different ways to get this to work, but nothing worked.

Two examples of what i tried:
Code: [Select]
_Exe = _this select 0
_Target1 = _this select 1
_Target2 = _this select 2
_Target3 = _this select 3
_Target4 = _this select 4
_Target5 = _this select 5

#ReTry
? !(alive _Exe) : exit

_Exe setBehaviour "CARELESS"
_Exe SetUnitPos "UP"

_Exe sideChat "1: " + name _Target1
_Exe doFire _Target1
~1
@!alive _Target1
_Exe sideChat "2: " + name _Target2
_Exe doFire _Target2
~1
@!alive _Target2
_Exe sideChat "3: " + name _Target3
_Exe doFire _Target3
~1
@!alive _Target3
_Exe sideChat "4: " + name _Target4
_Exe doFire _Target4
~1
@!alive _Target4
_Exe sideChat "5: " + name _Target5
_Exe doFire _Target5

? (alive _Target1 || alive _Target2 || alive _Target3 || alive _Target4 || alive _Target5) : GoTo "ReTry"

exit


Code: [Select]
_Exe = _this select 0
_Target1 = _this select 1
_Target2 = _this select 2
_Target3 = _this select 3
_Target4 = _this select 4
_Target5 = _this select 5

? !(alive _Exe) : exit

_Exe SetUnitPos "UP"

_Exe doFire _Target1
~1
_Exe doFire _Target2
~1
_Exe doFire _Target3
~1
_Exe doFire _Target4
~1
_Exe doFire _Target5

exit

At this point i really don't know how to continue, did i make any coding errors in the script? Maybe i'm so dumb that i'm not even able to code such a simple script, or is this just another one of the miracles of OPF AI (lol) ?

Any help will be really appreciated, thx in advance

FLBEE

  • Guest
Re:Execution of 10 Civilians
« Reply #1 on: 14 Feb 2004, 03:10:58 »
hi.  :)

Try the DoTarget command before DoFire.

;;
_Exe doTarget  _target1
~1
_Exe doFire _target1

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #2 on: 14 Feb 2004, 03:16:31 »
Try this modified version of a script I found in the editors depository.  In order for this to work you will have to put the 10 civilains into a group.

Code: [Select]
;made by Baron Hurlothrumbo IIX
;modified by Raptorsaurus so entire group is hunted, not just one unit.
; if you want to have an AI unit/group (tank, infantry, whatever) hunt down
;and kill whoever set off a trigger, then set up the trigger so that the
;unit/group you want hunted will set it off.  Then in the on activation line put
;the line below, using <thislist select 0> for the unit (and all members of group he is attached to) to be hunted down.
;syntax
;[<name of unit to hunt down other unit>, <thislist select 0>] exec "hunterkiller.sqs"
;example
; [hunter, thislist select 0] exec "hunterkiller.sqs"

; In your case your activation situation may be different than in the above header.

_Killer =_this select 0; in your case the leader of the group doing the executing
_KG = group _killer
_hunted = _this select 1; in your case the name of any member of the group of civilians
_huntedgrp = group _hunted
_hunted = leader _huntedgrp

; these three lines are optional and can be changed for different behaviour/speed in the hunting group.

_KG SetCombatmode "RED"
_KG SetBehaviour "COMBAT"
_KG SetSpeedMode "FULL"


#loop
; these next two lines are only needed if the hunters must first track down their "prey".  The logrithmic delay formula is designed so that the closer they get the more quickly they will update their next position movement (simulates the trail getting hotter as they close in.)

_delay = log((_Killer distance _hunted)^2)*10
"_x domove (getpos _hunted)" foreach units _KG

; this line only needed if you want to give the hunted some chance of runing away or hiding.  With out this line the hunters will start shooting as soon as the hunted are in range of their weapons.

?(_Killer knowsAbout _hunted > 2): "_x doFire _hunted" foreach units _KG

; this line is also only needed if some tracking is required before the attack begins.

;_delay = 0

; these next lines exit the script once all members of the hunted group are dead or all members of the hunting group are dead

?("!alive _x" foreach units _huntedgrp): exit
?("!alive _x" foreach units _KG): exit

; the next line ensures that once the leader of the hunted group is killed the hunters (executioners in your case) will then turn their guns on the next in line ( the new leader).

?(!alive _hunted):_hunted = leader _huntedgrp

;these next two lines are also only needed if the hunters must first track the hunted

~ _delay
@ unitReady _Killer

goto "loop"

exit

This scripts works in a mission I am working on and since you have similar need I hope it will work for your situation, though you will need to do some modifying as your senerio is a bit different.

Homefry31464

  • Guest
Re:Execution of 10 Civilians
« Reply #3 on: 14 Feb 2004, 04:09:20 »
Why not group all the civi's to a west soldier as their leader, then just put this in the west soldiers init field:

deletevehicle this

That way the civi's will be set as west, and the east men will kill them all.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #4 on: 14 Feb 2004, 04:52:11 »
Aye.......what Homefry said.

Sweet and simple


Planck
I know a little about a lot, and a lot about a little.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #5 on: 14 Feb 2004, 06:34:45 »
Yes, that would be the simplest way, but in Rain_Mans senerio he may not want them to be executed imediately and if you initiate them with a west leader they may be executed prematurely.

CrashnBurn

  • Guest
Re:Execution of 10 Civilians
« Reply #6 on: 14 Feb 2004, 08:25:49 »
Just give them a negative rating. You don't need the dofire command or even a script. In a trigger with condition of your choice:

onactivation-
dude1 addrating -10000; dude2 addrating -10000; dude3 addrating -10000

They'll be history in short order...

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #7 on: 14 Feb 2004, 11:16:14 »
Hey guys, thanx for all your replies.

I already thought about using the rating stuff or the trick with the join west faction (though i tried with the resistance faction). The problem with the first one is that i need this to be a mission event, a Coop mission which include west AI in the team which should prevente the execution. If i lower the rating and my AI is in range they would shoot  at the civis too :o, probably that would be a bit unrealistic ;D

I also tried the join comand with a resistance member, which is friendly to the west faction. The russian soldiers stood there for 3 mins at 5 meters of the presumed enemy doing nothing lol, so i dropped that idea.

I'll try your script Raptorsaurus and before the doTarget comand, maybe some of these ideas will work.

Thanx again

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #8 on: 14 Feb 2004, 14:52:48 »
Ok, i tested and tested and tested, and now i can say that......something here SUCKS pretty BAD.

Trigger starts when west is deteced by east, since the 10 civis are locked (unabled to move) using the surrend animation i switchMove them into Stand animation, i thought maybe this prevents the AI to recognize them as enemies or something like that. Then i make a nice addRating -10000 on all of the 10 civis, then i execute the damn script, with doTarget and doFire with a loop which repeats the fire order once every 3 seconds.....guess what....IT DOESN'T WORK !!  :o >:(

I tried to repeat the fire order every half second, i tried to put them into careless or safe or combat behaviour (i mean the executioners), i tried Raptorsauruss script....there's no DAMN way to get this to work....unbelivable :help:

Maybe a camcreate shell120 in range of the 10 civis will do the work lol
This is all so frustrating...

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #9 on: 14 Feb 2004, 15:54:22 »
I'm about to give up....
Since i have 10 targets and two executioners i give 5 targets to each soldier (as you can see in the script), since the same script runs two times nearly at the same time i thought it could be a problem for the bad coded OPF engine, so i tried to first start the execution of the first five targets and then start another scipt run and kill the remaining targets. Obviously it didn't work, just like as i tried to use "Destroy" WPs on the single targets to order their "destruction" (lol)...didn't work...i'm really wondering how it can be that all those wonderfull and complex scripts out there work and mine, even such a simple one, doesn't lol.

Right now i'm using this:
Code: [Select]
_Exe = _this select 0
_Target1 = _this select 1
_Target2 = _this select 2
_Target3 = _this select 3
_Target4 = _this select 4
_Target5 = _this select 5

#ReTry

? !(alive _Exe) : exit

_Exe SetUnitPos "UP"
_Exe setBehaviour "COMBAT"
_Exe setCombatMode "RED"

_Exe disableAI "AUTOTARGET"

_Target1 addRating -10000
#Try1
_Exe doFire _Target1
~0.5
? (alive _Target1) : GoTo "Try1"
_Exe sideChat "Target 1 Dead"

_Target2 addRating -10000
#Try2
_Exe doFire _Target2
~0.5
? (alive _Target2) : GoTo "Try2"
_Exe sideChat "Target 2 Dead"

_Target3 addRating -10000
#Try3
_Exe doFire _Target3
~0.5
? (alive _Target3) : GoTo "Try3"
_Exe sideChat "Target 3 Dead"

_Target4 addRating -10000
#Try4
_Exe doFire _Target4
~0.5
? (alive _Target4) : GoTo "Try4"
_Exe sideChat "Target 4 Dead"

_Target5 addRating -10000
#Try5
_Exe doFire _Target5
~0.5
? (alive _Target5) : GoTo "Try5"
_Exe sideChat "Target 5 Dead"

? (alive _Target1 || alive _Target2 || alive _Target3 || alive _Target4 || alive _Target5) : GoTo "ReTry"

exit

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #10 on: 14 Feb 2004, 19:02:05 »
Rain_Man,  I know how it can be sometimes when one try's to do senerios that force the AI to act out of their programed behaviour.  I will try to do a test mission that imitates your senario and see if I can modifiy the Baron Hurlothrumbo IIX script (it is his orginal script, I only modified it).  Anyway, I can work on this latter this evening.  In the mean time can you describe your senerio in a bit more detail so that I can recreate it.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #11 on: 14 Feb 2004, 19:55:12 »
Well...........after grouping my 10 civvies to a west officer, who was then deleted, the 2 east soldiers wiped out all of the civvies.

Seems to work fine here.


Planck
I know a little about a lot, and a lot about a little.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #12 on: 14 Feb 2004, 19:55:39 »
I really appreciate your help and thank you.
First of all, i never said that i use OPF version 1.96 Beta, but i hardly belive that this is the cause of all the trouble.

some details about the mission:

It takes place at Bor a small village W from Lipany (Nogova Island), N of Bor i have 3 BAS Delta Force Operators which have the order to prevent the russians from executing the civilians which are hold in that town. I'm using JAM and BAS addons, most of them are normal soldiers (most of the russian units use HD weapons and mags). A few patrols (2 or 3 men for each) and about a dozen soldiers standing around in the town are most of the enemy forces which try to secure the Bor area. Two Spetznaz guard the 10 civilians which are switchMoved in the "EffectStandSur" (if i remeber correctly), a trigger forces an officer at lipany to use his jeep and move to the two soldiers watching the civis, the trigger's activated by NATO presence. The officer moves to the soldiers and then a little script starts which tries to simulate a discussion between the soldiers and the officer. After 90 secs the officer returns back to lipany and a truck starts which moves to Bor to load and take the civis away, if the truck reaches his destination with the civis as cargo mission ends in failure.
Another event triggered by NATO detected by east will call in a small reinforcment squad inside a hind, the hely lands, the team disembarks and both will then sandy the Bor area.

The script which gives me all the trouble is started by a WP assigned to the two Spetznazs who have their first WP to move near a fireplace, if NATO is detected near the 10 civis their secons WP will be activated (which lead them near the civis) and as soon as they reach their second WP the execution script starts.
If all 10 civis die mission will fail, on the other hand if the three delta force operators are able to clear the area around the civis they will join the delta force. I wasn't able to continue beyond this point cause of the scrpt issues i had, but the final idea was to force the delta to move the civis to a higher spot to the north where a hely evac will be available to carry them out of the island, which then will lead to a successfull completed mission.

I hope this will help you as you wanted, thanx again, i'll keep trying to get this to work and if i find anything i'll post it.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #13 on: 14 Feb 2004, 19:58:52 »
Planck, do you belive removing the officer changes the behaviour of the east soldiers?
I never tried to remove the west soldier after the civis joined him, but i'll at once.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #14 on: 14 Feb 2004, 20:03:28 »
Just put deletevehicle this in his init field.


Planck
I know a little about a lot, and a lot about a little.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #15 on: 14 Feb 2004, 20:09:26 »
There must be something really strange, i tried it and the whole town keeps walking around in safe mode lol. It doesn't work here, i really don't understand why

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #16 on: 14 Feb 2004, 20:17:54 »
Well......I only constructed a very simple mission.

Desert Island
10 Civvies grouped to a west officer.
West officer had deletevehicle this in his init field
2 east soldiers standing next to the civvies
Me as a civvy spectator

I had the east soldiers skill level up full also.

That was it, although everyone lay on the ground, including the east soldiers, they did eventually kill all the civvies.


Planck
« Last Edit: 14 Feb 2004, 20:19:03 by Planck »
I know a little about a lot, and a lot about a little.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #17 on: 14 Feb 2004, 20:23:06 »
Only difference i can see is that the civis in my mission join the west officer (using the join command) and then the officer gets deleted. all done my a trigger.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #18 on: 14 Feb 2004, 20:23:53 »
If you have the civvies set on setcaptive = true, do you setcaptive = false, when the time comes to execute them.

If they are not setcaptive = false, the east soldiers will not shoot them.


Planck
I know a little about a lot, and a lot about a little.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #19 on: 14 Feb 2004, 20:28:22 »
I had them setCaptived, but i removed that part a while back, now they are olny in setUnitPos "UP" to prevent them from dropping to ground. Mmm, maybe civis are setCapitive by default??? I'll try to force them into setCaptive = False.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #20 on: 14 Feb 2004, 20:39:32 »
no way, it just doesn't work....too bad

Dubieman

  • Guest
Re:Execution of 10 Civilians
« Reply #21 on: 15 Feb 2004, 04:01:56 »
Wow I'm not here for a few days and I miss so much... :)

Well I can't script it right now but here is an idea.

You could incorporate this into your script also, but it deals with the west guy and the delete vehicle.
So you put the civvis down and group them via editor to the west guy with a higher rank then them and put delete vehicle this in the west guys init field. Then name all civvis you know bob1 bob2 bob3 and maybe put in Their init fields     setcaptive true.  Then have your script be activated via trigger when west is present or something. Your script could then say like bob1 setcaptive false bob2 setcaptive false and so on. Then I think the east dudes would attack the civvis after the script goes.

Then add like a arguement, that asks if the civvis are dead and if they are use a force end or something...

Hope it helps ;) :thumbsup:

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #22 on: 15 Feb 2004, 10:11:40 »
Rain_Man,

Ok I modified the script to work with your senerio (is it "senerio" or "senario"?).  Anyway, I did a test mission sort of how you discribed, except I made the spetznats guys hold at the first waypoint until I did radio alpha (I did not want ot make a huge mission out of it when it was just to test the script).  At their second waypoint I put the execution line for the script and it worked great.  They will start shooting the civies and they will chase down any that try to run and they will not stop until all are dead or they run out of ammo (even if they run out of ammo they keep chasing survivors - I tested it by removing several of their magazines)!  It worked for me even if I made the civies captive!  I hope this will work for you.  Remember, the civies must be grouped together in one "squad".
Here it is:

Code: [Select]
; In the init feild of trigger or waypoint put:
; [executioner, victim] exec "execution.sqs"
; Where, executioner is any member of the execution sqaud and victim is any
; member of the group to be executed.

_Killer =_this select 0
_hunted = _this select 1

_KG = group _killer
_huntedgrp = group _hunted
_huntedunits = units _huntedgrp
_count = count _huntedunits

_counter = 0

#loop
_hunted = _huntedunits select _counter
?(_Killer distance _hunted > 10): "_x domove (getpos _hunted)" foreach units _kg
"_x doFire _hunted" foreach units _KG

; make sure program halts until "domove" position is reached
@ unitReady leader _KG
; make sure the curent victim is dead before turning on the next victim.
@ !alive _hunted
_counter = _counter + 1
?(_counter < _count) : goto "loop"

exit
« Last Edit: 15 Feb 2004, 10:13:06 by Raptorsaurus »

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #23 on: 15 Feb 2004, 10:48:10 »
lol....here it doesn't work....obvisously, i tried with versione 1.91 and 1.96 (maybe a new bug).
I'm using: [Exec01, Prisoner01] exec "test.sqs" in the WP onActivation field, where Exec01 is the executioner and Prisoner01 is the civis team leader.
As script starts Exec one moves to Prisoner01 and opens fire, kills him and then stops doing nothing.
I belive the game just screwed, all the triggers and stuff made the game react crazy, maybe cause of some sort of bug....who knows.

Thx GuiltyRoachKilla for the idea, i already thought of that, but i need them to be civis (cause i use the side comand to start some triggers) until they get evacuated.

I appreciate all your help, sorry for wasting your time, i really hate the game when it behaves like this...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Execution of 10 Civilians
« Reply #24 on: 15 Feb 2004, 14:37:30 »
Just to clear things up a bit, or make them even muddier........I'm also using patch 1.96.

@ Raptorsaurus..........its 'scenario'

Planck
« Last Edit: 15 Feb 2004, 14:39:01 by Planck »
I know a little about a lot, and a lot about a little.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #25 on: 15 Feb 2004, 19:19:15 »
Rain_man, can I e-mail my test mission to you?  You can then see if there is anything different in the way our scenarios (thanks Planck) are set up.  Are you using a script or init line to group the civies, or are you physically grouping them by making connecting lines in the editior (I used the connecting lines in the editor to group mine)?  I also have this in the init line of the civilian group leader:
Code: [Select]
civgrp = group this.

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #26 on: 15 Feb 2004, 19:26:58 »
Sure, you can mail @ rainman@ngi.it, thanx
I grouped them using the Group button (F2) in the editor and i didn't use the goup comand in the init field. I'll try that but i fear that won't change anything

RaiN_MaN

  • Guest
Re:Execution of 10 Civilians
« Reply #27 on: 17 Feb 2004, 00:01:26 »
Solved.......i simply created a new mission and merged with the old one. In some way the mission.sqm got screwed. Now it works....
Don't ask me why, ask BIS lol...

Thx for your help and time guys

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Execution of 10 Civilians
« Reply #28 on: 17 Feb 2004, 03:08:34 »
Great!!, Glad we could help!!