News:

Welcome to World of Banished!

Main Menu

Parser for Notepad++

Started by FlyingDutchman, September 23, 2019, 12:58:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

FlyingDutchman

As I am very new to Banished and have little to no knowledge of the .rsc and .srsl files, I thought it might be a good idea to contribute to this forum in another way. Working with Notepad++ for several years now, I have gained enough knowledge to create a parser and autocomplete XML-file for Banished, and I've seen at least one member asking for this.

Required: Notepad++ v7.7.1 https://notepad-plus-plus.org/downloads/v7.7.1/.

Syntax highlighting

First the parser for Banished resource files. The parser is used to highlight certain parts of the code in the resource files:
Dark-blue: declare types (classes/structures/arrays)
Light-blue: string values delimited by double quotes
Dark-green: variables and other descriptors prefixed with an underscore
Light-green: single-line comments (as preceded with //)
Red: data types (bool, int, float, String)
Red (bold): false, true
Purple (italic): constants (predefined, named values as I presume these to be)
Orange: numeric values
Black: variables and other descriptors without the underscore prefix



How to install

Unpack the zip-archive to any location. In the menubar of Notepad++ select Language -> Define your language... Press the Import... button and select Banished_RSC.xml. That's all!

If you already have one or more resource files open in Notepad++, you will notice that nothing will happen as Notepad++ most probably has defined the "Resource file" language for the resourcefile. Opening another Banished resource file with the parser installed, will open that file with syntax highlighting.

Change styles

If you don't like the color definitions I use, open the UDL dialogue window that you used to import the XML file. Be sure that Banished_RSC is selected in the top left of the UDL dialogue window. On every tab you will find a Styler button for each of the defined styles. For each style you can define foreground color, background color, font, font size, bold, italic and underline. Changes in style will have no effect on building and packaging a mod.

Autocomplete

Next to come is an autocomplete XML file for Notepad++. That takes quite a lot of work and may take a while before I can publish it here.

Correct me where I am wrong

Because I am not (yet) familiar with the Banished resource files, I may have made some wrong assumptions. If so, please correct me where I am wrong and I will correct the parser where necessary.

Update available

An update is available in my post of September 25, 2019.

MarkAnthony

Bookmarking this just in case I ever decide to get into modding for Banished. I haven't modded for a game in years and I still think the Banished way of doing things is over my head, but who knows maybe one day.  Thanks!
Sometimes it's the very people who no one imagines anything of
        who do the things no one can imagine.

FlyingDutchman

#2
Thanks! I also think modding for Banished is way over my head. I have done quite a lot of modding for the Elder Scrolls V: Skyrim, anxiously waiting for chapter VI.

EDIT:

@MarkAnthony:
The parser for Notepad++ (highlighting) has been updated and the autocompletion XML has been uploaded.