LUA Weapon Specific Scripting: Courses and Target Selection (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


Engine05 -> LUA Weapon Specific Scripting: Courses and Target Selection (7/6/2021 12:38:18 PM)

Hello!

I'm trying to generate a repeatable ToT LUA script that creates weapons and gives them routes to a target. Essentially, I want to manifest cruise missiles mid flight and give them a target and route to follow. This will save me time when I just want similar strikes on different targets around my scenario instead of making routes and planning ToTs. So far I have managed to generate the weapons and get them on the map relative to a target bearing and give them a course to said target. I am having two issues:

1. After creation, I feed the flying weapons my course, which they follow directionally, but they will not change altitude.
2. I have not found a way to assign these created weapons a target. ie id like to change: "Status Target(none)" to "Status Target(badguy)" somehow.

psudo code:
What I have-
for user defined amount of weapons: create unit of type weapon, select it and give it a course to the target

What I'm going for -
for user defined amount of weapons: create unit of type weapon, select it and give it a target, select it and give a course to the target w/ final alt =0.

The struggle here is that I'm playing on weapons exclusively, without using launch platforms. Is assigning targets or changing altitudes even possible for Units of Type "Weapon".

Thanks!




KnightHawk75 -> RE: LUA Weapon Specific Scripting: Courses and Target Selection (7/6/2021 9:36:31 PM)

TLDR - you can't do what you want precisely the way you want yet.

"Is assigning targets or changing altitudes even possible for Units of Type "Weapon".
---
On the later no, you can't yet via lua, and SE AttackContact isn't designed for post launch operations on weapon. Wish it was. Best you can do via add-unit is drive it to an area and let it find a target to attack IF it has a active seeker,etc.

"The struggle here is that I'm playing on weapons exclusively, without using launch platforms"
--
Yup that is your problem. Not to discourage you but you may be wasting your time with that approach (as of 1147.xx anyway).


When I've done something similar I had to use the other approach, ScenEdit_AttackContact on a properly generated launch platform where said weapon(s) existed (or have been added), and the launch parameters are met (including a valid contact or marker for a lat\lon bombing if contact detection is an issue). In cases of PGM's or drone like munitions(think mald-j etc) one may set the pathing\waypoints (with caveats) pre-launch, and make mods (carefully) post launch if needed. I should warn doing anything post launch to a given munition in that situation can be tricky as it introduces additional complexities and overhead associated with finding said munition to operate on for a 'get').

As for altitude on most PGM's generally speaking no.
They don't follow any DesiredAltitude waypoint entries like aircraft do atm, they follow the altitude associated with their db entry for cruise-alt when moving from waypoint to waypoint, and then whatever their terminal logic dictates once they have a target and enter that phase. I don't think you can make say an AGM-158c for example fly 200miles at 1000ft and then drop down to 60 for the last 50nm leg (unless its all over sea and it doesn't have a target yet see below). Also in cases of like a mald-j, who's altitude usually will slowly decay from a starting point you gotta get the launching platform down or up to whatever starting altitude point you want it at. That's the case when doing AttackContact Launches.

When doing 'spawed' pgm's there is an exception when they don't have a target yet they'll just act like glider\drones initially unless you manually (Lua) adjust their altitude yourself at each waypoint\course progress via your own injection which will work so long as the missile doesn't react to something. That reaction is engaging the seeker and grabbing a target, that will make it engage it's cruise profile. It'll also engage the cruise profile if it's terrain-avoidance has to kick in along the path such that it has to adjust itself upward from whatever you have set for altitude (ie only useful really if entire path is at sea or pretty high relative to terrain). So while you can kind of set it till something triggers it to start acting normally it's not something I would rely on. In fact it's probably a minor bug\nuance\overlooked thing of weapon creation without target that it happens to exists at all.

How were you planning to let the user 'give it a course' to the destination target anyway? Other than input box, or renamed rp's to grab locations from, there isn't a way to grab that sort of input from a user that I can think of, and even many munitions that have f1 re-targeting require a comm link to a parent to initially exist at time of fire to enable re-targeting that will not exist when using add-unit method.




Engine05 -> RE: LUA Weapon Specific Scripting: Courses and Target Selection (7/7/2021 4:38:36 PM)

Thanks for the feedback. All this info is really helpful and confirms some of my suspicions. I'm probably going to follow your suggestions regarding platform launches. My only struggle now is route planning. You had mentioned that I could leverage attackcontact(), I've been playing with that but I still need to manually plot courses, is there any suggestions on plotting engagements in lua?

On mobile so sorry for format




KnightHawk75 -> RE: LUA Weapon Specific Scripting: Courses and Target Selection (7/9/2021 2:31:37 AM)

quote:

ORIGINAL: Engine05

Thanks for the feedback. All this info is really helpful and confirms some of my suspicions. I'm probably going to follow your suggestions regarding platform launches. My only struggle now is route planning. You had mentioned that I could leverage attackcontact(), I've been playing with that but I still need to manually plot courses, is there any suggestions on plotting engagements in lua?

On mobile so sorry for format


Assuming you are generating on the fly or via static table the course table you want you can inject it at time of launch per each call to AttackContact.
See post #3 in this old thread for a quick sample of using AttackContact (the sample related to BOL launch but can apply course wise with other types where the weapon allows it) with assigning course table to launch.
http://www.matrixgames.com/forums/fb.asp?m=4814480







Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.515625E-02