User:SuzannaLinn Resident/LuaMovingTo: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
SuzannaLinn Resident (talk | contribs)
No edit summary
SuzannaLinn Resident (talk | contribs)
No edit summary
Line 5: Line 5:
* Next, we will refine and improve them to take full advantage of Lua’s capabilities (SLua in Lua style).
* Next, we will refine and improve them to take full advantage of Lua’s capabilities (SLua in Lua style).
To follow this section effectively, a basic understanding of Lua is required, as covered in the previous two sections.
To follow this section effectively, a basic understanding of Lua is required, as covered in the previous two sections.
== Using SLua in the beta grid ==
These are the steps to follow before starting to script in SLua:
* Install the "Second Life Project Lua Editor" viewer, from: https://releasenotes.secondlife.com/viewer.html. This is a different viewer, with a different icon, than the "Second Life Viewer". We can keep our usual viewer for the main grid and use this one for the beta grid.
* Access the Beta Grid (Aditi), explained in: https://lindenlab.freshdesk.com/support/solutions/articles/31000156725-accessing-aditi
* Teleport to one of the four regions that have SLua activated. It doesn't work in the other regions. Sometimes one or two of these regions are offline, try another one if you can't tp or login:
** [secondlife://Aditi/secondlife/SLua%20Yardang/241/235/27 SLua Yardang]
** [secondlife://Aditi/secondlife/SLua%20Tombolo/241/235/27 SLua Tombolo]
** [secondlife://Aditi/secondlife/SLua%20Mesa/241/235/27 SLua Mesa]
** [secondlife://Aditi/secondlife/SLua%20Tideland/241/235/27 SLua Tideland]
* Rez an object and add a new script as usual. The script editor has a "compiler" drop-down list, at bottom center. Choose "Lua":
** LSL: Legacy (LSO2), the good old LSL, with "Mono" unchecked.
** LSL: Mono, the good old LSL, with "Mono" checked (the usual one).
** Lua - SLua
** LSL/Luau- LSL, but compiled into VM Luau instead of VM Mono.

Revision as of 08:19, 15 March 2025

Moving from LSL to SLua

In this section, we will learn how to rewrite our LSL scripts in SLua through a two-step process:

  • First, we will translate them into SLua while maintaining a structure as close as possible to the original LSL format (SLua in LSL style).
  • Next, we will refine and improve them to take full advantage of Lua’s capabilities (SLua in Lua style).

To follow this section effectively, a basic understanding of Lua is required, as covered in the previous two sections.


Using SLua in the beta grid

These are the steps to follow before starting to script in SLua:

  • Install the "Second Life Project Lua Editor" viewer, from: https://releasenotes.secondlife.com/viewer.html. This is a different viewer, with a different icon, than the "Second Life Viewer". We can keep our usual viewer for the main grid and use this one for the beta grid.
  • Teleport to one of the four regions that have SLua activated. It doesn't work in the other regions. Sometimes one or two of these regions are offline, try another one if you can't tp or login:
  • Rez an object and add a new script as usual. The script editor has a "compiler" drop-down list, at bottom center. Choose "Lua":
    • LSL: Legacy (LSO2), the good old LSL, with "Mono" unchecked.
    • LSL: Mono, the good old LSL, with "Mono" checked (the usual one).
    • Lua - SLua
    • LSL/Luau- LSL, but compiled into VM Luau instead of VM Mono.