Home   Help Search Login Register  

Author Topic: Ideas & Questions about stealth scripting and AI reacting  (Read 3006 times)

0 Members and 1 Guest are viewing this topic.

Offline Barbolani

  • Members
  • *
Hi all!!!

For my mission "Midnight Attack" (betatesting now, try it!) Im asking myself some complex questions. And I ask you, scripting and mission editing gurus, if theres a way to solve it.

Generally speaking, the procedures for alarm ringing is just a trigger with a "detected by enemy" that fires the alarm (so you change the behaviour etcetera of the units)

AFAIK a unit detects enemies automatically (so the trigger fires) if its been hit by any weapon....

And AFAIK units dont react as "the enemy is around here" finding a cadaver. In fact, I dont know how to make a script that makes something when a unit sees another checks if is dead...

All this is unrealistic.

The questions:

 - Is there anyway to detect that a dead unit is killed by a silent weapon, so the alarm doesent sound If one single non-seen unit is dead by a SD gun????

- Anyway to detect if he`s been killed by one single shot in the head or in a short period of time since the first bullet hitted him?? Of course we suppose every unit in a modern army has a radio, and can call reinforcements very quickly if its under attack, but one single shot in the head could do the trick...

- ...and what about detecting if theres more enemy units close to the hitted one, so we know who knows or doesent know if we are under attack?????

- ....and how about making a unit react if it finds a cadaver not supposed to be dead??? (ok, nobody reacts if they are in the morgue, but, imagine the typical situation of, "I return from the bathroom and I find my card playing partner dead"

The objective, make stealth missions more realistc, kinda "Commandos", give the SD weapons another utility (and the most important one I think) and give the "Hide Corpse" action more sense...

I think is very complex, but the idea could be to create some kind of "engine" or set of scripts to give those functionallities to any stealth mission, without addons, of course.

Ideas? Suggestions? Solutions?  :D


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #1 on: 17 Jul 2008, 20:03:50 »
You may need to attach a hit and a Killed event handlers to a unit. When the unit is hit or killed you get the killer, then you check the weapons the killer has, if SD, then you might conclude the dead or wounded unit was killed or wounded by a SD bullet.

Then you may attach also a damaged EH, with damaged EH you get the selection damaged (the head, the body, an arm, a leg, etc). But with damaged you cannot get the cause of the damage (the firer), so at the end you might need to add all these event handlers to each unit.

Offline Barbolani

  • Members
  • *
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #2 on: 17 Jul 2008, 20:35:24 »
Thanks Mandoble,

K so:

1. First check EH damaged: If its head, then check the killers weapon in the EH procedure you said, if its SD the alarm doesent sound, if not... goto 3.

2. Second check EH damaged: If its not head, wait for example 3 seconds, If its dead before, goto 1 (check if its donde with SD) If after that unit is still alive.. goto 3

3. Alarm

This would solve the SD issues.

Now, ¿how do I check if a shot is made with no killing but without a SD weapon? and ¿what about AI behaviour like "I see somebody is shooting my friend" and "this guy should be alive and is dead"? They should be reactive to those events...

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #3 on: 17 Jul 2008, 20:45:29 »
No, you need to check the three EHs, mainly HIT and KILLED. This way you get the firer and then you may check its weapons and ammo. This way you may conclude wether a unit was hit or damaged by an SD weapon or not. Problem comes if the firing unit has an SD weapon and a non sd weapon. You may use my function weaponinhand to find out which weapon has the firing unit in hand.
DAMAGED EH will tell you only where the unit was damaged, but not by who.

Offline Barbolani

  • Members
  • *
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #4 on: 17 Jul 2008, 21:08:43 »
Ooookay, so, with EH

1. HIT check, if HIT, check weaponinhand (i cannot see that command in the COMREF) If SD, goto 2, not SD, goto 5
2. Check DAMMAGED: Head? endscript (I dont care if its alive... with a shot in your head is impossible to use the radio), not Head? goto 3
3. Goto 1 until 3 seconds pass, then goto 4
4. Alive? goto 5. Not Alive? endscript
5. Alarm

Something like that?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #5 on: 17 Jul 2008, 21:10:22 »
Apply the same as HIT to KILLED. Might be if you get the killed EH you will not get also the HIT EH.

Offline Barbolani

  • Members
  • *
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #6 on: 18 Jul 2008, 09:44:07 »
Thank you very much Mandoble.

It seems theres a lot of work, I'll start the project ASAP.

Do you have any clues about the other matters?? I mean:

- How do we know that the AI discovers a corpse?
- How do we know that the AI sees other AI unit under fire or being killed? (without being in the same group)
- How do we know if anybody made a shot without injuring / killing, but without an SD weapon? I suppose with EH "Fired", but please confirm...

Thnx in advance...

Offline Cheetah

  • Former Staff
  • ****
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #7 on: 18 Jul 2008, 10:50:06 »
As for scripts that detect loud weapons (non SD) and grenade explosions, you might want to check and dePBO ColonelSandersLite & SpecialEd's mission that is in beta testing: Operation Shining Anvil. The mission has two scripts, one checks for non SD shots, the other for grenade explosions. They might be useful.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #8 on: 18 Jul 2008, 12:15:29 »
Hi Barbolani,

I have asked myself the same questions that you brought up and this is my info.

I have no experience in how to make the AI react to a dead body, but I think it is only possible with nearestObject and knowsAbout commands.

My solution for "more realistic" stealth missions has always been a "fired" eventhandler for the guards (that starts an alarm) and a detected trigger.

If the guards fire their weapons (only happens after detecting an enemy) the alarm goes off. This is realistic and also enables you to take out guards silently without detection.
The detected trigger runs parallel and is activated after a long time of detection, this makes sure that the alarm eventually goes off even if the guards have only seen something "suspicious".

You can also have a script that checks the number of units in a group. Let's say a guard group concists of 3 units. If one is killed the script runs and if the remaining two are not killed in a short amount of time the alarm goes off. This would simulate that they reacted to the death of their groupmember. If you managed to kill the whole group quickly though, they didn't have time to react.

Another solution could be a trigger that checks the behaviour of the guards. If they are patrolling on SAFE mode, they will automatically switch to AWARE if something happens. This might be as problematic as a DETECTED trigger though, meaning that even if the guard is already DEAD his behaviour will still change according to the game engine and activate the trigger.

Laggy

« Last Edit: 18 Jul 2008, 12:17:10 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Barbolani

  • Members
  • *
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #9 on: 18 Jul 2008, 13:18:41 »
Thnx ppl!!!!

One question: Do the AI change to AWARE if they see a dead friendly????

(Im not able to test with arma today)

Thnx

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #10 on: 18 Jul 2008, 13:39:22 »
Nope.

They do look at the dead guy when they pass him but no other reaction what so ever.  :P
One factor probably is that all dead bodies switch to civilian side..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Barbolani

  • Members
  • *
Re: Ideas & Questions about stealth scripting and AI reacting
« Reply #11 on: 21 Jul 2008, 00:39:06 »
Hi ppl!!!

Well, it seemed that laggy's way is the easiest, and now I have a script that does everything except the dead bodies issue....

@Cheetah: I tried those scripts, but are hard for me to understand.... I couldnt even find a clue (maybe with less hangover...)

I suppose the trick is, make an array from time to time that storages all the units that each unit knowsabout > than x... and check if one of those is dead...

I need your help, can you give me a tip? (remember Im not a good scriptor, just an OFP fan)

Thank you very much.

Ahm, Ive got this (copy / pasting frome there and here its one of my best scripting habilities...)

Code: [Select]
_grupo = _this select 0


? ((side (leader _grupo)) == (side player)) : goto "AMIGO" else goto "ENEMIGO"


#AMIGO

{_x addEventHandler ["fired",{if (!(_this select 2 in["M4A1SD","MP5SD","M9SD","AKS74UN","MakarovSD","PipeBombMuzzle"]) && !descubierto) then {descubierto=true}}]} forEach units _grupo

goto "END"

#ENEMIGO

_maxunits = count units _grupo

{_x addEventHandler ["fired",{if (!descubierto) then {descubierto=true}}]} forEach units _grupo

? (_maxunits == 1) : goto "END"

#GRUPOGRANDE

~3

? (_maxunits > count units _grupo) : goto "GRUPOATACADO"

goto "GRUPOGRANDE"

#GRUPOATACADO

~10

? east countSide (units _grupo) > 0 : descubierto = true

#END

exit


When I got this finished ill try to publish a suite "easy to use" in any mission so we forget about those sad "Detected by..." triggers

EDIT: Things to do:

- The body detection.
- Find a way to reveal to the nearest enemy the unit that fired a non SD weapon

Cya
« Last Edit: 21 Jul 2008, 01:46:12 by Barbolani »