Latest CMO Lua documentation.

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
tjhkkr
Posts: 2431
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

Latest CMO Lua documentation.

Post by tjhkkr »

Hey there:
Where can I find the latest LUA CMO documentation?
Thank you.
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Latest CMO Lua documentation.

Post by michaelm75au »

Still under http://commandlua.github.io/index.htm

I intend to review and update when I get the chance as some errors have been reported with the commands.
Michael
tiag
Posts: 130
Joined: Thu Jun 21, 2018 8:33 am

RE: Latest CMO Lua documentation.

Post by tiag »

Can you maybe give a look what is going on with the QueryDB function?!

It is not working at all.
User avatar
erwinuri
Posts: 49
Joined: Wed Sep 25, 2019 6:19 am
Contact:

RE: Latest CMO Lua documentation.

Post by erwinuri »

ORIGINAL: michaelm75au

Still under http://commandlua.github.io/index.htm

I intend to review and update when I get the chance as some errors have been reported with the commands.

Page Not Found Error 404...Am I the only one seeing this when pressing the link?
Uri

"The tactics...no, amateurs discuss tactics, Alekseyev thought wryly. Professional soldiers study logistics".
-Tom Clancy, Red Storm Rising-

Twitter: https://twitter.com/erwinuri
User avatar
stilesw
Posts: 1572
Joined: Wed Jun 25, 2014 10:08 pm
Location: Hansville, WA, USA

RE: Latest CMO Lua documentation.

Post by stilesw »

This link works for me:

http://commandlua.github.io/

-WS
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”

Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Latest CMO Lua documentation.

Post by michaelm75au »

ORIGINAL: erwinuri
ORIGINAL: michaelm75au

Still under http://commandlua.github.io/index.htm

I intend to review and update when I get the chance as some errors have been reported with the commands.

Page Not Found Error 404...Am I the only one seeing this when pressing the link?
Looks like I cut-off the URL - missing a 'l' on the file name
http://commandlua.github.io/index.html
Michael
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: Latest CMO Lua documentation.

Post by kevinkins »

I recently read about something over at warfare sims in lua for CMO I would like to experiment with:

"Additionally, this ability can allow simulating “dormant” states for units (e.g. units begin a scenario in a “comatose” state, but later because of XYZ they become activated)."

Is this is the latest documentation? I have looked at all the functions and maybe I missed the key ones. Thanks.

Kevin

“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Latest CMO Lua documentation.

Post by michaelm75au »

I'm not sure what that refers to. A 'unit' is always 'active' or 'destroyed' in the scenario.
Maybe they are referring to something like adding a unit (ScenEdit_addUnit) when certain conditions are met, or putting them on a dummy side before switching to active side (ScenEdit_SetUnitSide)???
Michael
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: Latest CMO Lua documentation.

Post by kevinkins »

If you don't know Michael, we are all at a loss. The full section is below and mentions new "hooks". Maybe this was never implemented. It sounds interesting and worthy of some trials if or when available.

"Lua loco

The Lua API continues its expansion in CMO and offers additional hooks into the simulation engine as well as various methods for pulling the strings of the running scenario. One of the new hooks ties directly into the AI model: You can individually instruct units to, quite literally, not think for themselves (You in the back, quipping “you mean they do this now?” – SIT DOWN!). More specifically, you can set individual units to skip their AI routines for evaluating valid targets and picking out the primary one among them. This has two direct benefits:

It makes it easier to implement custom targeting AI routines in Lua, since an author not longer has to “compete” with the build-in AI for this.
As these routines are among the most CPU-expensive pieces of the simulation pipeline, disabling them can have a drastic effect on the speed & scalability of a large scenario. For example, if you disable the AI cycles of all static/inactive buildings, then only “active” units will use the CPU for this work (internally Command already does a lot of such optimizations, but since it cannot “intrinsically” know which units are static & inactive, it has to check them, which itself is not free). Additionally, this ability can allow simulating “dormant” states for units (e.g. units begin a scenario in a “comatose” state, but later because of XYZ they become activated)."
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Latest CMO Lua documentation.

Post by KnightHawk75 »

@kevinkins

Is this what you're looking for? (post5) I asked awhile back and got the answer.
https://www.matrixgames.com/forums/tm.asp?m=4720573#
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: Latest CMO Lua documentation.

Post by kevinkins »

Thanks alot. That looks like it is what I need to get started.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “Lua Legion”