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

[TUT] Compiling AMXX plugins with Sublime Text


Post New Thread Reply   
 
Thread Tools Display Modes
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-29-2017 , 10:29   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #71

I got couple suggestions, could you automate this ? so it won't be required to click and select it manually every time ?
https://forums.alliedmods.net/showpo...1&postcount=28

Also, any new themes ? ^_^
__________________
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-29-2017 , 12:14   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #72

Quote:
Originally Posted by Depresie View Post
could you automate this ? so it won't be required to click and select it manually every time ?
If you want to change the default color scheme for new files, you need to edit the amxmodx package's settings:



And change the `"amxx_file_syntax": "Packages/Amxx Pawn/AmxxPawn.sublime-syntax",` setting to point to the syntax you would like as default.

Quote:
Originally Posted by Depresie View Post
Also, any new themes ? ^_^
I always use the same theme & color scheme for everything, so I never work on other themes other than improving the one I use.

But you can search on package control channel for other themes & color schemes. On this link there is a list of several other themes & color schemes you can install:
  1. https://packagecontrol.io/browse/labels/color scheme
  2. https://packagecontrol.io/browse/labels/theme

To install any of them, just press `Ctrl+Shift+P` (or go to the menu `Preferences -> Package Control`) and type `install` and select `Package Control: Install Package`, then type the name of the theme or color scheme you want to install:



Then to activate the theme or color scheme, go to the menu `Preferences -> Color Scheme...` or `Preferences -> Theme...`:



You can also customize the color scheme/theme if you want to, but you will need to study a little on how to do it.

My syntax for pawn `Amxx Pawn/AmxxPawn` is not much friendly with other color schemes other than mine, so you can try to use the @destro syntax `amxmodx/AMXX-Pawn`, if the colors are not quite right. Perhaps some day I can review my syntax to make it more friendly to other colors schemes. But for now I am working on other things, as automatically update everything, so when I release a new version here, you can get the update automatically.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 09-29-2017 at 12:17.
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-25-2017 , 12:39   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #73

Released the new major version.
HTML Code:
v2.0.0 | 2017-10-25
 * Installed the Amxx Simple IDE (Amx Mod X) by the AmxxChannel.
 * Deprecated the `Default/Main.sublime-menu` overriding.
With this, now it can update itself automatically, so you only need to install this once, and it will always get updates automatically. You can disable the automatic updates if you like, just to the menu `Preferences -> Packages Settings -> Package Control -> Settings - User`, then add this key to the setting file:
Code:
    "auto_upgrade": false,

On this release the full Sublime Text menu is back. If you like to use the reduced menu, you can download the file `Main.zip` attached at this post and unpack it on the `User` folder `OverrideUnpackedPackages/Default` and restart Sublime Text. After a few seconds the new menus are going to be installed:
Spoiler

You can find the `User` folder by going on the menu `Preferences -> Browse Package...`, then you can find the user folder on your screen:
Spoiler
Attached Files
File Type: zip Main.zip (1.4 KB, 92 views)
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 10-25-2017 at 12:40.
addons_zz is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-05-2017 , 03:52   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #74

