OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: whiplash2000a on 27 Aug 2002, 07:32:14

Title: If AI officer knowsabout anyone in enemy squad?
Post by: whiplash2000a 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.....
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: SimonRussi 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...
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: Sui 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)
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: whiplash2000a 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.
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: SimonRussi 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
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: DeusRich 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.....
Title: Re:If AI officer knowsabout anyone in enemy squad?
Post by: whiplash2000a 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