Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Autonauts Modding API SnippetsNew to Visual Studio Code? Get it now.
Autonauts Modding API Snippets

Autonauts Modding API Snippets

ball-of-twine

|
129 installs
| (0) | Free
Provides Snippets for Autonaut's modding API (lua)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Autonauts Modding API Snippents

This is an extention that contains snippets for all classes/functions of the Autonauts Modding API

Snippet Format

  • Prefix: API call, including class
  • Description: Information from the class member function documentation from the Autonauts Modding API docs
  • Body:
    • Full function with parameters, one line per parameter.
    • Tabstops for each parameter.
    • An asterisk (*) before parameters that are required.
    • Includes the data type and default value (if any) commented to the right of the parameter

Snippets

You can type things like "modobject." (case-insensitive) and you will see options for "ModObject.GetObjectType", "ModObject.DestroyObject", "ModObject.GetObjectTileCoord", etc.
Typing just the function without the function's class also works. No need to memorise which class each function comes from.

TODO: gif of snippets usage

Snippet Example

ModTool.CreateTool()

ModTool.CreateTool(
    *UniqueName,               --string
    NewIngredientsStringArr,   --string[] = null
    NewIngredientsAmountArr,   --int[] = null
    ObjectsToUseOnArr,         --string[] = null
    TilesToUseOnArr,           --string[] = null
    ObjectsToProduceArr,       --string[] = null
    ObjectsToProduceAmountArr, --int[] = null
    AnimationDuration,         --float = 2.0f
    ModelName,                 --string = ""
    UsingCustomModel,          --bool = true
    CallbackOnComplete,        --DynValue = null
    DestroyTarget,             --bool = true
)

Notes:

  • Each parameter name is a tab stop
  • comment to right shows you value type and default, if any
  • Parameters starting with * indicate mandatory values

Code for generating the snippets.json file:

The snippets.json file is generated from the c# files from the game. I do not host the c# files anywhere, as they are the property of Denki Games.
The program for generating the snippets.json file is available on repl.it at autonautsVSCodeSnippitGenerator. The code is not pretty, and is sparsely commented. The intermediate json files (which are just json versions of the Autonauts Modding API docs) are available there, and the snippets.json file is generated from those.
When updates to the modding API are made, the c# files will need to be TEMPORARILY put into the "API" folder and the program re-run.
Some fixes where made to the various c# files before processing (classes with no public API methods, typos, etc). I have 'corrected' copies of these locally, but a bit of trial-and-error would work out for anyone else.

Release Notes:

0.0.4

Fixed trailing-comma issue after last param in snippet functions

0.0.3

Fixed repo url

0.0.2

Added icon

0.0.1

Initial release of Autonauts Modding API Snippents

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft