Lua in Play – Using Lua to Implement Scenario Functionality by ckfinite
Lua provides a vast number of new possibilities for scenario creators, letting you automate tasks. Today we’re going to discuss how you can use Lua in a real scenario, using my upcoming Operation Fei Lian as an example. We’ll discuss how to integrate Lua into your scenario development workflow, and also how to implement solutions to some common problems.
Lua requires some forethought, like any other scenario. You need to figure out what needs to happen in your scene to implement it with Lua. The major component in Fei Lian was the North Korean nuclear retaliation pipeline – integrating a process including missiles, airplanes, trucks, and a palace.
In-game, the process works like this:
T+0: Realization of PRC hostility (attack/entry into NK airspace)
T+20m: Conventional forces launch (KPAF mass scramble), special forces ready (IRBMs to launch locations)
T+30m: Nuclear go: Trucks carrying NK nuclear weapons depart from Kim Jong Un’s palace to the aircraft and (randomized) missile launch site
T+~1h: Nuclear weapons arrive at ballistic missile launch site, and begin integration.
T+1h30m: Nuclear warhead integration complete, missile launch against Beijing
T+1h45m: Nuclear bombs arrive at MiG-23 bases
T+2h: MiG-23 with nuclear gravity bomb ready – air attack on Shenyang
This chain of events would be hard to do in Command in the pre-Lua days – especially the randomized nuclear missile selection process. To implement this sequence of events, you have to keep track of which units are where and when they start out, hard with the traditional mission editor, much easier with Lua.