Jump to content
gossamersolid

Arma 3 Notepad++ Syntax Highlighting

Recommended Posts

@Janez
Hi.

It turns out the issue I had with alphabetical sorting was because of a bug in Notepad++. I was using Function Completion only, but after switching to "Word and Function Completion" my issue is gone!

 

I hope it'll be useful to others running into the same problem!

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 10/26/2018 at 2:42 PM, Leopard20 said:

@Janez
Hi.

It turns out the issue I had with alphabetical sorting was because of a bug in Notepad++. I was using Function Completion only, but after switching to "Word and Function Completion" my issue is gone!

 

I hope it'll be useful to others running into the same problem!

 

I have the same problem. I did what u say. But auto compleation works only for words, not the functions.

---

upd

Just dowloaded Notepad++ 7.5.8 (old version) and everything works!!

I dont know why, but when I installed new version - there is no "plugins\APIs" foldier. Maybe that is the reason - it should be in another place. Because when I created this foldier and puted SQF.xml from "Auto" - Autocompleation didnt work for me

Share this post


Link to post
Share on other sites
13 hours ago, blackburnrus said:

 

I have the same problem. I did what u say. But auto compleation works only for words, not the functions.

---

upd

Just dowloaded Notepad++ 7.5.8 (old version) and everything works!!

I dont know why, but when I installed new version - there is no "plugins\APIs" foldier. Maybe that is the reason - it should be in another place. Because when I created this foldier and puted SQF.xml from "Auto" - Autocompleation didnt work for me

Then perhaps it was a combination of update + changing the setting to Word and Function completion that made it work!

Share this post


Link to post
Share on other sites

Hi, thanks for pointing this out!

 

As of Notepad++ version 7.6.2, one should copy "Auto\SQF.xml" into (default path "C:\Program Files\Notepad++\autoCompletion").

 

New update also released for 1.86 Warlords update:

https://drive.google.com/open?id=13R_DsyP4qKu-K06A527zRQJO7iQ4UaBy

 

Quote

27. March 2019

ChangeLog:

- added: Warlords functions introduced with update 1.86

  • Thanks 1

Share this post


Link to post
Share on other sites

Just to be sure, install version 7.6.4 or newer. That's the one I tested with.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much Janez for the support !

I have used other programs as well , but i really like using notepad++.

Share this post


Link to post
Share on other sites

Yeah, me as well and there is a plugin out there for pretty much everything. Just recently I discovered a markdown (.md) plugin for example.

  • Like 1

Share this post


Link to post
Share on other sites

@Janez
Hi,

I found a couple of other missing commands and functions.

But this time, instead of reporting them one by one, I decided to just create a couple of .sqf files to quickly identify all the missing commands, so you can implement them all in one go!

This is a list of all commands:
https://www.dropbox.com/s/er7bqkhxxzr037t/commands.sqf?dl=0


And this is a list of all vanilla functions:
https://www.dropbox.com/s/9gkp6tagx3yb7nb/functions.sqf?dl=0


All you have to do is run these files using Notepad++

Obviously, those that are purple are missing!

I hope it helps!

  • Thanks 1

Share this post


Link to post
Share on other sites

By the way, I updated those files. Some Spaces had to be replaced with "_"
If you downloaded them before seeing this commend, please redownload.
Sorry about the inconvenience.

Share this post


Link to post
Share on other sites

Hey @Leopard20, thanks buddy! Yeah, I noticed the spaces and empty lines. Appreciate your update but I already dealt with that, thanks to Notepad++' tools.

We did it boyos, we reached character limit of 30720 for a single keyword group. So, I had to split the commands and functions in multiple groups. I adjusted the default group styles to reflect that but if you like to use custom colors then you'll probably have to adjust the group colors to your liking. Remember, you don't have to fiddle in menus after every update, you can just replace the corresponding lines in "Language\SQF.xml". There are also global solutions but I wont go into that.

 

        <Styles>
            <WordsStyle name="DEFAULT" fgColor="660E7A" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="3" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="2" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="2" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="0000FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="000080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="0080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="0080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="8080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="8080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="0080C0" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="FF8000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="008000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
        </Styles>

 

