# Lua Scripting Workflow Tests Testing in this area should focus on the functionality of Lua Editor. ## Common Issues to Watch For Test guidance will sometimes note specific issues to watch for. The common issues below should be watched for through all testing, even if unrelated to the current workflow being tested. 1. Asset processor errors when loading/saving .lua files 2. Warnings or assets that appear in the Log 3. Unresponsive UI elements ### Platforms: - Windows - Linux ### Docs: * [O3DE Documentation: Writing Lua Scripts in Open 3D Engine](https://www.o3de.org/docs/user-guide/scripting/lua/) * [O3DE Documentation: Introduction to Open 3D Engine’s Lua Editor](https://www.o3de.org/docs/user-guide/scripting/lua/lua-editor/) * [O3DE Documentation: Basic Structure of a Lua Script](https://www.o3de.org/docs/user-guide/scripting/lua/basic-lua-script/) * [O3DE Documentation: Debugging Lua Scripts](https://www.o3de.org/docs/user-guide/scripting/lua/debugging-scripts/) * [O3DE Documentation: Debugging with Lua Editor](https://www.o3de.org/docs/user-guide/scripting/lua/debugging-tutorial/) * [O3DE Documentation: Using EBuses in Lua](https://www.o3de.org/docs/user-guide/scripting/lua/ebus/) ### Script Files: * ["Area: Creating a Lua skeleton script file" BaseScript.lua](#script_0) * ["Area: Properties usage in Lua scripts" BaseScript.lua](#script_1) * ["Area: Moving entity using Lua script" BaseScript.lua](#script_2) * ["Area: Using ScriptEvents to communicate between two Lua scripts" SendEvent.lua and ReceiveEvent.lua](#script_3) ## Area: Opening Lua Editor, connecting to Editor and using Find tool ### Project Requirements * Any project with the Remote Tools Connection Gem **Product:** Running Lua Editor with basic functions checked. **Suggested Time Box:** 20 minutes | Workflow | Requests | Things to Watch For | |----------|----------|---------------------| | Launch Lua Editor and connect to Editor |
  1. Check different methods of entry to Lua Editor:
  2. Modify Lua Editor layout:
  3. Connect to Editor by clicking *Target* button and choosing *Editor.exe (xyzxyzxy)* from the dropdown ![Lua Editor Target Button](images/Luaeditor_target_button.png)
|| | Create a new .lua file and check Log messages |
  1. Create a new .lua file by selecting *File → New* in Lua Editor, make sure to save it in a path accessible to Editor (for example *\\Assets\\*)
  2. Type few random characters into the script and save it using:
  3. Reopen the original .lua file after performing *File → Save As* operation
  4. Create one more new .lua file same way as in step 1 and move the script tabs between each other
  5. Add a change to each opened script (so that * is visible on their tabs) and use *File → Save All*
|| | Basic Find Tool usage |
  1. Add a unique string to any of the opened scripts (for example *text*)
  2. Check different methods of opening *Find* tool:
  3. Type the unique string into *Text to find:* textbox and click *Find Next* button
  4. Add the same unique string to two other opened files
  5. In *Find* tool change *Current File* dropdown to *All Open Files* and click *Find All* button
  6. Type a new unique string into *Replace With:* textbox (for example *Hello, World!*) and click *Replace All* button
|