Posted on March 9, 2019
Some examples of how to loop thru units using Lua in order to change things like the mission they are assigned to, or the units loadout.
59 minutes of Lua code... so it went a little long.
Just some basics of setting up missions at the beginning of a scenario. Should have made another helicopter ASW mission around the Amphibious group. Scenario is Red vs Blue: Battle for Hispaniola.
I wanted to make the ships leaving port take slightly different paths so we edit the waypoints using lua.
Fairly simple lua exaple of changing the course of a unit, adding events, triggers and actions.
Using Lua inside the game Command (CMANO) and how to use a function to return a value.
Some basics of using tables in Lua.
Using Lua inside the game Command (CMANO) to randomly move a ship/sub. Goes over creating the code and then how to wrap it into a Function for easier re-use.
Using Lua inside the game Command (CMANO) to dig thru a unit wrapper.