Stormworks: Build and Rescue

Stormworks: Build and Rescue

26 vurderinger
Using VSCode for Lua with the Stormworks Extension
Av 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
   
Utmerkelse
Favoritt
Favoritter
Fjern som favoritt
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 kommentarer
PweeDos 26. aug. kl. 15.29 
Thank you V-1Missile!
V-1missile 6. apr. kl. 11.20 
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. kl. 3.27 
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 kl. 12.39 
Thank you for the quick reply
Leg Sponger  [skaper] 29. aug. 2022 kl. 4.08 
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 kl. 7.53 
Is there a tutorial or official doc of all lifeboatApi features?
Leg Sponger  [skaper] 12. juni 2022 kl. 15.53 
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  [skaper] 19. des. 2021 kl. 16.49 
@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. des. 2021 kl. 23.44 
how do i change the values of the inputs in debug mode
Leg Sponger  [skaper] 17. des. 2021 kl. 6.44 
@joecaptain Thanks! I hope you find it helpful! Will be releasing an update that supports multi-mc simulation shortly!