AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [TUT] Compiling AMXX plugins with Notepad++ (https://forums.alliedmods.net/showthread.php?t=292638)

OciXCrom 01-10-2017 13:51

[TUT] Compiling AMXX plugins with Notepad++
 
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.

http://i.imgur.com/iUdSeFx.jpg

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.

http://i.imgur.com/xzwldTn.jpg

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.

http://i.imgur.com/5nXSUt2.jpg

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.

http://i.imgur.com/UpL99uV.jpg

Depresie 01-10-2017 15:42

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Nice tut, thanks !

meTaLiCroSS 01-10-2017 18:32

Re: [TUT] Compiling AMXX plugins with Notepad++
 
https://forums.alliedmods.net/showthread.php?t=118119

OciXCrom 01-10-2017 18:52

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by meTaLiCroSS (Post 2485382)

It's totally different, even though it does the same thing. Another tutorial won't hurt anyone.

fysiks 01-10-2017 19:50

Re: [TUT] Compiling AMXX plugins with Notepad++
 
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.

meTaLiCroSS 01-10-2017 20:44

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by OciXCrom (Post 2485387)
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.

OciXCrom 01-14-2017 10:22

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by fysiks (Post 2485406)
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 (Post 2485422)
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".

fysiks 01-14-2017 14:44

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by OciXCrom (Post 2486464)
- 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).

edon1337 01-14-2017 15:15

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by fysiks (Post 2486521)
and a little about why I prefer my method;

Everyone prefers their own methods, isn't it obvious lol.

meTaLiCroSS 01-15-2017 02:26

Re: [TUT] Compiling AMXX plugins with Notepad++
 
Quote:

Originally Posted by edon1337 (Post 2486537)
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.


All times are GMT -4. The time now is 19:52.

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