QuickBMS Notepad++ User-defined Language

Do you know a tool, link or website for working on a specific game files or to help game research? Let's collect them here!
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

QuickBMS Notepad++ User-defined Language

Post by puggsoy »

I use Notepad++ to create and edit QuickBMS scripts (makes indentation easier). However today I looked into making custom syntax colouring and such for it, and it wasn't too hard. Basically I just made it colour various commands and data types, as well as comments and strings. It makes script a bit more readable and less bland to look at. It also allows you to collapse if statements and loops.

I've attached an XML file with the language definition. To use it, in Notepad++ go to Language -> Define your language, then click Import and select the XML file. It should automatically detect .bms files to be displayed using that definition.

Hopefully this is helpful for some people, I definitely think it makes scripts easier to read :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS Notepad++ User-defined Language

Post by aluigi »

There is also one on my website:
http://aluigi.org/papers/bms/userDefineLang.xml

I have only to add few recent algorithms and a couple of commands but it should be quite complete.
Maybe take a look at it too.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS Notepad++ User-defined Language

Post by aluigi »

I have just updated it by adding NameCRC and Codepage plus all the remaining compression and encryption algorithm that have been introduced in the recent versions.
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: QuickBMS Notepad++ User-defined Language

Post by puggsoy »

Ah, didn't know that existed. That one's much better than mine :P

Guess I'll be using that now, thanks!
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: QuickBMS Notepad++ User-defined Language

Post by Delutto »

aluigi wrote:I have just updated it by adding NameCRC and Codepage plus all the remaining compression and encryption algorithm that have been introduced in the recent versions.

Sorry for the necropost but I can't finded this subject on another place so... there's some problem with the comment tags "/**/", you can see what I'm talking about in this script: http://aluigi.altervista.org/bms/nxpk.bms
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS Notepad++ User-defined Language

Post by aluigi »

@Delutto
Here I see no problems with nxpk.bms. The only "weird" thing is that both "if" and "endif" are red but the comment is perfectly handled.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: QuickBMS Notepad++ User-defined Language

Post by Delutto »

aluigi wrote:@Delutto
Here I see no problems with nxpk.bms. The only "weird" thing is that both "if" and "endif" are red but the comment is perfectly handled.
Exactly, I was talking about the Np++ User-defined Language, not the script itself.
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

Re: QuickBMS Notepad++ User-defined Language

Post by z4ruz »

Fixed.
Before.jpg

After.jpg

Process.gif

There are two versions:
1) fixed as shown and exported (20 KB)
2) manually patched as text (27 KB)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS Notepad++ User-defined Language

Post by aluigi »

Great! :D
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

Re: QuickBMS Notepad++ User-defined Language

Post by z4ruz »

Fixing resulted issue.
c12.gif
Also added (seek_set seek_cur seek_end) to 7th group, (exit) to 1st.
Enabled folding of comments. (compact, expand)
afoc.gif
There's a great plugin used to get context help: Language Help by Franco Stellari
LangHelp.gif
But it's fully functional for help files in specific formats.
The help file path may point to a local CHM, HLP, or PDF files for keyword search.
Alternatively, the field may point to a command/file that will be shell executed.
This include HTML file both on the local machine and on the internet.
The other good solution would be console like help: getdstring /?
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

Re: QuickBMS Notepad++ User-defined Language

Post by z4ruz »

Show commands arguments and short description.
2.gif
Place xml in installDir\autoCompletion
32.7z
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: QuickBMS Notepad++ User-defined Language

Post by Ekey »

Noice :D
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

Re: QuickBMS Notepad++ User-defined Language

Post by z4ruz »

Thanks!
NP++ doesn't allows space as function start, sadly. That's why question mark is used.
To change the descriptions, one can either modify the resulted xml or modify the powershell script and produce new xml.
Function overload is not supported, with single exception - and it looks great! Would be good to make it for all the functions.
If someone interested to have QBMS syntax in 010 Editor, there's draft with keywords only.
Also interested to add QBMS syntax in AkelPad.