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 is currently "live" on Steam/GoG) 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.
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.
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.
Debugging with VS Code
Re: Debugging with VS Code
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
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.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Debugging with VS Code
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).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
Re: Debugging with VS Code
ah, ok
I thought that that functionality is some kind of overlay, that brings the file up that contains the element
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.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Debugging with VS Code
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,
Re: Debugging with VS Code
I've just installed this, but the control click does not seem to be opening anything in VS Code. Does this still work? I'm trying to track down where "Capricious" is applied to morale.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Debugging with VS Code
It should still work. I just installed it on a new computer, tested things out, and ctrl-click does work for me. But note that to enable debugging, you need to launch SiS from the VS-code debugger tab, not via Steam. (That "launch" configuration sets up some command-line switches and other things that are necessary to make the whole live coding system work.)akkamaddi wrote:I've just installed this, but the control click does not seem to be opening anything in VS Code. Does this still work?
Also note that ctrl-click doesn't work everywhere in the game. One good place to test it is from the initial Race descriptions in the start-game menu.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Debugging with VS Code
As best as I can tell, implementing "Capricious" remains a "TODO".akkamaddi wrote:I'm trying to track down where "Capricious" is applied to morale.