[Q] LUA snippets

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
AlexGGGG
Posts: 685
Joined: Thu Sep 25, 2014 5:23 pm

[Q] LUA snippets

Post by AlexGGGG »

Any chance we can have a collection of LUA snippets, or maybe there is one already, but I can't seem to be able to find it?

I have just started looking around creating scripts, and wanted something I thought to be simple, as in "assign all aircraft on mission X to mission Y", and I can't even figure out how to start.

Normally I thought I would somehow enumerate all aircraft currently assigned to mission, and for each of those reassign it, but how?
Tomcat84
Posts: 1952
Joined: Wed Jul 10, 2013 5:13 pm

RE: LUA snippets

Post by Tomcat84 »

Baloogan's Lua wiki has a lot of explanations and also links to my Lua video tutorials, Ckfinite's tutorials and also to this page:

http://commandlua.github.io/

It has a lot of useful stuff.

I dont think there currently is a way to say "All units assigned to mission X", but thats not a bad idea. I'll pass it on to Baloogan (one of the devs heavily involved with the Lua part)

btw Lua is not an acronym for anything so it doesnt have to be all caps :)
My Scenarios and Tutorials for Command

(Scenarios focus on air-warfare :) )
AlexGGGG
Posts: 685
Joined: Thu Sep 25, 2014 5:23 pm

RE: LUA snippets

Post by AlexGGGG »

Ah and I guess no wildcards as well, like, have multiple aircraft go by same callsign and then operate on groups of aircraft?

So if want to assign two units to mission, that's strictly two calls to AssignUnitToMission(), correct?
Like no way to do

ScenEdit_AssignUnitToMission('SEAD*', 'Mission1')

to select all aircraft with callsigns starting with SEAD?
ckfinite
Posts: 208
Joined: Fri Jul 19, 2013 10:33 pm

RE: LUA snippets

Post by ckfinite »

Not yet, I hope to have library support for that in the near future, however.
Post Reply

Return to “Tech Support”