Page 1 of 1

[Logged] Launching MALD by AI

Posted: Sat May 16, 2020 10:02 am
by KC45
For my missions, I want to shoot MALD from AI side.
to complete this, I have 2 ideas to accomplish this but have no ideas to do.

1. let AI shoot MALD from Airplane by lua (must by BOL by AI.
2. spawn MALD in AI side.

either way is fine.

Thanks.

RE: Launching MALD by AI

Posted: Sat May 16, 2020 11:01 am
by BeirutDude
Seems to me like Lua would be the best way to do it. Can you spawn them and give them a path without a Lua script?

RE: Launching MALD by AI

Posted: Sat May 16, 2020 1:23 pm
by KnightHawk75
Can't spawn weapons via lua unfortunately (that I know of), so option 2 will not work.

Option one works in theory, you can use the following as a guide:

Code: Select all

local myunit = ScenEdit_GetUnit({name='some sample unit with a MALD-J'})
 local retval = ScenEdit_AttackContact(myunit.guid,'BOL', 
 {latitude='N 65.19.14',longitude='E 19.55.43', mode=1, mount=3017,weapon=2442,qty=1}) -- note the special 'BOL' contactname, not sure that's in the docs anywhere.
 print(tostring(retval)) -- true\false  based on success\failure.
Now if you want to set a course of waypoints for the MALD... You in theory can optionally include a course={{subtable}, {of}, {waypoints}, {here}}, in the attack options table, if left out it will just fire it in a relative dogleg + straight line toward the target lat\lon specified. I say "in theory" because in testing BOL with a specific list of waypoints, it has never worked for me, my course gets assigned during the process but overwritten by the time it fires. I don't know if that's a bug, or if I'm doing something wrong.

Example with course that should work but doesn't at least with decoys:

Code: Select all

local retval = ScenEdit_AttackContact(myunit.guid,'BOL', {latitude='N 65.19.14',longitude='E 19.55.43', mode=1,mount=3017,weapon=2442,qty=1, 
 course={{latitude='N 64.48.00',longitude='E 5.57.43'},{latitude='N 64.28.00',longitude='E 14.58.17'}, {latitude='N 65.15.46',longitude='E 17.58.23'}} })
 
You can of course set the waypoints after the fact but you'll have to know the name\guid post fire somehow.

RE: Launching MALD by AI

Posted: Sat May 16, 2020 6:34 pm
by kevinkins
Just thinking before I throw a rack of ribs on the grill ... ideally this might be best handled via a SEAD mission but would take development time to provide designers the options needed. For now, lua code is the way to go. Decoys are emerging ... see my reference in the News sub forum yesterday re: lasers. Very interesting topic overall.

Kevin

RE: Launching MALD by AI

Posted: Sat May 16, 2020 11:05 pm
by michaelm75au
I don't think ScenEdit_AttackContact handles weapons from a loadout on an aircraft.
A course should be passed to the 'salvo'.

I'll have a look at what happens with aircraft and decoys.

RE: Launching MALD by AI

Posted: Sun May 17, 2020 6:13 pm
by kevinkins
Not sure why this is now buried as a tech support issue. Maybe a feature request or moved it into the lua forum. Interesting operational concepts like how to program the AI better are not tech support IMHO. The OP did not claim anything was broken nor could they get the software to run.

Kevin

RE: Launching MALD by AI

Posted: Sun May 17, 2020 11:39 pm
by KC45
Thanks guys!

RE: Launching MALD by AI

Posted: Mon May 18, 2020 3:43 am
by michaelm75au
ORIGINAL: kevinkins

Not sure why this is now buried as a tech support issue. Maybe a feature request or moved it into the lua forum. Interesting operational concepts like how to program the AI better are not tech support IMHO. The OP did not claim anything was broken nor could they get the software to run.

Kevin

I asked it to be put here.
AttackContact() should be able to use load-out to attack things, else it it limited to ships/subs/facilities or direct mounted weapons on aircraft.

RE: Launching MALD by AI

Posted: Mon May 18, 2020 7:29 am
by KnightHawk75
ORIGINAL: michaelm75au

I don't think ScenEdit_AttackContact handles weapons from a loadout on an aircraft.
A course should be passed to the 'salvo'.

I'll have a look at what happens with aircraft and decoys.

Yeah which is why I throw vls mounts on aircraft to work around it (and sometimes other loadout accessibility issues). lol. Thanks for looking into making it work with aircraft\loadouts more naturally though.

As for the course, if it helps, I can see during the call the waypoints get validated and added to the list, and the list appears to get applied to the weapon, what happens after that I can't tell, just that they're gone by the time it launches in the above example. Tried mode=2 as well but it wouldn't fire when trying that as I recall.


RE: Launching MALD by AI

Posted: Mon May 18, 2020 8:17 am
by SeaQueen
Having a BOL launch function in LUA would make my life SO MUCH BETTER.

Not just with MALDs, either. You could do things like pre-emptively fire ARMs so that they arrive as the strikers arrive in the target area.

RE: Launching MALD by AI

Posted: Mon May 18, 2020 9:07 am
by kevinkins
I asked it to be put here.
AttackContact() should be able to use load-out to attack things, else it it limited to ships/subs/facilities or direct mounted weapons on aircraft.

I see. Will play around with the code when available. Thanks.

RE: Launching MALD by AI

Posted: Wed May 20, 2020 7:47 am
by michaelm75au
Setting a course on the BOL attack should work - it sets the plotted course before it fires off the salvo when I traced it. I did notice it ignoring my way-points if they were too far away based on the points it could reach.

RE: Launching MALD by AI

Posted: Tue Jun 09, 2020 12:50 am
by Rory Noonan
Existing ticket updated.

0013938