Raised This Month: $12 Target: $400
 3% 

[TUT] Compiling AMXX plugins with Notepad++


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2017 , 13:51   [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #1

I'm sure that most of you are sick of dragging and dropping their .sma files in compile.exe, finding the compiled .amxx file and adding it in the plugins folder. All of this can be done automatically with the click of just one button.

For this you will need Notepad++ and of course a server platform with a working amxxpc.exe file. Follow these steps in order to configure Notepad++ to work with the compiler:

____________________________________________

Step #1: Open Notepad++ and click on Plugins => Plugin Manager => Show Plugin Manager.

Step #2: In the window that just popped up, click on the Available tab. Find the plugin NppExec and install it. If you can't find it in the list, it's probably already installed and you should continue to Step #3.

Step #3: Open Notepad++ and click on Run => Modify Shortcut/Delete Command.



Step #4: Go to Plugin Commands and find the Execute and Direct Execute Previous fields. The first field sets the button that will open the compile menu and the second one is the button for direct compile. I suggest you set F9 for the direct compile and Ctrl+F9 for the menu. You will find Show Console Dialog under these two fields, which is used for toggling the console and hiding it after the compilation is complete. My suggestion for this shortcut is the Escape button.



Step #5: Hit the menu button (previously suggested as Ctrl+F9). A window will pop up where you need to insert the following code:

PHP Code:
SET compiler E:\OciXCrom\Servers\My Cool Server\cstrike\addons\amxmodx\scripting\amxxpc.exe
SET 
include = E:\OciXCrom\Servers\My Cool Server\cstrike\addons\amxmodx\scripting\include
SET output E:\OciXCrom\Servers\My Cool Server\cstrike\addons\amxmodx\plugins\$(NAME_PART).amxx

NPP_SAVE
"$(compiler)" -i"$(include)" -o"$(output)" "$(FULL_CURRENT_PATH)" 
Of course, the upper example shows my configuration, so you will need to change the path to every single required file. The first line shows the location of amxxpc.exe, the second one is the folder with the .inc files and the third one is the folder where the compiled .amxx files will be saved.

After you added the code, hit Save.



Step #6: Now the configuration is complete and you can compile your plugins when you hit the compile button (I have it on F9). The compile information will be shown in the console down below.

__________________

Last edited by OciXCrom; 01-14-2017 at 10:21.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-10-2017 , 15:42   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #2

Nice tut, thanks !
__________________
Depresie is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 01-10-2017 , 18:32   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?t=118119
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2017 , 18:52   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #4

Quote:
Originally Posted by meTaLiCroSS View Post
It's totally different, even though it does the same thing. Another tutorial won't hurt anyone.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-10-2017 , 19:50   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #5

As far as I can tell, the differences are:
  • You can't compile a plugin based on the file's location. I.e. All your plugins will be compiled using the same includes and compiler and places the .amxx file in the same location regardless of where your source code is.

    In the first example of my thread, it allows me to compile plugins for the server in which I'm currently editing (useful when writing plugins for multiple types of server or servers that you want segregated). The method shown in the thread is more like the second example in my thread.
  • The console output is inside of Notepad++ (something I don't like; it takes up too much room; when I need to know what other errors there are to fix, I simply compile again, especially useful when errors are cascading).
  • It requires a non-standard plugin (I couldn't find the option that is referenced above). If it is truly a non-standard plugin as I expect, you should clearly state it as a prerequisite.
__________________

Last edited by fysiks; 01-10-2017 at 21:04.
fysiks is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 01-10-2017 , 20:44   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
It's totally different, even though it does the same thing. Another tutorial won't hurt anyone.
Who's saying that? I'm just adding that link, you may be interested in knowing another ways to do it.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-14-2017 , 10:22   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
As far as I can tell, the differences are:
  • You can't compile a plugin based on the file's location. I.e. All your plugins will be compiled using the same includes and compiler and places the .amxx file in the same location regardless of where your source code is.

    In the first example of my thread, it allows me to compile plugins for the server in which I'm currently editing (useful when writing plugins for multiple types of server or servers that you want segregated). The method shown in the thread is more like the second example in my thread.
  • The console output is inside of Notepad++ (something I don't like; it takes up too much room; when I need to know what other errors there are to fix, I simply compile again, especially useful when errors are cascading).
  • It requires a non-standard plugin (I couldn't find the option that is referenced above). If it is truly a non-standard plugin as I expect, you should clearly state it as a prerequisite.
- In my opinion, compiling the plugins in a predefined location is much better than putting them where the .sma file is. I have a bunch of different platforms on my computer, and when I want to transfer a plugin from one platform to another, I simply compile that plugin with the other platform's settings, instead of having to open that folder and copy the .sma file there. So, I can't say that's a disadvantage.

- About the plugin - I already had the plugin installed before I did this, so I totally forgot that it requires one. I edited my post.

Quote:
Originally Posted by meTaLiCroSS View Post
Who's saying that? I'm just adding that link, you may be interested in knowing another ways to do it.
Well, usually posting a link to another thread in a tutorial and not saying anything by default means "this already exists, your topic is useless".
__________________

Last edited by OciXCrom; 01-14-2017 at 10:24.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-14-2017 , 14:44   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
- In my opinion, compiling the plugins in a predefined location is much better than putting them where the .sma file is. I have a bunch of different platforms on my computer, and when I want to transfer a plugin from one platform to another, I simply compile that plugin with the other platform's settings, instead of having to open that folder and copy the .sma file there. So, I can't say that's a disadvantage.
I didn't say that mine was better. I was just stating the difference (and a little about why I prefer my method; the parts that are my opinion are obvious in my post).

To clarify, mine doesn't put the .amxx file where the .sma file is located. I said that it puts it in a location based on the .sma location i.e. it puts it in the plugin folder of the AMX Mod X installation in which the .sma file resides (assuming it's in the scripting folder). I never have to copy a .amxx file anywhere (with the exception of FTP to a remote server).
__________________

Last edited by fysiks; 01-14-2017 at 14:45.
fysiks is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-14-2017 , 15:15   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
and a little about why I prefer my method;
Everyone prefers their own methods, isn't it obvious lol.
__________________
edon1337 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 01-15-2017 , 02:26   Re: [TUT] Compiling AMXX plugins with Notepad++
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
Everyone prefers their own methods, isn't it obvious lol.
fysiks's method is based on letting user choose his file output method. Actually, topic author explained just 1 way and arguing about why just showed that, which isn't the best way to deal with because you're not thinking on users preferences or variety itself.

In my case, I prefer letting the output in sma file's folder. And I didn't think on adding nppexec plugin, so I will give it a try now.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode