Raised This Month: $101 Target: $400
 25% 

[TUT] Compiling AMXX plugins with Sublime Text


Post New Thread Reply   
 
Thread Tools Display Modes
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-02-2017 , 10:39   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #61

Quote:
Originally Posted by Depresie View Post
Problem still the same
I released a new version fixing some things, but I do not think your problem was one of them, but you can try installing it.

If installing this new version does not work, can you copy and paste here or PM the contents of your `AmxxPawn.bat` file?

Code:
v1.5.1 | 2017-09-02
 * Fixed automatic update for the Amxx Pawn package.
 * Added automatic update for the amxmdox package.
 * Fixed the amxmdox package creating double new lines on the configuration files.
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!
addons_zz is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-06-2017 , 13:31   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #62

Package control error
https://ibb.co/eavw4F

Didn't test the compiler tho..
__________________

Last edited by Depresie; 09-06-2017 at 13:32.
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-06-2017 , 14:53   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #63

Quote:
Originally Posted by Depresie View Post
Package control error
You can ignore this message. Setting the Package Control setting`"ignore_vcs_packages": true,` should stop that message from coming up.

You can open the Package Control settings file by going on `Preferences -> Package Contorl -> Settings - User`:

Spoiler


I will edit the default settings file shipped so this is by default set to true.

___

References:

1. https://github.com/wbond/package_control/issues/368 ST3: Unable to find git.exe
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!

Last edited by addons_zz; 09-06-2017 at 14:56.
addons_zz is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-08-2017 , 07:48   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #64

The configuration is below, the problem still the same..

Echo off ->
Code:
Compiling test... Current time is: 13:46:41.17 - Fri


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

[Finished in 0.3s]
Echo on ->
Spoiler

Spoiler
__________________

Last edited by Depresie; 09-08-2017 at 07:50.
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-08-2017 , 14:27   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #65

Quote:
Originally Posted by Depresie View Post
The configuration is below, the problem still the same..
This output seems from the old version. As on the new version these lines:
Code:
E:\HLDS\cstrike\addons\amxmodx\scripting>rem Example: 

E:\HLDS\cstrike\addons\amxmodx\scripting>rem F:/SteamCMD/steamapps/common/Half-Life/czero/addons/amxmodx/scripting/amxxpc.exe
Are:
Code:
E:\HLDS\cstrike\addons\amxmodx\scripting>rem Example: 

E:\HLDS\cstrike\addons\amxmodx\scripting>rem F:\SteamCMD\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\amxxpc.exe
Then try to copy and paste this version on your AmxxPawn.bat, I already set you compiler and plugins folder:
Code:
@echo off

rem AMXX Plugin Compiler Script
rem
rem  This program is free software; you can redistribute it and/or modify it
rem  under the terms of the GNU General Public License as published by the
rem  Free Software Foundation; either version 2 of the License, or ( at
rem  your option ) any later version.
rem
rem  This program is distributed in the hope that it will be useful, but
rem  WITHOUT ANY WARRANTY; without even the implied warranty of
rem  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rem  See the GNU General Public License for more details.
rem
rem  You should have received a copy of the GNU General Public License
rem  along with this program.  If not, see <http://www.gnu.org/licenses/>.
rem


rem Get the current date to the variable CURRENT_DATE
for /f %%i in ('date /T') do set CURRENT_DATE=%%i

rem The format of %TIME% is HH:MM:SS,CS for example 23:59:59,99
echo.
echo Compiling %2... Current time is: %TIME% - %CURRENT_DATE%
echo.

rem Put here the paths to the folders where do you want to install the plugin.
rem You must to provide at least one folder.
set folders_list[0]=E:\HLDS\cstrike\addons\amxmodx\plugins

rem Where is your compiler?
rem
rem Example:
rem F:\SteamCMD\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\amxxpc.exe
rem
set AMXX_COMPILER_PATH=E:\HLDS\cstrike\addons\amxmodx\scripting\amxxpc.exe





rem
rem Setup the time calculation script
rem
rem Time calculation downloaded from:
rem http://stackoverflow.com/questions/9922498/calculate-time-difference-in-windows-batch-file
rem
rem AMX Mod X compiling batch downloaded from:
rem https://github.com/alliedmodders/amxmodx/pull/212/commits

rem Here begins the command you want to measure
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
   set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)


