OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: i0n0s on 14 Jan 2009, 01:43:08

Title: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 14 Jan 2009, 01:43:08
Since notepad++ is a useful tool for programming, but sadly it didn't have support for SQF. My problem solves this by adding a lexer for SQF and adds support for folding.

Just take a look at the attached "ArmAScript.png" for details.
Additional function will get highlighted with different colors depending on the effect and the locality of the parameter.

Also a hint with displays should be displayed when hovering about a word.

In the plugin menu, you're able to set folding-settings. Additional you can introduce the private variables either on the hole document or within a selection. Sadly this is limited since it ignores scopes and existing private-statements. Nevertheless it is very useful :)

How to install:
If you are clever and have installed N++ in local mode, you can simple copy the content either of the ansi or the unicode folder into the plugin folder.
If installed globally, the content of the Config folder belongs to $APPDATA\Notepad++\plugins\config. The rest stays the same as when having it installed locally.

Changelog:
1.01:
*Fixed call tips
*Added auto indentation

1.02:
*Strings can float lines
*Styling of global and local variables possible

1.03:
*Removed version warning
*Corrected "introduce private statement"
*Autoindent will get saved over sessions
*Added "hint "variable""
*Added ability to disable call tips

Get ArmA Script Notepad++ plugin v1.03 (http://www.ofpec.com/ed_depot/index.php?action=details&id=596)
Title: Re: ArmAScript - A notepad++ plugin
Post by: hoz on 14 Jan 2009, 01:53:44
awesome I use Notepad ++ testing it out
Title: Re: ArmAScript - A notepad++ plugin
Post by: johnnyboy on 14 Jan 2009, 05:45:28
Brilliant Iionos!  Thanks man, Notepad++ is a great tool, and now its Arma-fied!  I just tried it out, and it works great.  :clap:  The coloring is very helpful, and general NotePad smarts of brace pairing etc. is very useful.

Under the Plugins menu, I see ArmaScript with many options (fold, introduce, indentation) etc., but I can't figure out how to use them.  Any hints on this?
Title: Re: ArmAScript - A notepad++ plugin
Post by: i0n0s on 14 Jan 2009, 12:18:26
"Introduce private-statement":
Place the cursor at the line, where you one to have the private statement to be placed. Then press the button.

"Introduce private-statement (selection)":
Select the code in which the local variables should get collected, then click the button. The private statement will get inserted at the beginning of the selection.

"Create intendation": (*sick*, typo :( )
The current active document will get indented automatic (when displayed as SQF).
So
Code: [Select]
_check = true;
{
if (_x select 0 == _display) exitWith {
throw "Display is already registered";
_check = false;
};
} forEach ION_DSM_Displays;
will be converted to:
Code: [Select]
_check = true;
{
if (_x select 0 == _display) exitWith {
throw "Display is already registered";
_check = false;
};
} forEach ION_DSM_Displays;

The settings are for the folding.
When having "fold preprocessor" active, you can fold
Code: [Select]
#ifdef
   Bla
#endif
"fold comment" allows to fold the /* */ comment structure.
"fold arrays" allows to fold arrays ( [ ] ).
"fold compact" will hide blank lines after folded code.
"fold at else" will at a fold point to the else, so you can fold the 'then' part or the 'else' part and are not forced to fold the complete if-statement.
Title: Re: ArmAScript - A notepad++ plugin
Post by: Trexian on 14 Jan 2009, 21:46:49
Ah!  I found a NP++ plugin a long time ago and have been using it.

http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=71;t=58206

Will certainly give yours a try, too.

Title: Re: ArmAScript - A notepad++ plugin
Post by: i0n0s on 16 Jan 2009, 12:47:01
Updated to 1.01:
The call tips should now work independent which view is used.
I also added a "auto indentation" feature which automatic indent when encountering a '{' and '}'. You can enabled or disabled this feature in the plugin menu.
Title: Re: ArmAScript - A notepad++ plugin
Post by: Xeno on 16 Jan 2009, 19:46:52
Thanks for finally making it public, iOnOs (am allready using it a little bit longer and it is just great).

Xeno
Title: Re: ArmAScript - A notepad++ plugin
Post by: hoz on 16 Jan 2009, 19:48:34
It is very handy. I'll add it up in the ED later this evening.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 22 Jan 2009, 22:43:58
Thanks for adding to the ED.

I've got an update:
*Strings now float over lines. So this string will get highlighted correctly:
Code: [Select]
_ctrl ctrlSetEventHandler ["MouseButtonDown", format ["
if (_this select 1 == 0) then {
(ION_DSM_Dialog select %1) set [9, true];
(ION_DSM_Dialog select %1 select 10) set [0, _this select 2];
(ION_DSM_Dialog select %1 select 10) set [1, _this select 3];
};", _element]];
*Added styling possibility for global and local variables.
Use Settings->Styler Configuration to change the color.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Trexian on 23 Jan 2009, 18:22:28
VERY nice.  Has now replaced that other version I was using.   :good:

Absolutely LOVE the make-private-selection plugin.   :clap:
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: hoz on 23 Jan 2009, 18:48:59
I've updated the OFPEC Download to version 1.02
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Trexian on 24 Jan 2009, 00:23:09
Heya i0n0s,

Very pleased with this.  In using it, I had an idea similar to your make-private-list function.  Any way to select a variable then in the line below the one selected, have it create a line:

hint format [" *variable name without the underscore* = %1", *variablename*];
sleep 1;

Or something like that? :)
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 24 Jan 2009, 01:57:00
Would be possible.
So you have the cursor in a variable, then you select the action.
The next step would be that I create a new line, then enters:
Code: [Select]
hint format ["$1 = %1", $1"];where $1 is the variable.
Would be easy to implement. Any more ideas?
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Trexian on 24 Jan 2009, 17:27:46
Not yet, but I'll try to think of something.... :)

I find it very thorough already.  LOVE the hints. Is there an option to turn them off?  At this point, I wouldn't want to, but someone else might.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 10 Feb 2009, 16:26:19
Updated to 1.03

No, I haven't forgotten lightAttachObject..., Notepad++ 5.2 changed its version number style and therefore the previous version complains about a too old version.

I also changed the "introduce private statement" functions. It didn't catch all local variables, variables with more than one '_' weren't detected. Also the private statement will get the right indentation level.

You can now disable the call tips and I've added Trexians request.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: kju on 10 Feb 2009, 20:03:38
Thanks for the update i0n0s  :good:

I am very sorry for having posted the review of mine so far.  :confused:
So much different stuff I am doing right now - especially Roller and ACEIP v1.1 are meant to be out finally.

I was/am digging into NP++ to see how to make it as useful as possible for arma editing.
So far I have checked a lot of great features it offers, added several apps and urls with params to launch from within NP++, as well as reviewing all the interesting features and their key assignments.
Code templates are next on my list. Yet I still need to adapt to NP++ and use it for some time on arma
projects to get a good feel for it and how to use it best.

Anyways, hopefully I am done soon to share the review of NP++ along with the great review of you!
It will be part of the Community Modding Bible project I am working on as well.  :)
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Rommel92 on 14 Feb 2009, 07:41:32
I've downloaded this about four times now, each time it finishes, then mentions its corrupt. Perhaps another mirror please? I've used it before and it ran fine, but now I can't re-download it.  :o
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Mandoble on 14 Feb 2009, 10:46:07
It downloads and open fine for me.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Rommel92 on 14 Feb 2009, 23:55:26
Works fine now. Ah well thanks for the reply, maybe it just needed a nights rest.  :confused:

edit: "Datei nicht gefunden ArmAscript.xml" is the error I get when I load up the plugin in the latest NPP (5.2)
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 15 Feb 2009, 00:24:01
Missing translation O:-)
"File not found: ArmAScript.xml".
The ArmAScript.xml has to be placed within the config-folder. Either in Plugins/Config or in %APPDATA%\Notepad++\Config.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Spooner on 04 Mar 2009, 15:00:20
Although I can open the zip with 7z, it is unreadable by Windows Explorer (Vista x64).
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 04 Mar 2009, 17:30:38
The file was a rar-archive with zip-extension :x
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Spooner on 04 Mar 2009, 18:36:59
It is now a ZIP format with .rar extension, but that means it will open with explorer, making it more accessible! Yes, really (ok, this needs fixing!).

Edit by i0n0s:
Fixed
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: i0n0s on 11 Mar 2009, 01:51:18
"Update":
*Removed marker for changed lines since added to N++ 5.3 RC

First external lexer, then auto complete and now this feature...
Next step will be SQF highlighting without an addon ;)

Notepad++ 5.3 RC (http://sourceforge.net/forum/message.php?msg_id=6700303)
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: kju on 11 Mar 2009, 07:33:03
Quote
> ... is that the Line change state doesn't follow Undo-Redo actions accurately, ...
 
Yes I know it. This feature is experimental, and still buggy - I wonder if it's worth to include it in the release. But since I spent time to implement it, I would like to know what people think about it.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Dwinar on 10 Jul 2010, 19:54:26
It would be cool if someone could take care of dead links such as this... :blink:
This tool looks cool but I can't download it because link of the download is dead as always...
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Tora on 10 Jul 2010, 21:30:35
Version 5.7 Notepad++

http://download.cnet.com/Notepad/3000-2352_4-10327521.html (http://download.cnet.com/Notepad/3000-2352_4-10327521.html)

Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Dwinar on 10 Jul 2010, 21:33:30
Sorry but the title says "notepad++ *plugin*" I thought it's about the you know... the plugin for notepad++ that highlight the sqs/sqf syntaxes. I guess I was wrong I'm sorry.

Edit:
@Down
Ok, no problem. Someone should just remove this thread from site as it is dead.
Title: Re: ArmAScript - A notepad++ plugin (ACCEPTED)
Post by: Tora on 10 Jul 2010, 21:36:06
The link for Notepad was dead, too.  (Thought that was what you meant)-I edited my first post so it didn't sound so "snippy" - Sorry for the confusion...

Here are the other links:

http://arma.jonasscholz.de/files/ArmA%20Script%20Recoded.7z (http://arma.jonasscholz.de/files/ArmA%20Script%20Recoded.7z) - for ARMA 2
http://arma.jonasscholz.de/files/ArmAScript.rar (http://arma.jonasscholz.de/files/ArmAScript.rar) - for ARMA