Jump to content
latheesan

NPC Script Editor

Recommended Posts

Hi,

 

NPC Script Editor is an easy to use & feature packed NPC Script Editor for ROemulator(s).

 

Download Latest Version

 

NPC Script Editor r600

 

Features

  • NPC Script Syntax Highlighting
  • Standard functionalities you'd expect of a editor (file, open, print etc...)
  • Fully implemented Find & Replace (Ctrl + F / Ctrl + H) with Go To (Ctrl + G) functions
  • Quick Find & Highlight
  • Tabbed Editor
  • Tab Docking
  • Open-Source & Easy To Use Plugin System - sample "Hello World" project in "Plugins" folder (VS2012 C# .NET)
  • Auto-Suggest/Complete
  • Code Folding
  • Markers / Bookmarks
  • NPC Script Commands Bible - Free Plugin
  • Text Translator - Free Plugin
  • Snippets - coming soon
     

Hotkeys
 

Ctrl + W = Close Current Tab
Ctrl + Tab = Next Tab (Cycle Forward)
Ctrl + Shift + Tab = Prev Tab (Cycle Back)
Ctrl + N (1 ~ 9) = Opens Nth Opened Tab (e.g. Ctrl + 2 will open 2nd open tab)
Ctrl + Space = Show auto-suggest/complete for the script command you are typing
F1 = Select text in editor and press F1 to open NPC Script Command Bible plugin
F2 = Select text in editor and press F2 to open Text Translator plugin

 

What's New in Version v1.0.0.600
  • [*]Fixed bug with plugin service which initialized the plugin twice (slowed the app launch, now it's much better) [*]Updated plugin interface - the Initialize() method must take a string parameter (SelectionQuery) [*]Sample "Hello World" sample plugin (VS2012 C# .NET) now comes shipped with each new release - check "Plugins" folder [*]The NSE will now remember your last window position, size and monitor number (Resets with each new release) [*]Now you can open npc script file by dragging & dropping them into editor [*]NPC Script Command Bible Plugin will load custom
    "script_commands.txt" file (if it's found in "Plugins" dir) - otherwise
    it defaults to built-in resource file on the DLL. [*]Ctrl + W = Close Current Tab [*]Ctrl + Tab = Next Tab (Cycle Forward) [*]Ctrl + Shift + Tab = Prev Tab (Cycle Back) [*]Ctrl + N (1 ~ 9) = Opens Nth Opened Tab (e.g. Ctrl + 2 will open 2nd open tab) [*]Ctrl + Space = Show auto-suggest/complete for the script command you are typing [*]F1 = Select text in editor and press F1 to open NPC Script Command Bible plugin [*]F2 = Select text in editor and press F2 to open Text Translator plugin [*]Implemented F6 Hotkey = Parse Current NPC Script To Output Window and shows any syntax / coding errors [*]OutputWindow cannot be closed, and it starts hidden now [*]Improved OutputWindow handling code [*]OutputWindow now launches in hidden mode, and reveals itself on F6 keypress (if hidden) [*]Fixed Tab Order/Stop in Core Plugins [*]NPCScriptCommandsBible Plugin no longer uses internal script_commands.txt [*]script_commands.txt is converted to Windows EOL automatically before parsing - no need to manually convert it now [*]Re-Written NPCScriptCommandsBible Plugin's script_commands.txt Parser [*]Plugin Code Optimized [*]Fixed unnecessary trailing space with command info parsing - NPCScriptCommandsBible [*]Enabled word wrap and forced vertical scroll bar - NPCScriptCommandsBible [*]F1 hotkey now guesses the word at caret position (if a selection wasn't there) [*]New script file(s) that are opened now automatically converted to CRLF (EOL) [*]Fixed minor bug with F1 Guess Word At Caret function [*]Fully Implemented "Open Recent" (History) Feature [*]U.I Improvement - If the same file is already opened, that tab window is shown instead of opening the same file twice (or more) [*]Enabled brace matching [*]Fixed Minor Bug With Start-Up Sequence [*]Fixed crash bug with opening files with the editor [*]Removed Global Hotkey and replaced with application level hotkey feature

 

Demo
 

nx3xCb7.png

 

Y0e4EXA.png
 

DZdmsmM.png

 

oaLur7E.png

 

veL5Rmb.png

 

Thanks for trying my editor.
Any comments and feedback would be much appreciated.

NPC Script Editor r314.zip

Edited by latheesan

Share this post


Link to post
Share on other sites

Thanks guys. A new version was just released - first post updated.

 

What's New in Version v1.0.0.314
 

 

 

  Fixed bug with plugin service which initialized the plugin twice (slowed the app launch, now it's much better)
  Updated plugin interface - the Initialize() method must take a string parameter (SelectionQuery)
  Sample "Hello World" plugin (VS2012 C# .NET) now comes shipped with each new release - check "Plugins" folder
  The NSE will now remember your last window position, size and monitor number (Resets with each new release)
  Now you can open npc script file by dragging & dropping them into editor
  NPC Script Command Bible Plugin will load custom "script_commands.txt" file (if it's found in "Plugins" dir) - otherwise it defaults to built-in resource file on the DLL.
  Saving new files now default to *.txt
  Ctrl + W = Close Current Tab
  Ctrl + Tab = Next Tab (Cycle Forward)
  Ctrl + Shift + Tab = Prev Tab (Cycle Back)
  Ctrl + N (1 ~ 9) = Opens Nth Opened Tab (e.g. Ctrl + 2 will open 2nd open tab)
  Ctrl + Space = Show auto-suggest/complete for the script command you are typing
  F1 = Select text in editor and press F1 to open NPC Script Command Bible plugin
  F2 = Select text in editor and press F2 to open Text Translator plugin
Edited by latheesan

Share this post


Link to post
Share on other sites

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

Share this post


Link to post
Share on other sites

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

+1 

Share this post


Link to post
Share on other sites

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

 

Yea... I have been trying to do this since forever T_T

 

Unfortunetly I code in .NET C# so I don't quite understand how to take the src for rAthena/Hercules written in C++ and make a utility/function out of it. Ideally, i want to take the content of the editor tab and pass it a function which utilizes the script parser and give me validation responses. If someone help me figure that out, i can implement this into NSE in a heart beat :D

Share this post


Link to post
Share on other sites

 

Unfortunetly I code in .NET C# so I don't quite understand how to take the src for rAthena/Hercules written in C++ and make a utility/function out of it.

just take the basic functionality like mes,next,close and etc..and disregard some commands where its not feasible in the current setup....

 

:meow:

Share this post


Link to post
Share on other sites

just take the basic functionality like mes,next,close and etc..and disregard some commands where its not feasible in the current setup....

 

:meow:

 

Me and Yommy is comming up with a way to do just this. We hope to have a basic working script parser built into the NSE for the next release.

Share this post


Link to post
Share on other sites

Hi everyone,

 

I am back from my long break. I have now completed the script parsing / checking functionality within NPC Script Editor.

 

I got in touch with Ind from Hercules emu few months ago to discuss the posibility of using the script parsing functionality that is already inside map-server as a stand alone feature and one of the developer came up with this: https://github.com/HerculesWS/Hercules/pull/217

 

This
special edition of map-server_sql.exe (compiled from Hercules emu) is
now integrated with NPC Script Editor. Here is how it looks like:

 

When you are editing a script, press F6 to parse and synctax check the script you are working with. Any errors are reported like this:

RlWBRIY.png

 

If you've fixed the error and pressed F6 again, it will highlight the next problem, etc...

 

lI0OAWe.png

 

Now
you can work on NPC Scripts and not have to load it into the live/test
server to see if any syntax/coding error are in there. Hopefully this
will speed up everyone's NPC Scripting.

 

I am
currently working on packaging this as a standalone installer and hope
to have it released soon. This new build comes with new bug fixes and
improvements also.

Share this post


Link to post
Share on other sites

Mob and item are directly parsed from respective db. The aegis names are the mob/item constants.

Npc constants are parsed from db/const.txt

Share this post


Link to post
Share on other sites

 

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

+1 

hello Friend Jedzkie

 

1 question are you using this one?

 

can you teach me how to used this? ^_^ its really nice work from latheesan :D

Share this post


Link to post
Share on other sites

 

 

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

+1 

hello Friend Jedzkie

 

1 question are you using this one?

 

can you teach me how to used this? ^_^ its really nice work from latheesan :D

 

Nope. and FYI, we are not friends.

Share this post


Link to post
Share on other sites

 

 

 

wow very nice tool almost complete... ;)

I wish it has a capability of a compiler(where it checks the validity of the script) and a simulator where you can test the script like in-game interaction

 

:meow:

+1 

hello Friend Jedzkie

 

1 question are you using this one?

 

can you teach me how to used this? ^_^ its really nice work from latheesan :D

 

Nope. and FYI, we are not friends.

:(

Share this post


Link to post
Share on other sites

Heya,

 

Would it possible to add these features?

  • Adding "To lowercase" and "To UPPERCASE" in the context menu when right-clicking some text would be more practical than using the menus!
  • Adding "Add text color" in the context menu when right-clicking on some text, this would simply add "^000000" at the beginning and end of the selected text.
  • Turn on whole word highlighting (when the caret is on a whole word, it is very useful to highlight all other whole word matches).
  • Volatil searches. When a word is highlighted (from the whole word highlighting), being able to jump to the next or the previous element is very useful. The shortcut in Notepad++ is Ctrl-F3 for the next element and Ctrl-Shift-F3 for the previous element. In VS, the shortcut is Ctrl-Shift-Up and Ctrl-Shift-Down.
  • Be able to leave autocomplete always turned on and activates as you type.
  • Other useful shortcuts to have :

Alt-Up / Alt-Down, moves the selected lines up or down. If no text is seleted, it moves the current line.

Shift-Delete, deletes the current line and copy it to the clipboard (or Ctrl-L in Notepad++).

Ctrl-C with no text selected, copies the current line to the clipboard.

Ctrl-X with no text selected, copies the current line to the clipbard and removes it.

Ctrl-K, comment the selected lines.

Ctrl-Shift-K, uncomment the selected lines.

F3, while a search is active, goes to next element. (This is conflicting with Scintilla's default find and replace dialog though, not really important I guess).

Shift-F3, while a search is active, goes to previous element.

Ctrl-U, change the selected text to lower case. Shortcut already exists, never mind.

Ctrl-Shift-U, change the selected text to upper case.

  • Add/replace code snippets : 

f =>

for ($.@i$ = $0$; $.@i$ < $max$; $.@i$++) {	$selected$$end$}

w =>

while ($1$) {	$selected$$end$}

sc / script =>

$map$,$x$,$y$,$direction$	script	$name$	$SPRITE$,{	$selected$$end$}

func =>

function	script	$name$	{	$selected$$end$}

hid (could probably use another name I guess) =>

-	script	$NAME$	-1,{	$selected$$end$}

menu =>

switch(select("$menu$")) {	case 1:		$selected$$end$		break;}

dup =>

$map$,$x$,$y$,$direction$	duplicate($name$)	$name$#$tag$	$SPRITE$$selected$$end$

 

Could probably add more snippets, but these are the only ones that come to mind at the moment xD! It would be even better if we could make our own, they're really a time saver. If you're not familiar with snippets, they are used by typing the first letters (func for example) and then pressing tab. It will autocomplete the rest. There is already one for "f" but it's obviously meant for C++ autocompletion code.

 

And also, when you press Enter, it would be nice if it could use the previous indent (or use indent + 1 if the line ends with { ) to start the new line instead of starting back at the beginning. This is probably the most important feature in all of this, it is somewhat annoying to add the tabs everytime you add a new line.

 

Thank you for this amazing tool btw ;]!

Edited by Tokeiburu

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.