Page 2 of 2
RE: Lua in Command tutorial 1
Posted: Sat Dec 27, 2014 10:02 pm
by Primarchx
Any options for joining a unit to a group using Lua? How about units switching sides? Thanks!
RE: Lua in Command tutorial 1
Posted: Mon Dec 29, 2014 8:41 am
by Tomcat84
Glad you guys found it useful!
Both good ideas Primarchx! Possibly for the future? [:)] I know unit switching sides has already been requested.
RE: Lua in Command tutorial 1
Posted: Mon Dec 29, 2014 11:56 am
by Primarchx
The idea I had was to use the unit joining a group to do dynamic resupply for ground elements, like air defense. Let's say you have logistics trucks with SAMs driving to your ADA sites each night. When they arrive they join the ADA site group, reload missiles, unjoin the group and return to their origin. I can do this manually now, of course.
Switching sides would be good for capturing ground facilities like airbases, and of course capturing pirate vessels, et al.
RE: Lua in Command tutorial 1
Posted: Tue Dec 30, 2014 8:36 am
by thewood1
Not sure if it does everything for you, but you could switch sides by deleting the unit on one side and then immediately adding a duplicate on the other side. Then you can use other logic to award points for capture.
RE: Lua in Command tutorial 1
Posted: Wed Dec 31, 2014 3:19 am
by Primarchx
With the Lua change posture scripts you can sort of capture an airbase now. The best way I've found is to make 'capturable' airbases a separate side that are allied with the OpFor. When you 'capture' the base, it becomes allied with you. Of course any enemy aircraft stationed there are still there - unflyable as far as I can tell but using ramp and hangar space. You also have to have a way of getting ordnance for your aircraft there, which can be done by teleporting in the appropriate munitions bunkers and (manually) grouping them with the new airbase ... which is another reason to have a Lua script that can create/add to groups!
RE: Lua in Command tutorial 1
Posted: Sat Mar 07, 2015 10:57 pm
by tjhkkr
Thank you very much for this! I have been playing with the editor, but this solidifies a lot.
RE: Lua in Command tutorial 1
Posted: Sat Nov 23, 2019 5:22 pm
by Tomcat84
It was brought to my attention that this tutorial doesn't load in CMO because it uses an older version of the database that is not included anymore. So I have updated to the latest Database.
Find attached a zip file with those updated files. I have not changed the contents of the scenario nor verified the functionality.
Thanks a lot to kylania for informing me!