edit: the attached scenario uses an old DB that does not work on current versions. See this post #27 further in this thread to download a file with an updated DB that works in CMO
I've made a tutorial in closed beta showcasing some of the basic new Lua functionality that the next patch will bring to Command. Although the patch is not out yet (and as such you cannot do anything yet with the attached scenarios in your public build), I asked the Devs and they thought it might be nice to already publish it so you guys can get a sneak preview of some of the upcoming functionality and start thinking of ideas on its usage.
The functionality mostly applies to scenario designers as it gives more tools to build an interesting AI opponent. So if you only play scenarios and dont build any you might find it less interesting, but still, you could get an idea of what you can face in future scenarios
Note that there are two bugs in this video that are already fixed, one being that in a certain script the Inherit function only worked if typed in all caps INHERIT. That is since fixed.
The other is that AddSubmarine actually added a surface ship! Also already fixed.
You can find the video tutorial HERE
The scripts used in this tutorial are:
ScenEdit_AddShip('Blue', 'USS Kidd', 960, 'DEG', 'N38.50.15', 'E6.50.00')
Adds a Ship with Database 960 (a version of the Kidd class) to the Blue side as USS Kidd at the included location
ScenEdit_SetEMCON('Side', 'Blue', 'Radar=Active')
Changes the Blue Side's radar setting to Active side wide
ScenEdit_SetEMCON('Unit', 'USS Ticonderoga', 'Radar=Passive;Sonar=Active')
Changes the unit named USS Ticonderoga Emcon to radar Passive, sonar Active
ScenEdit_AssignUnitToMission('USS Kidd', 'Transit')
Assigns the unit named USS Kidd to the mission named Transit
ScenEdit_SetEMCON('Mission', 'Transit', 'Inherit;Radar=Active')
First clears the mission Transit Emcon setting to current side settings to get a fresh start, then modifies radar to Active
ScenEdit_SetSidePosture('Blue', 'Red', 'H')
Sets the Blue side posture towards Red as hostile i.e. Blue now considers Red hostile and will engage Red units. Red still thinks everything is just fine (i.e. sees blue as neutral)
ScenEdit_SetSidePosture('Friends', 'Blue', 'N')
Sets the Friends' posture towards Blue to neutral. So No change to what Blue thinks but Friends now think Blue are just neutral and not friends anymore. Blue loses information that it previously got from Friends.
ScenEdit_SetWeather(10, 5, 0.3, 2)
Changes the weather to average temperature 10 degrees C, rainfall rate 5 (out of 50), clouds 0.3 (out of 1.0) and sea state 2 (out of 9)
ScenEdit_AddFacility('Blue', 'Base', 1592, 69, 'DEG', 'N39.18.25', 'E8.40.45')
Adds a certain single unit airfield with orientation 069 degrees
ScenEdit_AddSubmarine('Blue', 'USS Dallas', 533, 'DEG', 'N38.45.54', 'E6.43.22')
Adds a submarine at location
ScenEdit_AddAircraft('Blue', 'Viper #1', 3833, 19355, 'DEG', 'N38.20.30', 'E5.31.00')
Adds an F-16 at location with specific loadout
ScenEdit_AssignUnitToMission('USS Kidd', 'none')
Unassigns the USS Kidd from any mission
You can also find some info on how the scripts work on Baloogan's site: http://wiki.baloogancampaign.com/index.php/CommandLua
I hope you enjoy this tutorial and find it useful, and appreciate the sneak peek. Meanwhile I am working on a part 2 that will not just show the functions, but show how to implement them in a fully functioning scenario and give you an idea of what you can usefully do with it to make a more interesting AI.
Other than that let it also be noted that more Lua improvements are in the works, either for the next patch or the one that will come after. When they do show up I plan to provide additional tutorials to cover it.
Lastly let me note again for now that the attached scenarios are NOT COMPATIBLE with your current public build. You'll have to wait :)
But once you have it, you'll find there is one base scenario that the tutorial starts with, and one completed one that has everything setup and which you can reference in case something doesn't work, or to hit play and see in three minutes what happens.
The video features time links to the parts that cover specific scripts in the description (hit show more) in case my excessive talking bores you .
Let me know what you think!
< Message edited by Tomcat84 -- 11/23/2019 7:27:51 PM >