Home   Help Search Login Register  

Author Topic: If AI officer knowsabout anyone in enemy squad?  (Read 1815 times)

0 Members and 1 Guest are viewing this topic.

whiplash2000a

  • Guest
If AI officer knowsabout anyone in enemy squad?
« on: 27 Aug 2002, 07:32:14 »
Can I make a trigger go off if an AI officer on my side knows about anyone in an enemy squad?

Like if my commander knows about an enemy RPG soldier.

I don't want the trigger to have all of the enemy squadmembers' names in it.

For my purposes, that would make the mission incredibly complicated.

For example: If myDude knowsabout [a percentage of the enemy troops(say ten percent of a ten man squad)] then --> do this.....

SimonRussi

  • Guest
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #1 on: 27 Aug 2002, 09:11:16 »
a simple way is to create a loop in which you check the knowsabout stuff for every enemy unit and you count how many your officer knows about.
if the value is above your ten percent you execute your commands...

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #2 on: 27 Aug 2002, 09:31:13 »
You could use the count command...

Condition Field: "officer knowsabout _x > 0" count [unit1,unit2...] > 0

Would set off the trigger if the officer knows about any of the units in the bold array.
Also, you can change the underlined number to adjust the sensitivity (ie. the officer needs to know about more than 3 units in the array before the trigger will go off)

whiplash2000a

  • Guest
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #3 on: 27 Aug 2002, 09:41:16 »
thank you very much guys. I needed to know this so that in my nam mission a bunch of artillary fire didn't come hailing out of the sky without having good reason.

Now one more question. Would there be a way to get the position of the group of enemy soldiers (not just one, because one soldier might have died a mile away), so the artillary can fall on them.

Possibly the most known about enemy guy? I'm not sure how to go about doing this.

SimonRussi

  • Guest
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #4 on: 27 Aug 2002, 09:57:06 »
well, you have the getPos command but it only works on units, not groups. You can get the position of the leader and bomb around him, this is not unrealistic, artillery really often works like this (i mean, bombing a "zone" instead of a specific target).
 position = getpos groupleader

DeusRich

  • Guest
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #5 on: 27 Aug 2002, 15:26:00 »
you will need a barrage script, and then you can select a basic position - the better barrage scripts will automatically disperse the bombardment so it will be more effective and compensates for 'the lone soldier' thing

you will have to wait till the snippets are opened again to get your hands on one, unless you know how to make one yourself.....

whiplash2000a

  • Guest
Re:If AI officer knowsabout anyone in enemy squad?
« Reply #6 on: 27 Aug 2002, 19:49:49 »
I made my own barrage script that works nicely and it has mortars inbound sound effects and radio sounds to.  ;D