SWBF2 Lua API extension for Visual Studio Code (v1.0.0)

Releasing the source files for your mod or map? Post em' here. (Applies to both SWBF1 & SWBF2)

Moderator: Moderators

Post Reply
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

SWBF2 Lua API extension for Visual Studio Code (v1.0.0)

Post by Marth8880 »

Image

Lua API for Star Wars Battlefront II (VSCode)

Latest version : v1.0.0-VSC - 2017-12-29


Overview

Hey guys! Remember my Lua API "megamix" for Lua Development Tools? Well, I've finally ported it to Visual Studio Code as an extension hosted on the Visual Studio Marketplace! There are a few key differences as you'll note in the "Features" section below, but at its core it's pretty much the same thing. ;)


Requirements

Aside from having Visual Studio Code installed, there are no explicit requirements or dependencies for this extension.


Install
  • 1. Go to the extension's page on the Visual Studio Marketplace
    2. Click the `Install` button
    3. If you're prompted to allow Visual Studio Code to open, confirm the prompt
    4. Once Visual Studio Code has opened, click the `Install` button, then the `Enable` button
OR
  • 1. Open Visual Studio Code
    2. Press `Ctrl+P` to open the Quick Open dialog
    3. Type `ext install vscode-swbf2-lua-api` to find the extension
    4. Click the `Install` button, then the `Enable` button
OR
  • 1. Press `Ctrl+Shift+X` to open the Extensions tab
    2. Type `vscode-swbf2-lua-api` to find the extension
    3. Click the `Install` button, then the `Enable` button
OR
  • 1. Open a command-line prompt
    2. Run `code --install-extension aarongilbert2012.vscode-swbf2-lua-api`

Features

This extension includes snippets for virtually every single built-in Lua function in Star Wars Battlefront II (2005). The only ones that are currently undocumented are many of the shell-exclusive callbacks, but there is pretty much no use for those anyway.

Image

Currently included
  • IntelliSense-like function auto-completion.
  • Each function includes a description of what it does - some include thorough use-case examples.
  • Functions with parameters include auto-completion for each parameter.
  • Parameters with predetermined values have dropdown-based value auto-fill.
  • Functions with multiple return values include descriptions of each return value.
  • Snippets for all event callbacks (such as `OnCharacterSpawn`) - furthermore, each snippet includes auto-completion that sets up the callback's lambda function (e.g., 'function(object, killer)' for 'OnObjectKill') and instance values.
Not yet included
  • Parameter descriptions - this is largely because VSCode does not yet seem to support individual parameter descriptions.

Issues

If you think there are any missing or incorrectly-documented functions/parameters/return values, please file a bug report.


Release Notes

v1.0.0-release-VSC (latest)

v0.1.0-release-VSC
Last edited by Marth8880 on Wed Jan 10, 2018 3:22 am, edited 4 times in total.
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: Lua API extension for Visual Studio Code

Post by LitFam »

Interesting. Can’t wait to test this later.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: SWBF2 Lua API extension for Visual Studio Code (v1.0.0)

Post by Marth8880 »

v1.0.0 has been released, and event callback snippets are now a thing!

Image

If you've installed a previous version of the extension, it will update automatically. Elsewise, see the Install instructions at the top of the thread.
Post Reply