Page 1 of 1

Lua scripting possibility?

Posted: Fri Jun 26, 2020 6:57 pm
by 1nutworld
I'm wondering if LUA could be used to control a submarine that has possibly (probably??) been detected by say an active sonobouy that the sub commander would have an idea how close to detection would be possible, to alter it's course and or speed, if the submarine is on a plotted course and is controlled by computer side. I understand detection by a passive sonobouy would be a different thing all together as it emits no sound and the only real way for it to be detected would be visual or audible observation of it being dropped in place.

If so, what would that scripting look like?

Thanks in advance.

Scott

RE: Lua scripting possibility?

Posted: Sat Jun 27, 2020 9:25 am
by KnightHawk75
I'm wondering if LUA could be used to control a submarine that has possibly (probably??) been detected by say an active sonobouy
Yes it can be done. You'll want to familiarize yourself with the unit wrapper and it's .ascontact table and the contact wrapper and it's .detectionBy table and sub tables, as well as .classification and perhaps other related properties\fields.
that the sub commander would have an idea how close to detection would be possible
I do not follow exactly.
would be possible, to alter it's course and or speed
or depth, yes it can be done. unitwrapper.course and SetUnit() will come into play.
I understand detection by a passive sonobuoy would be a different thing all together as it emits no sound and the only real way for it to be detected would be visual or audible observation of it being dropped in place.
sure, though if you so desired the infrastructure in the contact wrapper provides that information. So if you wanted to sort of cheat and include passive you could, you could also include ESM, visual, infrared, I forget the whole list but ContactWrapper.detectionBy table has a sub-table for each generic type of detecting sensor. You may run into an issue though that generic sonobuoys are classified the same as type as hull active sonars I believe. But if you have a list of dbid's of the specific weapon buoy's in the scene you want to filter for you can further compare all "SonarActive" table entries against that list or by role perhaps.

But to better understand before I would roughly sketch this out I have to know more or clarify desires.

So if I understand the desire correctly:
You have a AI sub on an existing plotted course toward some end state position, we'll call this the target position\destination.
You want said sub to know when it's been detected, but only by active sonar, and then still only by an active sonobouy specifically.
Upon being detected by only one or more of these devices you want to take an action, such as changing course,speed,depth or all three.

Does it matter to you if the sub's side has not detected the active buoy that has detected the sub in question?
How though do you want to handle taking those actions though? By that I mean do you want to do different things based on the current classification level the sub has been detected at during a given checking cycle, or does it not matter to you the level it's detected at?
After an action has been taken, at a point in the future do you want it un-done? By example if your sub no longer is a contact, or no longer a contact from specifically an active sonobuoy do you want to resume heading to the original destination?
Will there be allies involved on the detecting side? (minor, but it can matters as I once figured out lol)

On the course change, well that can be relatively simple or very complex, what is it you want to do. Examples:
Do you just want to turn tail and head XX degrees away from the closest buoy detecting the sub for xx miles till not detected anymore?
Do you want to attempt to navigate around the closest active buoy who's detecting you but still toward your target destination?
Do you want to invoke a course that like say zig zags with x amount of legs of x distance each toward the target with each leg being a random offset from the last but still headed in the general direction of the target destination all while making sure to stay in relatively deep water and navigating around land. The difference between the first for example and the second and last is not trivial.