AlliedModders

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

addons_zz 01-30-2017 14:03

[TUT] Compiling AMXX plugins with Sublime Text
 
1 Attachment(s)

[TUT] Compiling AMXX plugins with Sublime Text

Quote:

Originally Posted by Depresie (Post 2488992)
You should really consider making this simple IDE for PC since all we got now is the old bugged AMXX studio and other buggy / over developed IDEs full of crap when all there is needed is
Quote:

Open
Save
Compiler
Highlighting
Light + Dark skin
Output + Compiler path
Search + Replace

Disclaimer:

I did not wrote Sublime Text, or the several of its packages I providing on this setup.
Each package has its own README file stating its author, or at least should.
I just gathered them and put them all together, may be a few bug fixed if necessary
on some of them. See the change log for more details.

The distributed packages by the Data.zip or later downloaded by the AmxxChannel
installer, in addition to each one own license, are distributed under the following conditions for
its usage and installation:
Code:

ALL THE SOFTWARES, PACKAGES, PLUGINS, SETTINGS, DOCUMENTATION, EVERYTHING ELSE, ARE PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Contents' Table
  1. How to install?
  2. How to compile?
  3. The auto-completion
  4. Why Sublime Text?
  5. Change log
  6. What more you can do?
  7. FAQ: Frequently Asked Questions
  8. Downloads

You can have tooltips with your function documentations:

https://i.imgur.com/txvDpry.png


This is how the application looks like. Here I am using the commands:
  1. `Go To` by the keyboard bind `Ctrl+R`
  2. `Build` by the keyboard bind `F7`
  3. `Show Build` by the keyboard bind `F8`
https://i.imgur.com/ebMiY2B.gif


There is also the commands:
  1. `Go To Line` by the keyboard bind `Ctrl+G`
  2. `Go To File` by the keyboard bind `Ctrl+P`
  3. `Command Palette` by the keyboard bind `Ctrl+Shift+P`
https://i.imgur.com/nrEnGxW.gif


You can see the parameter by putting the mouse over the function name and waiting about 2 seconds:

https://i.imgur.com/UHuJU8S.gif



Change log Go to top
Spoiler


How to compile? Go to top
Spoiler


What more you can do? Go to top
Spoiler


Why Sublime Text? Go to top

Because you can customize anything: Key Bindings, Menus, Snippets, Macros, Completions and more, just about everything in Sublime Text is customizable.
  1. For a full featured Sublime Text, read: Versioned Sublime Text Settings
  2. If you do not like to see the message `This is an unregistered copy` every time you open Sublime Text, you need to buy a
    Sublime Text Licence for about $80 dollars.
See also:
  1. http://www.sublimetext.com/3
  2. https://www.sublimetext.com/buy
  3. https://packagecontrol.io/
  4. https://forum.sublimetext.com/
  5. https://github.com/SublimeTextIssues/Core/issues

Downloads Go to top

What do you need?
  1. Download Sublime Text:


  2. And the configuration files Data.zip I created and attached on the `.zip` file at the end of this post, i.e., just below here.

    Note: On the first time you open Sublime Text, you will may see a message like this:

    https://i.imgur.com/Y3oNw6Z.png

    This is just showing up because Package Control just updated something,
    but needs Sublime Text to be restarted before finishing the updates.

Old Versions Downloads
Code:

Packages.zip (604.7  KB, 56 views ) - v1.4.3 | 2017-01-17
Packages.zip (557.5  KB, 22 views ) - v1.5.0 | 2017-06-15
Packages.zip (  1.04 MB, 17 views ) - v1.5.3 | 2017-09-26
Packages.zip (  1.04 MB, 40 views ) - v1.6.0 | 2017-10-25
Data.zip    ( 673.4 KB, 234 views) - v2.0.0 | 2018-07-24
Data.zip    ( 747.5 KB, 69  views) - v3.0.0 | 2018-12-21
Data.zip    ( 1.12  MB, 268 views) - v3.0.1 | 2020-04-26

License

The distributed packages by the Data.zip or later downloaded by the AmxxChannel
installer, in addition to each one own license, are distributed under the following conditions for
its usage and installation:
Code:

ALL THE SOFTWARES, PACKAGES, PLUGINS, SETTINGS, DOCUMENTATION, EVERYTHING ELSE, ARE PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


addons_zz 01-30-2017 14:04

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins
 

How to install? Go to top
Spoiler


The auto-completion by [Destro], Go to top

To use the auto-completion you need to configure your include folder going on the menu:
Code:

Preferences -> Package Settings -> AmxxEditor -> Edit AmxxEditor Autocompletion Settings
And setting the path to your compiler's include folder on the `include_directory` setting value.



