The road to v1.10: Special Actions, Lua additions and ScenEdit improvements

January 13, 2016 · Posted in Command 

scriptingThis is the last in our series of posts covering the new functionality offered by the forthcoming CMANO v1.10 update. This time we turn our attention to scenario authoring and Lua scripting.


Special Actions

Special Actions are similar to TOAW’s much beloved “Theater Options”, in the sense that they allow the player to execute a number of pre-defined actions that may bring favorable results (or not – often the best way to model such actions is as high-risk gambles that can spectacularly backfire). Contrary to TOAW, Special Actions can range from the strictly tactical (“Host this SOF squad into the building”) through operational (“request nuclear release”) all the way to grand strategic (“The Assad regime requests assistance from the Russian Federation and makes Latakia airbase and Tartus harbor available to their forces”).

Special Actions are created and edited through ScenEdit (Editor -> Event Engine -> Special Actions) and are made available to the player in normal play mode via Game -> Special Actions (disabled actions are hidden). Such an action may be one-off or repeatable (through Lua it can also be made active for only a finite number of calls, ie. “you may request this 3 times”). From a technical standpoint, Special Actions act as containers for Lua scripts so they can be very powerful. Once an action is executed a message (generated by the script) is shown to the player as to what happened as a result of the action, so scen authors are encouraged to be elaborate in their explanations.

Lua improvements

Lua scripting on Conditions: The immense power and flexibility of Lua scripting is now available not only on event actions but also on conditions. Authors can combine this with the existing event triggers to create very elaborate conditional triggers.

Lua counterparts for existing conditions: The existing “Side Posture” and “Scenario has started” event conditions now have Lua counterparts: ScenEdit_GetSidePosture(SideANameOrID, SideBNameOrID) and ScenEdit_GetScenHasStarted() respectively.

New Lua function: ScenEdit_SetSpecialAction. Usage example: ScenEdit_SetSpecialAction({ActionNameOrID=”MyAction”, IsActive=”True”, IsRepeatable=”False”, NewName=”MySpecialAction”, Description=”This is a very special action”}). This is very handy if the scen author wants to activate/deactivate special actions depending on other events happening.

New Lua method: ScenEdit_GetSideIsHuman(‘SideNameOrID’) . Returns ‘Yes’ if the referenced side is currently under human control, ‘No’ otherwise.

New Lua method: ScenEdit_SetLoadout. Usage example: ScenEdit_SetLoadout({UnitNameOrID=”Viper #1″, LoadoutID=631, TimeToReady_Minutes=45, IgnoreMagazines=”False”})

Length limit of Lua scripts: The limit has been raised to tens of millions of characters.

You can now order a unit to RTB via Lua: Using the existing ScenEdit_SetUnit method, use the “RTB” key (e.g. RTB=’Yes’)

You can now host a unit to a suitable parent unit/group via Lua (e.g. aircraft to airbase, small boat to larger ship etc.). The new method is: ScenEdit_HostUnitToParent(table). Usage example: ScenEdit_HostUnitToParent({HostedUnitNameOrID=’Eagle 1′, SelectedHostNameOrID=’Bitburg AFB’}) . The unit to be hosted is ‘snatched’ either from mid-air or from its current host.

You can now edit a unit’s fuel level through Lua. Usage examples:
{ [3001] = { current = 240000, max = 240000 }, [4001] = { current = 3750, max = 3750 } }
fuel = a.fuel
a.fuel = fuel

ScenEdit and Event Engine improvements

* An extra criterion, “minimum classification level”, has been added to the “Unit Detected” trigger. This allows the scenario author to tailor the desired level of target classification reached (everything from simply “detected” all the way to “precise ID”) before the trigger is actually fired. For backwards compatibility, the default level is “Detected – Known Domain”.

* You can now clone events, triggers, conditions and actions.

The v1.10 update for CMANO will soon be available as a Release Candidate on the MatrixGames forum. Stay tuned!


Leave a Reply

You must be logged in to post a comment.