Getting Started
Development Environment
Section titled “Development Environment”You can write SLua scripts in the script editor in the viewer.
If you want to use an external editor, then you can use VS Code with the Second Life External Scripting extension.
- VSCodium is an alternative to VS Code if you prefer.
Setting Up VS Code for SLua Scripting
Section titled “Setting Up VS Code for SLua Scripting”- Create a new workspace folder for your Second Life scripts
- Open the folder in VS Code
- Now back to your Second Life viewer, configure the External Script Editor setting in your preferences → Advanced → Script Development so that it opens up VS Code
- On Windows this might look something like:
"C:\Program Files\Microsoft VS Code\Code.exe" "%s"
- On Windows this might look something like:
- Right-click on an object in Second Life
- Select “Edit” → “Scripts”
- Click “New Script” or “Edit” on existing script
- Rename the script and create an equivalent file in your VS Code workspace but with the
.luauextension - Click Edit… on the script editor window - VS Code will automatically open, showing a temporary file for moment but then switching over to the equivalent file as the master script
- Edit in VS Code with full preprocessing support
- Save to sync changes back to the viewer