Anyway, here's the new update:

https://drive.google.com/open?id=1gAgKM-LmJ_QWDeySyMCSlC_3IFy3rwN8

01. June 2020
ChangeLog:
- added: all scripting commands and functions up to 1.98 should be included
  • Like 2

Share this post


Link to post
Share on other sites
On 6/1/2020 at 2:22 PM, Janez said:

Hey @Leopard20, thanks buddy! Yeah, I noticed the spaces and empty lines. Appreciate your update but I already dealt with that, thanks to Notepad++' tools.

We did it boyos, we reached character limit of 30720 for a single keyword group. So, I had to split the commands and functions in multiple groups. I adjusted the default group styles to reflect that but if you like to use custom colors then you'll probably have to adjust the group colors to your liking. Remember, you don't have to fiddle in menus after every update, you can just replace the corresponding lines in "Language\SQF.xml". There are also global solutions but I wont go into that.

 

 

  Reveal hidden contents

 



        <Styles>
            <WordsStyle name="DEFAULT" fgColor="660E7A" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="3" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="2" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="2" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="0000FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="000080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="0080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="0080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="8080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="8080FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="0080C0" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="FF8000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="008000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
        </Styles>

 

 

 

Anyway, here's the new update:

https://drive.google.com/open?id=1gAgKM-LmJ_QWDeySyMCSlC_3IFy3rwN8


01. June 2020
ChangeLog:
- added: all scripting commands and functions up to 1.98 should be included

Thanks for the update!

If you don't mind, I'd like to provide feedback on the new update:


1. Global and Local variables have the same style: Before this update, global and local variables used different styles, which allowed the programmer to quickly recognize them in any script.

2. "True", "false", and "player" commands are grouped into the _x and _foreachindex style group (which are local magic variables).

