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

Resistance Leader
User avatar
Posts: 4995
Joined: Tue Feb 09, 2010 8:43 pm
Location: Los Angeles, CA
Projects :: EVERYWHERE
Games I'm Playing :: The Division + DEHR
xbox live or psn: Marth8880

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

Postby Marth8880 » Thu Dec 28, 2017 6:40 pm

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.

Sergeant Major
Online
Posts: 224
Joined: Sat Feb 04, 2017 5:52 pm
Location: Milky Way
Projects :: Star Wars A New Frontier
Games I'm Playing :: SWBF2 2005
xbox live or psn: No gamertag set

Re: Lua API extension for Visual Studio Code

Postby LitFam » Thu Dec 28, 2017 7:54 pm

Interesting. Can’t wait to test this later.

Resistance Leader
User avatar
Posts: 4995
Joined: Tue Feb 09, 2010 8:43 pm
Location: Los Angeles, CA
Projects :: EVERYWHERE
Games I'm Playing :: The Division + DEHR
xbox live or psn: Marth8880

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

Postby Marth8880 » Fri Dec 29, 2017 9:26 pm

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.

Return to Released Assets

Who is online

Users browsing this forum: LitFam and 1 guest