rem
rem Setup the batch variables
rem
rem $1 is the first shell argument and $2 is the second shell argument passed by AmxxPawn.sublime-build
rem Usually they should be the plugin's file full path and the plugin's file name without extension.
rem
rem Example: $1=F:\SteamCMD\steamapps\common\Half-Life\czero\addons\my_plugin.sma
set PLUGIN_SOURCE_CODE_FILE_PATH=%1

rem Removing double quotes from variables in batch file creates problems with CMD environment
rem https://stackoverflow.com/questions/1964192/removing-double-quotes-from-variables-in-batch-file-creates-problems-with-cmd-en
set PLUGIN_SOURCE_CODE_FILE_PATH=%PLUGIN_SOURCE_CODE_FILE_PATH:"=%

rem $4 is the path of the folder where the plugin source code is.
rem Example F:\SteamCMD\steamapps\common\Half-Life\czero\addons\
set SOURCE_CODE_INCLUDE_FOLDER=%4\include
set SOURCE_CODE_INCLUDE_FOLDER=%SOURCE_CODE_INCLUDE_FOLDER:"=%

rem Example: $2="my_plugin"
set PLUGIN_BASE_FILE_NAME=%2
set PLUGIN_BASE_FILE_NAME=%PLUGIN_BASE_FILE_NAME:"=%
set PLUGIN_BINARY_FILE_PATH=%folders_list[0]%\%PLUGIN_BASE_FILE_NAME%.amxx

IF "%PLUGIN_BASE_FILE_NAME%"=="" echo You must to save the plugin before to compile it. & goto end


rem
rem Copy the include files to the compiler include files, if they exist.
rem
setlocal enabledelayedexpansion enableextensions

rem See: http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd
rem set AMXX_COMPILER_PATH=C:\Somewhere\Somewhere\SomeFile.txt
call :path_from_file_name AMXX_COMPILER_FOLDER !AMXX_COMPILER_PATH!

rem Build the compiler include folder path
set COMPILER_INCLUDE_FOLDER_PATH=%AMXX_COMPILER_FOLDER%include

rem echo $COMPILER_INCLUDE_FOLDER_PATH: %COMPILER_INCLUDE_FOLDER_PATH%
rem echo $SOURCE_CODE_INCLUDE_FOLDER:   %SOURCE_CODE_INCLUDE_FOLDER%

for %%A in ("%COMPILER_INCLUDE_FOLDER_PATH%") do for %%B in ("%SOURCE_CODE_INCLUDE_FOLDER%") do if "%%~fA"=="%%~fB" goto end
IF EXIST "%SOURCE_CODE_INCLUDE_FOLDER%" call xcopy /S /Y "%SOURCE_CODE_INCLUDE_FOLDER%" "%COMPILER_INCLUDE_FOLDER_PATH%" > nul

rem Closes the `enabledelayedexpansion` scope
endlocal


rem
rem Compile the AMXX plugin
rem
rem Delete the old binary in case some crazy problem on the compiler, or in the system while copy it.
rem So, this way there is not way you are going to use the wrong version of the plugin without knowing it.
IF EXIST "%PLUGIN_BINARY_FILE_PATH%" del "%PLUGIN_BINARY_FILE_PATH%"

rem To call the compiler to compile the plugin to the output folder $PLUGIN_BINARY_FILE_PATH
"%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%/" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"

rem If there was a compilation error, there is nothing more to be done.
IF NOT EXIST "%PLUGIN_BINARY_FILE_PATH%" goto end


rem
rem Copy the compiled plugin to the game folder(s)
rem
echo.
echo 1 File(s) copied, to the folder %folders_list[0]%

rem Initial array index to loop into.
set "currentIndex=1"

