Home   Help Search Login Register  

Author Topic: Execution of 10 Civilians  (Read 2687 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.