3. Current style colors look too similar and hard to distinguish (personal opinion; also doesn't matter since you can change it yourself)

4. Some commands are not sorted alphabetically, so the auto-completion dialog closes when it reaches that letter (e.g. try 'addonFiles'; the dialog closes as soon as you type the letter 'n')

5. Preprocessor commands are not styled as they should be (e.g. define and ifdef). I think if you remove the # before them it will be fixed.

I recommend that you change the 2nd group to _ (prefix) and put _x and _foreachindex and _this into the 1st group (to make it look like before)
Here is a list of all magic variables (if you're interested in implementing them all):
https://community.bistudio.com/wiki/Magic_Variables

BTW, do I have to change the styles every time after update?

Anyway, I like the fact that now vanilla commands and functions have different styles! Great job!

 


Edit: Found another issue:
6. CBA functions do not have autocompletion!

  • Thanks 1

Share this post


Link to post
Share on other sites

@Leopard20, do you have some clever way of gathering all those commands from the game or you went and copied all that crap from Biki? If the latter, then... just wow. Thank you either way!

 

Right, watch out with lexicographical sorting in N++, it's case sensitive. So, good old SORT <textfile> in CMD did the trick. Auto-completion should be fixed now.

As I already pointed out, it's a bit tight now with keyword groups, we have less space to maneuver but functionality should be restored to pretty much the same as before. Even better in some cases, imo.

 

I also revised the whole coloring scheme. Fore, background, operator and folder colors should adopt global values if you're not running global overrides (Settings\Style Configurator >> Global Styles >> Default Style >> Colour Style).

My goal was to make this usable for bright and dark global color schemes, while using colors that are not either too saturated or dull, so your eyes don't get burned or strained due to lack of contrast. Furthermore, I tried to differentiate various groups but also not over saturate the image as a whole. Obviously this depends on type of code, i.e. whether your have lots of commands or math.

 

Now, depending on what you're used to and your setup, lighting conditions and whatnot, you can decide for yourself if I was successful in this endeavor or not. You can set your own colors but I'm afraid you'll have to reset them after every update, which is every few months. I do recommend darker color schemes however.

If you do not want to fiddle through menus every time, you can just replace <Styles></Styles> block of code in "Languages\SFQ.xml" as mentioned in previous post.

 

Let me know what you think and of course, if something got horribly broken. 🙂

 

Download link: https://drive.google.com/file/d/1k_zg9qvSX2TLB0jDxox4irWgmW-PSFF_/view?usp=sharing

 

02. June 2020
ChangeLog:
- added: all magic variables
- fixed: auto-completion
- improved: default color scheme that should adapt better to global settings
- improved: highliting groups
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

@Janez Thanks for the quick update!

2 hours ago, Janez said:

do you have some clever way of gathering all those commands from the game or you went and copied all that crap from Biki?

I got em from the wiki. But there's a command called 'utils 5' that you can run in the game. Gives you the full list of commands. I don't recall if you can copy them or not (some utils did have that feature, not sure about utils 5).

 

2 hours ago, Janez said:

I also revised the whole coloring scheme. Fore, background, operator and folder colors should adopt global values if you're not running global overrides (Settings\Style Configurator >> Global Styles >> Default Style >> Colour Style).

My goal was to make this usable for bright and dark global color schemes, while using colors that are not either too saturated or dull, so your eyes don't get burned or strained due to lack of contrast. Furthermore, I tried to differentiate various groups but also not over saturate the image as a whole. Obviously this depends on type of code, i.e. whether your have lots of commands or math.

 

Now, depending on what you're used to and your setup, lighting conditions and whatnot, you can decide for yourself if I was successful in this endeavor or not. You can set your own colors but I'm afraid you'll have to reset them after every update, which is every few months. I do recommend darker color schemes however.

If you do not want to fiddle through menus every time, you can just replace <Styles></Styles> block of code in "Languages\SFQ.xml" as mentioned in previous post.

I see. Thanks for the info.


As for the update, a couple of minor issues that I noticed:
1. The issue with autocompletion (dialog closing) doesn't seem to be fixed for me (tried these commands: addonFiles and player)
2. {  and } and | and \ are missing from the list of operators. Also AFAIK we don't have "?" in Arma!

Also, I'd like to make a request. Can you please add the magic variables to the autocompletion list as well?

Share this post


Link to post
Share on other sites
1 hour ago, Leopard20 said:

I got em from the wiki. But there's a command called 'utils 5' that you can run in the game. Gives you the full list of commands. I don't recall if you can copy them or not (some utils did have that feature).

 

A couple of minor issues I noticed:
1. The issue with autocompletion (dialog closing) doesn't seem to be fixed for me (tried these commands: addonFiles and player)
2. {  and } and | and \ are missing from the list of operators. Also AFAIK we don't have "?" in Arma!

3. Also, I'd like to make a request. Can you please add the magic variables to the autocompletion list as well?

 

Interesting, will take a look. I did that after v~1.4x.xx and was then gradually adding commands according to introduced with patch 1.xx articles on biki but apparently that wasn't containing everything every time.

 

1. Did you find any other command bugging out? Because for me, all other that I tried work fine but for addonFiles the dialogue indeed stops working after 'n'. I suspect it has something to do with font case despite having ignore case flag. This is a problem with older versions of SQF auto-completion as well, so most likely some sort of issue with N++ itself as I see no logical reason why it wouldn't work.

Although, autocomp is not 100% bullet proof in general. When you backspace characters and continue from the middle, that sort of thing, it doesn't always behave as one would expect.

 

2. { and } are included in Folding in code 1 entries, under Folder & Default tab. ?, yeah, that's probably from sqs...

 

3. Sure!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×