Lua is a fun and easy scripting language widely employed in a variety of games, ranging from popular titles like Angry Birds to Call of Duty. Its simplicity and flexibility make it an excellent choice for both novice developers and experienced programmers looking to swiftly bring their ideas to life.
The integrated script editor is recommended for most users, and doesn't require any additional software to be installed. The script editor will open any time you double-click on a code file in the project panel, or you can select the Scripting > Script Editor item in the main menu.
The programming reference includes examples for most commands. To run an example, just copy the code from the example section of the page, and paste it into the file Source\Main.lua, overwriting its contents.
If you are using the integrated script editor, you do not need to read the rest of this article, and you can proceed to the first Lua programming tutorial.
If you prefer, it is possible to use Visual Studio Code for Lua programming. To begin programming with Lua and Visual Studio Code, follow these steps:
Install Visual Studio Code: Lua development for Ultra Engine is most convenient when using Visual Studio Code. If you don't have it installed, you can download it from Visual Studio Code.
Open Your Ultra Engine Lua Project:
Install the Lua Debugger Addon:
Configure Debugging Options:
Once your development environment is set up, you can run your Ultra Engine Lua game by following these steps:
Run Your Game:
Explore Example Projects:
If you see an error that says "Missing 'program' to debug" it is probably because you have the actboy168.lua-debug extension installed. You can uninstall the extension, or disable it for this workspace.
If you see an error that says "The code execution cannot proceed because MSVCP140D.dll was not found. Reinstalling the program may fix the error", this means the Visual Studio redistributable has not been installed.