View Single Post
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-18-2018 , 13:28   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #79

Is it possible for me to set up multiple compilers? What I mean is, I have multiple servers using 1.8.2, 1.8.3, ReHLDS and other AMXX versions and I always compile my plugins on all of them to see if any errors will pop up. I used to be able to easily switch between different compilers in Notepad++, but I can't find such an option here.
With my version, you can build them all at once, or compile them individually one by one.
Here I will explain how to build them all at once.

To do it, you need to open your user folder on `Packages/User/Amxmodx`.
On this directory, you will find the compiling scripts. If you are using the Windows .bat compiler:
  1. You need to rename the file `AmxxPawn.bat` to `AmxxReHLDS.bat` (new name example)
  2. Then on the file `AmxxReHLDS.bat` file you configure the ReHLDS compiler.
  3. Now if you want to setup another compiler, duplicate the file `AmxxReHLDS.bat` and call it `AmxxHLDS.bat` (new name example)
  4. Then on the file `AmxxHLDS.bat` file you configure the HLDS normal compiler.
  5. You can keep repeating the steps 3 and 4 until if finishing configuring all your compilers.
  6. Now, lastly, you need to create a new empty `AmxxPawn.bat` file, with the following code as content:
    CALL AmxxHLDS.bat    %1 %2 %3 %4 CALL AmxxReHLDS.bat  %1 %2 %3 %4 CALL AmxxAnother.bat %1 %2 %3 %4
  7. This will run all the compilers when you call to run the windows .bat compiler.

If you would like to run them individually, like only the `AmxxHLDS.bat` or `AmxxReHLDS.bat`,
you need to create a new build file configuration for Sublime Text.

To do it, just create this file `MyCustomBuild.sublime-build` anywhere you like inside the Sublime Text `Packages` folder.
I would recommended, for organization, for you to create this file on the folder `Packages/User/Amxmodx` (with the other scripts).

This would be the contents of the file:
{     "working_dir": "$file_path",     "cmd": ["$packages/User/Amxmodx/AmxxHLDS.bat","$file", "$file_base_name", "$packages", "$file_path"],     // "target": "ansi_color_build",     "syntax": "Packages/Amxmodx/AmxmodxConsole.sublime-syntax",     "variants":     [         {             "name": "AmxxReHLDS.bat",             "cmd": ["$packages/User/Amxmodx/AmxxReHLDS.bat","$file", "$file_base_name", "$packages", "$file_path"],         },         {             "name": "AmxxAnother.bat",             "cmd": ["$packages/User/Amxmodx/AmxxAnother.bat","$file", "$file_base_name", "$packages", "$file_path"],         },     ],     "selector": "source.AmxxPawn, source.AMXX, source.sma",     "file_regex": "^.*[\\/\\\\]+(.+)\\(([0-9]+ ?.*)\\) : (.*)", }

Then, when you press `Ctrl+Shift+B` on an Amxx file, and Sublime Text would ask you which build file you would like to use:

Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!

Last edited by addons_zz; 07-18-2018 at 13:33.
addons_zz is offline