Half-Life: Alyx Workshop Tools/Lua Scripting/Getting Started
What is Lua?
Lua is a programming language frequently used in games running on the source engine. Lua scripts are able to talk to the game engine through an API layer, which allows people to create new scripts for weapons, gammemodes and much more.
- NOTE: Due to Half Life Alyx being a fairly new game, some of the API functionality simply does not exist yet on the engine side. For example, you may encounter some API calls that will simply return nil instead of what you were expecting.
Create a Place For Your Scripts
1. Find your hlvr folder
- The path should looks something like: D:\SteamLibrary\steamapps\common\Half-Life Alyx\game\hlvr, depending on where you installed it.
2. Create folders
- Create a folder called: scripts. Inside that folder create another folder called: vscripts.
- you should now be in a directory that looks like this: D:\SteamLibrary\steamapps\common\Half-Life Alyx\game\hlvr\scripts\vscripts
This is where all your .lua files will go
Source looks for the scripts in the scripts/vscripts folder. You can also add folders in scripts/vscripts to separate out your scripts by project or have common scripts.
These basic examples will show you how to connect the game world to the scripts that you write:
1. Hello Gordon: The classic example.
2. Coming soon ...