Hi, here you can find all the information on how to configure VSCode to write mods for ADVR better and faster.
There are two components that make it easier for you to create mods for ADVR:
- custom language server files, which allow you to use the IntelliSense features tailored to the ADVR context
- Custom code snippets for VSCode that cover the typical use cases
- Installed Version of the VSCode IDE
- First of all, you need to download the latest release here in the GitHub repository.
- Unpack the zip file
- Install the VSCode extension named Lua
- Copy the the
advr
folder inside thelanguage_server
folder of the downloaded release to~/.vscode/extensions/sumneko.lua-<plugin_version>-<operating_system>/server/meta/3rd
(Note:~
is your user folder, where VSCode stores the config files when installed with default settings. On Windows this folder is located underC:/Users/<your_username>/.vscode
. Everything written in<>
is dependent on the setup and operating system) - Open VSCode
- Press Ctrl + Shift + P and type snippets
- Open
Configure User Snippets
- Type
lua
and press Enter - Replace the content of the now opened file with the one from the file
advr_snippets.json
from the downloaded release - Save and close the file
Congratulations, you are know ready to use the modding annotations.
- Open new or existing VSCode project
- Type any name included in the annotations, for example
pickup
and add a.
to get auto complete, when doing the first time you will get an pop-up like the following:
- Press
Apply and modify settings
. Now you should see an folder.vscode
in your current workspace, which contains a settings file.
If this popup does not appear you can manual.
This can be achieved by coping the folder .vscode
from the downloaded release into the current workspace or by working through the following steps:
- Create a folder called
.vscode
inside your workspace - Create a file called `` inside the just created folder
- Copy the following content into the file:
{
"Lua.workspace.library": [
"${3rd}/advr/library"
],
"Lua.workspace.checkThirdParty": false,
"Lua.diagnostics.disable": [
"lowercase-global"
]
}
- Close and save the file
- Now you can use the snippets and the annotations inside VSCode.
- When the lua language server VSCode extension has been updated, then our ADVR plugin must be moved back to the new folder. For example from:
C:\Users\<your_username>\.vscode\extensions\sumneko.lua-3.6.3-<operating_system>\...
to
C:\Users\<your_username>\.vscode\extensions\sumneko.lua-3.6.4-<operating_system>\...
For a quick and easy start into the modding world of ADVR we provide some examples within the wiki. Some of these examples are also available as video tutorial.