Command Modern Air Naval Operations : LUA Waypoints

Today’s Lua repository is covering a relatively simple, but infinitely useful waypoint method. You have to manually path your strike missions and this can lead to some comedy when you forget a plane and it flies over some MANPAD’s. Or maybe you want the OPFOR to act sneaky and fly a strike mission between some mountains? So today we’ll cover to how to use Lua to set a course for your aircraft!

The script is fairly simple and works on the ScenEdit_SetUnit package. Once I had my pathing I’d use this paired up with a Time trigger or even a Unit Enters Area trigger. Lately I’ve been using a formup point, sending all my units there on a support mission, and at a certain time sending them all out. But back to the Lua.

1
ScenEdit_SetUnit({side="BLUFOR", unitname="Unit", course={{latitude='41.4581064637219', longitude='23.271687278387', presetAltitude=min, desiredAltitude='200', description='test'},{latitude='42.2706667596912', longitude='23.0730243792651'},{latitude='42.6907498549919', longitude='23.0425951461823'},{latitude='42.7065667663771', longitude='23.4498477038231'}}})

This will take a plane called “unit” on the side BLUFOR and set a course. We’ll pretty it up in a moment. A few important bits. One, the presetAltitude¬†is required and is a string, so min, or low, or max. On top of that set the¬†desiredAltitude. Both of these will save you from wondering why the unit keeps going for 36000 ft.

You’ll also notice this doesn’t use reference points. In this case we need to get the actual latitude and longitude. Luckily there’s an easy way, CTRL-X. Just hover your mouse over the point on the map where you want it to be and hit CTRL-X. Then paste this value and it’ll be right in the format we need!

1
2
3
4
5
6
7
8
9
ScenEdit_SetUnit({side="BLUFOR",
unitname="Unit",
course={
{latitude='41.4581064637219', longitude='23.271687278387', presetAltitude=min, desiredAltitude='200', description='test'},
{latitude='42.2706667596912', longitude='23.0730243792651'},
{latitude='42.6907498549919', longitude='23.0425951461823'},
{latitude='42.7065667663771', longitude='23.4498477038231'}
}
})

We can totally do it as above and make it really easy on the eyes. The same info is here, but it’s much easier to parse. With the new console editor in CMANO it’s very nice to run something like this. Now if I wanted to add another waypoint I’d just add a set of braces (don’t forget a comma after the brace) and past my lat-lon that I got from CTRL-X in the middle. Whammo. Done.

Use the one below, just put in your Lat-Lon into the braces as above.

1
2
3
4
5
6
7
8
9
ScenEdit_SetUnit({side="BLUFOR",
unitname="Unit",
course={
{ ,presetAltitude=min, desiredAltitude='200', description='test'},
{},
{},
{}
}
})

 

Gamer, Author, Engineer, Dad.

Leave a Reply

2 Comments

  1. butch

    Brilliant, I really love the way you simplify stuff for folks who design scenarios, but arent naturally conversant in LUA scripting.

    Please keep going with these.

    Butch

    • Casey

      Absolutely! Normally once I run into an interesting issue I throw it up as a tutorial. I figure if I found it useful, someone else will too.