Home   Help Search Login Register  

Author Topic: Knowsabout help  (Read 508 times)

0 Members and 1 Guest are viewing this topic.

Nivraga

  • Guest
Knowsabout help
« on: 26 Jul 2004, 05:24:05 »
I'm wondering if I'm the only one tired of seeing AI walk right past dead friendlies without even so much as taking their weapon off their shoulder.

after some tinkering I was finally able to put together a script that will activate a trigger if a unit that other units KnowsAbout is killed - my problem =


... EAST Unit - E1
... EAST Group - E2 (Number of units in group irrelevent)

E1 is guarding Ammo Depot
E2 is patroling around Ammo Depot

Player kills E1 with silenced weapon

If E2 "KnowsAbout" E1 at the time E1 is killed then trigger is activated as it should.

If E2 does not "KnowsAbout" E1 or if the "KnowsAbout" is below the set threshold at the time E1 is killed then the trigger is never activated even after E2 practically walks over E1's body - which is the issue I set out to resolve to begin with. Apparently when a unit dies it's id dies with it making it impossible for other units to "knowsAbout" it

Does anyone know how to write a script that will cause AI to react to dead bodies. I'm not talking about countside because this makes them react as soon as a unit dies whether they were anywhere near the unit or not.

Is there a way to name/rename units after they die?


Nivraga

  • Guest
Re:Knowsabout help
« Reply #1 on: 26 Jul 2004, 21:35:31 »
I had a thought ... though my scripting probably too weak to figure it out ... which is why I'm posting here.

I'm beginning to think that KnowsAbout is the wrong approach since it appears KnowsAbout won't return a value for dead units.

How about a script that checks if any units are dead and if so gets the position of those dead units and then continuously checks to see if any other (friendly) units are within a certain proximity to that unit (ie close enough that they would in reality notice their dead comrad). This check would of course need some cancelation once a unit entered the threshold proximity.

This approach would still have some flaws (such as units killed inside a building "noticed" by units outside the building).

Please help

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re:Knowsabout help
« Reply #2 on: 26 Jul 2004, 23:15:45 »
Hi,

I understand your frustration. It took me a while to have this thing works. I did it using a mix of different things like the knowsAbout command, killed eventHandler and invisible targets. The trick is to place an enemy invisible target near the body as soon as he died and check the rest of his side for the knowsAbout level of the invisisble target. As soon someone detects the target, you have to remove it so they dont start shooting the body, change their behaviour and optionaly raise the alarm.
I had to put the target about 2 meters (-2) under the ground or it would be detected from to far away.
I use 5 scripts in a test mission that I've started (but never finished) to manage the body detection. If you are interested I'll mail them to you so you can have a look and use it for your own purpose.

Cheers

Nivraga

  • Guest
Re:Knowsabout help
« Reply #3 on: 27 Jul 2004, 20:20:39 »
Yes I'd love it

agarvin@comcast.net

Something else that recently occured to me. Why do Black ops have "hide body" as an action if the AI doesn't react to dead units that it didn't previously know about?

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Knowsabout help
« Reply #4 on: 28 Jul 2004, 04:24:07 »
Hi Nivraga
Re the Hide Body routine - I sometimes hide bodies just so they won't be around for looting any more.  But your're right - against AI there seems little reason to do this . . .  :'(

I too once wrote a script a bit like the one you mentioned.  What you need to do is create a trigger with Anybody Present in the activation.  You then make a "list" from that trigger and write your script so that each enemy unit will check each unit (friend or enemy) in the list.

If the target unit is both dead and very close then the unit's group becomes active.  You change the group's waypoint into a "Search Destroy" (from say, a Sentry) and make everyone Combat or Stealth mode.  That should do it.

Oh yeah, you may also want to put a little lag between the discovery and activation steps so that your friendly Black Op can kill him before he squeels.  Something like -


<Body Detected, record _discoveryLoon>
playsound "Oh my God, what's this ?" ; or something similar  :D
~10

If (_bodyDetected) and (alive_discoveryLoon) then <do all that activation stuff>

exit


You won't need the script any more now that the group is activated so that's why you can exit it.  If you want to have multiple groups becoming active then you might want to have a public variable that lets the other groups (running their own version of the script) know that something's been discovered.

Again, you could put in a lag so that if you can wipe out the entire group in say, 30 seconds then the other groups aren't told.  In this case you would check for alive _loonLeader instead of alive _discoveryDude.

Hope that this helps.



Roni