FAQ: Frequently Asked Questions Go to top
  1. Quote:

    Originally Posted by iceeedr (Post 2629554)
    Would you have an updated "how to"? I tried installing yesterday, however the application is totally different from the images, probably because of updates ...

    Sublime Text version changed and the new version as a very new theme, also, I updated the colors schemes used, them, the images became pretty different. But the text inside the images still the names, so you should be able to just ignore the colors/theme/fonts and just follow written the text.



  2. Quote:

    Originally Posted by CrazY. (Post 2606261)
    Autocomplete doesn't work with "includes included into other includes".
    AmxxEditor syntax doesn't auto set in include files.

    I am not sure why this is happening, as by default that should be working.

    Anyways, you can force all files with `.inc` extension to open with the correct syntax:

    1. Opening a `.inc` file
    2. And going on the menu `View -> Syntax -> Open all with current extension as... -> Amxmodx -> AmxmodxPawn`



  3. Quote:

    Originally Posted by DruGzOG (Post 2697420)
    How would I go about opening inc files? Checking your first post, I don't have that option

    You can open any `.inc` file the same way you open a `.sma` file. If this is not recognized by your system, you can choose `Open with...` on and choose `sublime_text` as your default program: https://forum.sublimetext.com/t/cant-set-st3-as-default-app-win10-pro/29586



  4. Quote:

    Originally Posted by JocAnis (Post 2697335)
    Did anyone accomplished auto-filling the new file (just like in Amxx studio), is it even possible?

    Yes.

    1. Just go to the menu `Tools -> Packages -> AmxxEditor -> New Plug-in`

    2. Alternatively, you can go to the menu `Preferences -> Packages Settings -> AmxxEditor -> Install AmxxEditor Menu`

    3. Then, you can use the menu `AmxxEditor -> New Plug-in`

Depresie 02-03-2017 06:45

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Thanks for the tutorial, i will try it as soon as i get the chance

Depresie 02-04-2017 18:41

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Ahm, custom includes support ? =\

fysiks 02-04-2017 19:44

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Quote:

Originally Posted by Depresie (Post 2492922)
Ahm, custom includes support ? =\

Put the custom files in the include folder?

addons_zz 02-04-2017 19:55

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
I am not searching for a include folder where the plugin is, and coping it to the folder of your compiler's include folder is.
For now you can manually copy them to yours compiler's folder.

Does it is really necessary?
I can include it on the compilation script later.

Update:

The load seems to be automatic just using the compiler parameter -I/plugin/include/folder
I tested and it works. Latter I will release a update with. Are there some other things you want to include?

Depresie 02-05-2017 08:59

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
I dont understand what you mean...

The include folder is located in the same folder with the compiler...
Funny tho, it doesn't read from my custom incs, but for some reason it has zombie plague natives, wth

addons_zz 02-05-2017 10:41

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Quote:

Originally Posted by Depresie (Post 2493072)
I dont understand what you mean...

Usually there are two include folders, the first one is the compiler's one.
Code:

D:/
└── Game
    └── cstrike
        └── addons
            └─── amxmodx
                └─── scripting
                      └─── amxxpc.exe
                          ├── compiler.exe
                          └── include
                              └── compiler_defeault.inc

The second one could exists or not. If there is one, it would be:
Code:

C:/
└── User
    └── Downloads
        ├── zp_plague_5.sma
        └── include
            └── zp_includes.inc

So, if we run the compiler with the parameter `-I` pointing to the `zp_plague_5.sma` special include folder,
we do not need to copy the include files to the compiler's default include folder. Example:
Code:

D:/Game/cstrike/addons/amxmodx/scripting/amxxpc.exe -I"C:/User/Downloads/include" "C:/User/Downloads/include/zp_plague_5.sma"
You do not need to copy the includes on `C:/User/Downloads/include` to the folder `D:/Game/cstrike/addons/amxmodx/scripting/include`.

Depresie 02-05-2017 12:04

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Well, for me it seems to read only from the Download folder include..
How do i set it to read and read only includes from the compiler's folder ?

It also auto completes for all the includes even tho they are not defined in the actual script =/

addons_zz 02-05-2017 12:59

Re: [TUT] How to setup a simple IDE to program/compile AMXX plugins (with Sublime Tex
 
Quote:

Originally Posted by Depresie (Post 2493116)
Well, for me it seems to read only from the Download folder include..
How do i set it to read and read only includes from the compiler's folder ?

If it was not reading from the compiler folder you would get error like:
Code:

fatal error 100: cannot read from file: "amxmodx"
fatal error 100: cannot read from file: "amxmisc"
fatal error 100: cannot read from file: "fun"

The `-I` parameter is an addition only. Will not remove the include folder never. It will only increase the folders it is able to find includes. The command line can be like this:
Code:

D:/Game/cstrike/addons/amxmodx/scripting/amxxpc.exe -I"C:/User/Downloads/include/" -I"F:/AMXX/include/" -I"D:/User/Downloads/include/" "C:/User/Downloads/include/zp_plague_5.sma"
Assuming your compiler is on `D:/Game/cstrike/addons/amxmodx/scripting/`, doing the include:
Code:

D:/Game/cstrike/addons/amxmodx/scripting/amxxpc.exe -I"D:/Game/cstrike/addons/amxmodx/scripting/include/" -I"C:/User/Downloads/include/" -I"F:/AMXX/include/" -I"D:/User/Downloads/include/" "C:/User/Downloads/include/zp_plague_5.sma"
Would be redundant to include the folder `D:/Game/cstrike/addons/amxmodx/scripting/include/`, as it is added by default, if it exists.

Quote:

Originally Posted by Depresie (Post 2493116)
It also auto completes for all the includes even tho they are not defined in the actual script =/

The auto completion comes from a standard file with all auto completes.
To do auto completion based on the included files, I need to parse the plugin file, detect which includes it uses, and parse the include folder to get their definitions.

I will see if I can get it working here.


All times are GMT -4. The time now is 06:59.

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