Skip to main content

Getting Started

This article should get you covered if you are interested in developing Lua scripts (modules) for LS with our SDK.

Setting up dev environment

Choosing IDE and installing Lua Language Server

For our SDK annotations in IDEs we are using Lua Language Server, which has improved annotations based on EmmyLua.
In VS Code it comes shipped with sumneko.lua extension which we recommend to use.
In JetBrains IDEs you can also use SumnekoLua plugin.
For alternative installation methods for other IDEs check out Lua Language Server install page.

Getting LS SDK annotations

You can always download latest version here: LS-SDK-Annotations.7z
It is automatically built and updated whenever we update this SDK documentation.

Setting it up

  • Extract the archive to some location
  • And then add that location in your VS Code Settings -> Extensions -> Lua (sumneko) -> Library
tip

We highly recommend to get proper IDE and setup these annotations. They will help you learn our SDK much faster.

Your first LS Lua module

Where Lua modules are loaded from

All custom Lua modules (scripts) should be located in GS\tier3\ folder.

Lua module structure

  • It must be located in its own folder, for example for MyLuaModule it must be: GS\tier3\MyLuaModule\.
  • Module name is defined by folder name, in this example it's MyLuaModule.
  • Entry point file is module.lua, so it in this example it's GS\tier3\MyLuaModule\module.lua.
  • Each Lua module in LS has its own environment table. This environment can be accessed externally from other modules by module name. In this example it's MyLuaModule.

Twisted Fate example

With LS we provide very basic open source example of Twisted Fate script. You can find it in GS\tier3\example-TwistedFate\ to study it.
It shows some basic and good practices, such as:

  • Not loading the script if you are not playing the right champion by performing hash check
  • Disabling C++ Core champion with Champions.CppScriptMaster
  • Loading submodule files with Environment.LoadModule
  • Using our Callback System
  • And so on