Debugging with VS Code

A place for discussion of making game modifications.
User avatar
sven
Site Admin
Posts: 1391
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Debugging with VS Code

Postby sven » Fri May 11, 2018 11:33 pm

Recently, I've been playing with VS Code as an IDE for Stars in Shadow development. Some Korean game devs have written a very nice Lua debugger for it, and that means VS Code is now actually in many cases a better IDE for SiS than Visual Studio. It's also far easier to download and setup. If you're a modder, I'd suggest taking a look.

As of r37523 (which atm is still only avaliable in the "in_development" branch) you should be able to get setup as follows:

Install VS Code.
From your VS Code extensions tab, install the devCAT Lua Debugger.
From your VS Code extensions tab, Install sven2718's openhintvc extension.

Image

Go to File->Open Folder and open your "Lua state" dir.
In the VS Code debug pane, select launch-sis, and hit the green arrow.

Image

Now, if everything is working, the game should start in debug mode, and you should have access to both CTRL+click hotkeys and the ability to set breakpoints / view stack traces.

User avatar
siyoa
Posts: 129
Joined: Fri Apr 21, 2017 3:19 pm

Re: Debugging with VS Code

Postby siyoa » Sat May 12, 2018 2:46 am

works so far :)

now, when I click "New Game" and ctrl-click on race description file RACES.lua opens, but ctrl-clicking anywhere else (race picture, home world) nothing happens :?:
How did YOU get a key? All right, go in.

User avatar
sven
Site Admin
Posts: 1391
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Debugging with VS Code

Postby sven » Sat May 12, 2018 3:07 am

siyoa wrote:works so far :)

now, when I click "New Game" and ctrl-click on race description file RACES.lua opens, but ctrl-clicking anywhere else (race picture, home world) nothing happens :?:


the ctrl-click feature is not implemented everywhere in the game -- basically, trying to use it on a given text block will give you a hint how old the underlying sources are (the ctrl-click feature is /relatively/ new).

User avatar
siyoa
Posts: 129
Joined: Fri Apr 21, 2017 3:19 pm

Re: Debugging with VS Code

Postby siyoa » Sat May 12, 2018 4:43 am

ah, ok

I thought that that functionality is some kind of overlay, that brings the file up that contains the element
How did YOU get a key? All right, go in.

User avatar
sven
Site Admin
Posts: 1391
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Debugging with VS Code

Postby sven » Sun May 13, 2018 10:25 pm

Hmm. Apparently, most of the source files in SiS are encoded in Windows-1252, which VSCode will, by default, mis-label as UTF-8. This leads to text formatting glitches when VSCode re-saves any files that use extended characters, like '’' or '©'. There's a pretty simple fix though, which is to go to File->Settings and add the user settings overrides:

Code: Select all

    "files.encoding": "utf8bom",
    "files.autoGuessEncoding": true,


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 3 guests