rem Loop throw all games to install the new files.
:SymLoop
if defined folders_list[%currentIndex%] (

    rem Some how the AMXX compiler could not compiling/copied some times, so let us know when it does not.
    setlocal EnableDelayedExpansion

    rem Try to delete the file only if it exists
    IF EXIST "!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx" del "!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx"

    rem To do the actual copying/installing.
    for /f "delims=" %%a in ( 'xcopy /S /Y "%PLUGIN_BINARY_FILE_PATH%"^
            "!folders_list[%currentIndex%]!"^|find /v "%PLUGIN_BASE_FILE_NAME%"' ) do echo %%a, to the folder !folders_list[%currentIndex%]!

    rem Update the next 'for/array' index to copy/install.
    set /a "currentIndex+=1"

    goto :SymLoop
)


rem
rem Subroutines/Function calls
rem
goto :end

rem Copy the include files to the compiler include files, if they exist.
setlocal enabledelayedexpansion enableextensions

rem This one must to be on the `enabledelayedexpansion` range
:path_from_file_name <resultVar> <pathVar>
(
    set "%~1=%~dp2"
    exit /b
)

rem Closes the `enabledelayedexpansion` scope
endlocal


rem
rem The end of the compilation
rem
:end

rem Calculating the duration is easy
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
   set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

rem Get elapsed time
set /A elapsed=end-start

rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

rem Outputting
echo.
echo Took %hh%:%mm%:%ss%,%cc% seconds to run this script.

rem Pause the script for result reading, when it is run without any command line parameters
echo.
if "%PLUGIN_SOURCE_CODE_FILE_PATH%"=="" pause
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!

Last edited by addons_zz; 09-08-2017 at 14:27.
addons_zz is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-08-2017 , 14:29   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #66

Weird, are you sure you didn't forget to update the packages ?

Here, the problem still the same
Spoiler
__________________
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-08-2017 , 14:44   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #67

Quote:
Originally Posted by Depresie View Post
Weird, are you sure you didn't forget to update the packages ?

Here, the problem still the same
I simplified the code more, try running this:
Code:
@echo on

rem AMXX Plugin Compiler Script
rem
rem  This program is free software; you can redistribute it and/or modify it
rem  under the terms of the GNU General Public License as published by the
rem  Free Software Foundation; either version 2 of the License, or ( at
rem  your option ) any later version.
rem
rem  This program is distributed in the hope that it will be useful, but
rem  WITHOUT ANY WARRANTY; without even the implied warranty of
rem  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rem  See the GNU General Public License for more details.
rem
rem  You should have received a copy of the GNU General Public License
rem  along with this program.  If not, see <http://www.gnu.org/licenses/>.
rem

echo.
echo Compiling %2... Current time is: %TIME% - %CURRENT_DATE%
echo.

set folders_list[0]=E:\HLDS\cstrike\addons\amxmodx\plugins
set AMXX_COMPILER_PATH=E:\HLDS\cstrike\addons\amxmodx\scripting\amxxpc.exe


set PLUGIN_SOURCE_CODE_FILE_PATH="%1"
set SOURCE_CODE_INCLUDE_FOLDER=%4\include
set PLUGIN_BASE_FILE_NAME=%2
set PLUGIN_BINARY_FILE_PATH=%folders_list[0]%\%PLUGIN_BASE_FILE_NAME%.amxx

IF %PLUGIN_BASE_FILE_NAME%=="" echo You must to save the plugin before to compile it. & goto end
IF EXIST "%PLUGIN_BINARY_FILE_PATH%" del "%PLUGIN_BINARY_FILE_PATH%"

rem To call the compiler to compile the plugin to the output folder $PLUGIN_BINARY_FILE_PATH
"%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%/" -o"%PLUGIN_BINARY_FILE_PATH%" %PLUGIN_SOURCE_CODE_FILE_PATH%

rem If there was a compilation error, there is nothing more to be done.
IF NOT EXIST "%PLUGIN_BINARY_FILE_PATH%" goto end

echo.
echo 1 File(s) copied, to the folder %folders_list[0]%
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!
addons_zz is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-08-2017 , 14:58   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #68

Works ! thanks

Don't forget to update the packages please
__________________

Last edited by Depresie; 09-08-2017 at 14:58.
Depresie is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-08-2017 , 15:25   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #69

Released new version:
Code:
v1.5.2 | 2017-09-08
 * Fixed the check for cyclic copies skip copying the include folder ending/blocking the compilation.
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 09-26-2017 , 20:00   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #70

Released a new version:

HTML Code:
v1.6.0 | 2017-09-26
 * Updated to Sublime Text 3 build 3143
For the version 1.6.0 or newer, download now Sublime Text 3 build 3143 for windows/linux:
__________________
Plugin: Sublime Text Studio , Galileo
Multi-Mod: Manager / Plugin / Server

Help the AlliedModders' website stay online!
addons_zz 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:47.


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