OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: CaptainBravo on 21 Aug 2009, 13:08:43

Title: Enemy AI using artillery
Post by: CaptainBravo on 21 Aug 2009, 13:08:43
hey everyone,

I have searched for Enemy AI using artillery script and could not find any (except a few for OFP and arma)

I was wondering if there are any for Arma2? I am looking for one where AI can automatically detect my troops and fire on them.

Thanks in advance for your help.
Title: Re: Enemy AI using artillery
Post by: mikey on 21 Aug 2009, 15:57:06
I'm actually planning on making such a script for a mission this weekend.

Basically I'll keep looping a findNearestEnemy every 10 seconds, and when the enemy FO discovers an enemy, it will create a fire mission template based on the enemy position. Depending on daylight the script should chose for ILLUM or HE.

I have no idea if this is gonna work well, since scripts relying on BIS AI usually end up kinda dodgy, but I'll let you know if I have some success.
Title: Re: Enemy AI using artillery
Post by: CaptainBravo on 21 Aug 2009, 16:15:36
Thanks Mikey for your response.

I know Grouplink scrip (old ofp) had enemy AI ID and fire artillery.. not sure if that would help.

Good luck with the script, A2 needs such a script!
Title: Re: Enemy AI using artillery
Post by: granQ on 21 Aug 2009, 21:52:50
Depending on daylight the script should chose for ILLUM or HE.

awesome idea.. consider it stolen :p
Title: Re: Enemy AI using artillery
Post by: mikey on 22 Aug 2009, 12:48:37
small update

I hacked something together last night which seemed to work, but unfortunately the AI FO kept having a knowsAbout level about his target and also findNearestEnemy kept returning the target, even when I moved the target  into cover 2 km away in dead ground after being spotted. So it seems that in arma 2 the knowsAbout level doesn't decrease if the AI doesn't have his target in LOS anymore.

But, I just found the command nearTargets (http://community.bistudio.com/wiki/nearTargets), and it seems to do what I want. If the enemy is out of LOS, the "assumed accuracy of the perceived position"  seems to increase a lot (lower is better), which is perfect for detecting if the targets moved away in cover.
Title: Re: Enemy AI using artillery
Post by: Inkompetent on 22 Aug 2009, 13:00:05
knowsAbout does decrease, but not instantly. It detoriates over time, so you'll have to manually set the knowsAbout value by script if you want the AI to become unaware of something.
Title: Re: Enemy AI using artillery
Post by: mikey on 22 Aug 2009, 15:18:18
Well, I did wait 5 minutes after I put the target 2km away behind a forest, and the value was still the same, and findNearestTarget was still set on that dude while my own squad was much closer.

And how do I set the knowsAbout level, because I haven't seen how to do that yet.
Title: Re: Enemy AI using artillery
Post by: Inkompetent on 22 Aug 2009, 16:50:21
Good question. I'm fairly sure I've seen it done somehow with a controlled reduction of the value but I can't recall what was done. Or I'm just generally confused. Might very well have been changing sides for units to change target priorities when I think about it...
Title: Re: Enemy AI using artillery
Post by: CaptainBravo on 25 Aug 2009, 17:53:47
Hey Mikey,

Any luck so far with the AI artillery?  :scratch:
Title: Re: Enemy AI using artillery
Post by: mikey on 25 Aug 2009, 20:10:04
Not really. I was asked later in the weekend to make this (http://i242.photobucket.com/albums/ff261/mikeymike888/showCrew4.jpg) (a spon crewNotify and status clone), but that's done now. So I'm planning to start working on the enemy FO script again soon.
Title: Re: Enemy AI using artillery
Post by: CaptainBravo on 25 Aug 2009, 22:05:01
is that spon part of the Hypred HC? It looks pretty good. I'd like to test it if that is ok.

I am also looking forward to your artillery script.

Title: Re: Enemy AI using artillery
Post by: CaptainBravo on 01 Sep 2009, 10:15:28
Any updates on AI artillery ?
Title: Re: Enemy AI using artillery
Post by: mikey on 05 Sep 2009, 01:27:47
not really. the spotting and aiding the ai in spotting enemies worked ok, but I still need to make something for decision making. I guess im gonna try out the fsm editor for that, to see if it can make that easier for me.