Good evening, everyone,
I'm trying to edit my .ash and .asc script-files with VSCode. I have found an old topic about editing with Sublime, but it didn't answer my question, and I couldn't find an answer elsewhere, so here goes:
When I open up the files and set syntax highlighting to C++, it looks absolutely beautiful and I want to use this. However, something is wrong about the character encoding - the German characters that I have in my dialogue-lines are replaced. They are not when developing in AGS itself or when testing the game. What is the encoding for these files? I tried all the obvious ones included in VSCode, but none of them would give me the ö, ü and ä that I need :)
Thanks in advance!
Johannes
EDIT: I found my solution by letting VSCode guess the encoding, which turned out to be "Windows 1252". I thought I had manually tried out this encoding before, but apparently I was wrong. To achieve this, I added "files.autoGuessEncoding":true to the settings.json in VSCode.
It's very important to note that AGS currently is a strictly ANSI program, which means that all scripts and other textual data must be saved in ANSI encoding.
It does not have to be exactly Windows 1252, any code page would work, but that makes difference only if you are writing non-English game text in script.
Just a note that Atom actually has an AGS Script plugin.
https://atom.io/packages/language-ags-script
Also, I don't recommend having the same file open on both, with me, this causes AGS to crash.
Quote from: eri0o on Mon 08/07/2019 21:11:49
Also, I don't recommend having the same file open on both, with me, this causes AGS to crash.
Could you open a ticket please, AGS was supposed to detect changes to script normally.
Hey CW!
I created a ticket here -> https://github.com/adventuregamestudio/ags/issues/867
Unfortunately, I don't get a crash window like I normally get with other AGS errors on the editor, and instead get a weird floating black pop up window.
Hey guys,
thank you for the infos.
I actually spent yesterday trying to figure out how to convert that Atom plugin into a VSCode extension, but so far no dice. Couldn't really understand what tree-sitter does, to be honest. It is a parser that maintains the syntax tree... so it basically crawls the codebase and spits out rules for syntax highlighting, right?
Either way, I found a reddit post on it, and tried to convert the grammar that edmundito created into a textmate syntax for VSCode, but as you probably noticed, I turned out not to have sufficient understanding of the material. If I do get anywhere I'll post it.