VS Code

Installation

1. 1.
Download and extract the Cyber Engine Tweaks Lua Lib.
2. 2.
Install the Lua by sumneko extension.
3. 3.
Add next settings to the .vscode\settings.json or in the Settings GUI:
1
{
2
"Lua.runtime.version": "LuaJIT",
3
4
"Lua.workspace.library": [
5
"c:\\path\\to\\cet-lua-lib"
6
]
7
}
Copied!
4. 4.
On first use it takes a couple of minutes to parse and cache all definitions.
Unfortunately there is no visual indication of this process.
When it's done the code assistance will be more responsive.

Features

• Code completion for built-in Cyber Engine Tweaks and Cyberpunk 2077 types and functions (except ImGui and sqlite)
• Type resolving for Game.GetScriptableSystemsContainer():Get("Type"), NewObject("Type"), and GetSingleton("Type")
• Contextual suggestions for default values and predefined sets

Annotations

Callback parameters

You can specify the type of the parameters with @param annotation. It's very handy for Observe and Override:
1
[email protected] request PerformFastTravelRequest
2
Observe("FastTravelSystem", "OnPerformFastTravelRequest", function(request)
3
-- Now request object has type and suitable for code completion
4
end)
Copied!

Unresolved type

If type of some variable cannot be resolved or ambiguous you can force the type with @type annotation:
1
[email protected] ScriptedPuppet
2
local puppet
Copied!

Generic functions

The type of the result of some functions depends on the parameters passed to the function. If a valid type name is passed as a parameter, then the resulting type must be resolved without custom annotations.