Stormworks: Build and Rescue

Stormworks: Build and Rescue

25 ratings
Using VSCode for Lua with the Stormworks Extension
By Leg Sponger
How to download and setup VSCode for Stormworks.
Allows you to write better Microcontrollers, far more easily, with a full debugger and error checking.
2
   
Award
Favorite
Favorited
Unfavorite
Why Use VSCode
Stormworks Lua is an extension to provide proper build processes to the Stormworks community.

Key Features:
Do you hate trying to figure out why a certain value is wrong in a calculation?
Do you hate writing all your code in one big, disorganised file?
Do you hate the 4000 character limit?
Do you wish you could make well-structured code libraries, and use that code on multiple projects without copy/pasting?

The extension solves these by providing:
An extremely powerful Minimizer, that can remove redudant code and shrink files massively
A Combiner, that can trace the "require(...)" keyword so you can write code across multiple files
A full Debugger that can show you the memory values of your Microcontroller
A Simulator that support multiple screens simultaneously
Full type hinting and error checking to avoid typos
A solid library of code, the LifeBoatAPI, to simplify writing Stormworks code.

How to Download It?
Download VSCode here for free (official microsoft download): https://code.visualstudio.com/download

Inside VSCode, search "Extensions" for "Stormworks" and install the extension.
It's also available here: https://marketplace.visualstudio.com/items?itemName=NameousChangey.lifeboatapi


If you find any issues, just comment here or add a new bug on the issues tracker:
https://github.com/nameouschangey/STORMWORKS_VSCodeExtension/issues

11 Comments
PweeDos 26 Aug @ 3:29pm 
Thank you V-1Missile!
V-1missile 6 Apr @ 11:20am 
Hello, OddlyTugs. I think You have a problem with the Lua Debug extension.
I believe that pulling down the version of the Lua Debug extension to 1.6.x will solve the problem.

Translated by DeepL
OddlyTugs 6 Apr @ 3:27am 
no runtime (c:/users/user/.vscode/extensions/actboy168.lua-debug-2.0.5-win32-x64/win32... is found you need to compile it yourself

please help
Kiritsu 29 Aug, 2022 @ 12:39pm 
Thank you for the quick reply
Leg Sponger  [author] 29 Aug, 2022 @ 4:08am 
There could definitely be better docs,
In VSCode you can view the "Details" page for the extension, from the extensions tab - and it lists the things it can do *generally* (although might now be a bit out of date/some new stuff added)

For the actual code library - the MC one is nice and small, just have a look through the code and use bits you like.

For the Addon library, it's in development, and because it's more of a paradigm shift - I'll write up better docs soon to explain the main ideas behind it.

Thanks!
Kiritsu 28 Aug, 2022 @ 7:53am 
Is there a tutorial or official doc of all lifeboatApi features?
Leg Sponger  [author] 12 Jun, 2022 @ 3:53pm 
Major update just released - added ability to create and use git libraries easily.
So now you can share your code with others, and use code from others without any stress - just right click "Add Library From URL" and enter any git repo, it'll pull it into the libs folder and setup all your paths.

Then just `require` the files you want from your code as normal
Leg Sponger  [author] 19 Dec, 2021 @ 4:49pm 
@pieter Hey, apologies if it's not clear.
If you want to set the inputs; you can look in the file _build/_simulator_config.lua
You'll call __simulator.config:addNumberHandler or ...addBoolHandler

and the arguments it takes are addNumberHandler(inputIndex, functionThatProvidesANumberEachTick)

You can use the LBSimulatorInputHelpers class to get some useful functions quickly, and pass that in to the parameter.

If it still doesn't make sense, can come onto Discord and find me (nameous) there. I'm happy to help explain it.
pieter.1992 18 Dec, 2021 @ 11:44pm 
how do i change the values of the inputs in debug mode
Leg Sponger  [author] 17 Dec, 2021 @ 6:44am 
@joecaptain Thanks! I hope you find it helpful! Will be releasing an update that supports multi-mc simulation shortly!