Basic Editor Usage

From Weapons Release Wiki
Jump to: navigation, search

At the most basic level you can execute Lua scripts using the Lua Script Console. Note it is only available in Editor Mode.

Command 2020-03-17 21-00-08.png

It is good practice to test your code in the Lua Script Console with print statements throughout to error check your code. Beyond that it can be used to build scenarios quickly by iterating through placement of ships, aircraft, or reference points.

Command 2020-03-17 21-03-57.png

The upper part is the console response area. Any errors or data will be displayed here. Below it is a syntax highlighting section that color codes your Lua for ease of inspection. If a function executes here it will execute in an Action or Special Action.

It is possible to execute a trigger and then get the trigger data using either ScenEdit_UnitX(), ScenEdit_UnitY(), or ScenEdit_UnitC().

ScenEdit_UnitX()[edit]

[UnitX]

The unit that executed the trigger will be returned by UnitX. An example would be a plane entering a "Unit Enters Area" trigger.

ScenEdit_UnitY()[edit]

[UnitY()]

This displays the detecting unit. For example it will give you information on the radar or aircraft that detected the triggering unit.

ScenEdit_UnitC()[edit]

[UnitC()]

This one is a bit more interesting. Instead of returning all of the triggering information such as UnitX, it returns the contact information. This is a table of details that is distinct from the unit details returned by the UnitX function.