Missing content is one of the few kinds of mistake Lua never tells you about. A
mistyped material renders as the purple-and-black checkerboard, a mistyped model
becomes the error sign, and a mistyped sound is simply silence. Nothing raises an
error, so nothing points at the line that caused it.
Paths written as string literals are indexed and offered as completions:
Completion covers Material, surface.GetTextureID, SetModel,
util.PrecacheModel, ClientsideModel, EmitSound, surface.PlaySound,
sound.Play and util.PrecacheSound.
Pointing it at your game
Your own materials/, models/ and sound/ folders are found automatically —
they sit beside lua/ in an addon. To also complete base game content, set the
install directory:
Almost nothing in an install is a loose file: the base game and Half-Life 2
content live inside VPK archives. Those are read directly, so setting this takes
the index from a few hundred files to somewhere north of seventy thousand.
Reporting missing paths
There is a rule for paths that do not resolve, missingAsset, and it is off
by default.
Turn this on only if every asset you reference ships in this repository.Content mounted from the Workshop, or shipped in a separate content-pack
addon, cannot be seen from your editor. Measured against a real 932-file
gamemode with a full install configured, the rule reported 41–67% of
references as missing — nearly all of them real files that simply live
somewhere the editor cannot reach.
For a self-contained addon it is genuinely useful, and there it catches the
typos nothing else can:
Paths built at runtime are skipped rather than guessed at: