Using conditions in Command Modern Air Naval Operations can be kind of tricky. Unlike triggers, which are pretty obvious, or actions, which can be dead simple, a condition is more complex. In a nutshell we use Lua to check something and return true or false. If true the action will execute, and if false nothing will happen. So lets walk through one.
Every so often you meet a script that’s beautiful. My first script moment was when I saw the differential equation for a moon shot rocket as it loses fuel, gravity drops, velocity rises, and… well you get the idea. The below script, courtesy of Apache85, is a script like that. This wonderful bit of poetic code generates random merchant traffic within a set area and assigns it to a mission. I’ll get into more of it after the break, but if you want to bring biologics, fishing boats, aircraft, or whatever to your scenarios, check it out!
Weather in CMANO is one of those things you don’t think about until suddenly you can’t attack a target. Then you realize that the world is alive below you. As a scenario designer it’s one of those things that can really fill out your scenario and bring it to life. We’ll explore a few simple methods to give both random weather and one neat trick to make scheduled weather that saves you from making dozens of triggers!
This is another entry in my Lua Repository for CMANO. (Find the first one here) I have a large and ungainly notepad++ document with notes, ideas, scribbles, and even a bit of Lua. To start with we’ll run down what I currently have, later we’ll look at other functions from the commandlua.github.io list and make some other examples. If you’d like to see a particular script feel free to ask in the comments and I can see what I can do!
This is where I’ll be documenting each and every Lua script that I’m using for both my own simulations and for the Hired Goons LP. Most of these are shamelessly used and when applicable I’ll try to attribute the original author. Though in some cases it’s just a script off of Discord or the Matrix Forums. Eventually I’d like to have a functional example for each and every function in CMANO. For starters you can find every CMANO function at https://commandlua.github.io/ . Most everything works as is posted at the Github site, but some things don’t. Hence my idea to have a working script repository.
Also, do things one step at a time. First prove out the easy things, adding a unit, assigning a mission, then progress to harder stuff, looping through assignments, setting positions. That way when you encounter a problem you aren’t trying to digest it all. How do you eat a cake? One bite at a time.