Nice, but i found something, i don't know if it is intended or if it is a bug
When you include libraries ( #include <cstrike> ) the auto completion doesn't work until the file is saved, also after removing the library the auto completion will still work until the file is saved
__________________

Last edited by Depresie; 11-05-2017 at 03:52.
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 11-05-2017 , 19:03   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #75

The file includes are only being parsed when the file is saved because it was implemented like this to more lightweight. The other option would be to always keep parsing the file looking for new includes.

It think it could be implemented to always be parsing the file looking for includes, but I am not sure about the performance impact. I think would be better to abandon this autocomple and try to work with a general autocompleter which can work with all languages.

For now I am not working with it, and I am not sure when I would start looking for this universal autocompleter. There are few project running like https://github.com/SublimeCodeIntel/SublimeCodeIntel and https://github.com/Microsoft/language-server-protocol
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-13-2018 , 15:14   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #76

Auto-completion is not working.
__________________








CrazY. is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 02-13-2018 , 15:49   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #77

What are the contents of your settings and console? Did you set the amxx compiler path?
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-15-2018 , 08:59   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #78

Code:
{
    // Path to includes folder, the files here will be used for auto completion.
    "include_directory": "C:\\Program Files\\Counter-Strike 1.6\\cstrike\\addons\\amxmodx\\scripting\\include",

    // ( true / false ) Enable the parameters addition when auto completing.
    "add_function_parameters": true,

    // ( true / false ) Enable IntelTip PopUp
    "enable_inteltip": true,

    // ( true / false ) Enable Auto-Increment Build/Version
    "enable_buildversion": false,

    // ( true / false ) Enable auto completing functions and global variables from the current file.
    // If you change this setting, you need to restart Sublime Text before it can take effect.
    "function_autocomplete": true,

    // ( true / false ) Enable auto completing words from the current file.
    "word_autocomplete": true,

    // Enable editor debug messages, see the file `amxmodx/AMXXEditor.py` for all debugging levels.
    //
    // 0 - Disabled debugging.
    // 1 - Errors messages.
    "debug_level": 1,

    // ( color name ) Set color scheme ( dark / twlight / atomic / white / npp )
    "color_scheme": "dark",

    // The new file syntax when using the menu `Amx Mod X -> New Plug-in`. Possible values are:
    //
    // "Packages/Amxx Pawn/AmxxPawn.sublime-syntax"
    // "Packages/amxmodx/AMXX-Pawn.sublime-syntax"
    //
    "amxx_file_syntax": "Packages/AmxxPawn/AMXX-Pawn.sublime-syntax",

    // ( 0.5 ~ 5.0 ) Delay before regenerating auto-completion snippets
    "live_refresh_delay": 60.0
}
__________________








CrazY. is offline
Old 02-15-2018, 08:59
CrazY.
This message has been deleted by CrazY.. Reason: Internet, :lol:
addons_zz
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

Quote:
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:
    Code:
    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:
Code:
{     "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 - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-18-2018 at 13:33.
addons_zz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-18-2018 , 13:59   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #80

Thank you! This is exactly what I needed. I did the individual selection thing, but I noticed one problem. No matter which compiler I choose, the include files are read from the original compiler. Here's the compiler output:

PHP Code:
Compiling adminchat... Current time is19:58:46.12 18.07.2018

Welcome to the AMX Mod X 1.8.1
-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxconst.inc(50) : error 056arrayslocal variables and function arguments cannot be public (variable "NULL_STRING")
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxconst.inc(55) : error 056arrayslocal variables and function arguments cannot be public (variable "NULL_VECTOR")
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\string_stocks.inc(91) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\string_stocks.inc(91) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(178) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(178) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2549) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2549) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2561) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2561) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2609) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2609) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2620) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2620) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2632) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmodx.inc(2632) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmisc.inc(635) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include/\amxmisc.inc(635) : error 038extra characters on line

10 Errors
.
Could not locate output file E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\adminchat.amx (compile failed).
There was an compilation errorExiting... 

Took 0:00:00,43 seconds to run this script.

[
Finished in 0.5s
As you can see, the compiler is in the "Deathrun Unique" server, but it uses the files from the "Dust2+Respawn" server.

Here's the .sublime-build file:

PHP Code:
{
    
"working_dir""$file_path",
    
"cmd": ["$packages/User/Amxmodx/AmxxDust183.bat","$file""$file_base_name""$packages""$file_path"],

    
// "target": "ansi_color_build",
    
"syntax""Packages/Amxmodx/AmxmodxConsole.sublime-syntax",

    
"variants":
    [
        {
            
"name""AmxxDeathrun182.bat",
            
"cmd": ["$packages/User/Amxmodx/AmxxDeathrun182.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""AmxxDust183.bat",
            
"cmd": ["$packages/User/Amxmodx/AmxxDust183.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""AmxxFurien183.bat",
            
"cmd": ["$packages/User/Amxmodx/AmxxFurien183.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""AmxxJailbreak183.bat",
            
"cmd": ["$packages/User/Amxmodx/AmxxJailbreak183.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""AmxxReHLDS.bat",
            
"cmd": ["$packages/User/Amxmodx/AmxxReHLDS.bat","$file""$file_base_name""$packages""$file_path"],
        },
    ],

    
"selector""source.AmxxPawn, source.AMXX, source.sma",
    
"file_regex""^.*[\\/\\\\]+(.+)\\(([0-9]+ ?.*)\\) : (.*)",

__________________

Last edited by OciXCrom; 07-18-2018 at 14:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:05.


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