Pawn Compiler in Sublime Text 2
#1

Open up Sublime Text 2 and go to Tools -> Build System -> New Build System...

Enter the following:
Код:
{
	"cmd": ["pawncc.exe", "-i includes", "$file", "-;+"],
	"path": "C:/path/to/pawno/folder"
}
Of course you need to replace the path

Save this file and close Sublime Text 2

Now navigate to AppData/Roaming/Sublime Text 2/Packages/User

Open up the .sublime-keymap file based on your operating system

Enter the following (this example is for the Windows file):
Код:
[
	{ "keys": ["f5"], "command": "build" }
]
You can change f5 to another key if you wish

Save and reopen Sublime Text 2

Now go to Tools -> Build System

Click on the name of the build you created

You can now compile your scripts by pressing the button you assigned, enjoy...
Reply
#2

This should probably be in the tutorials section.
Reply
#3

Massive thanks!
I would of committed a suicide if I had to use notepad++ search again..
Reply
#4

Might make a new thread regarding this. With your credits at the top.

Started using Sublime Text 2 as of today, and gosh. It is amazing.

For the first step, most of you may get confused so make a new folder in AppData\Roaming\Sublime Text 2\Packages called Pawn

Inside that folder, make a new file called (with any file name) under the extension *.sublime-build

Since most people use crashdetect.dll/.so they may want debug mode, this setting already has it.

Код:
{
	"cmd": ["pawncc.exe", "-d3 -r -i includes", "$file", "-;+"],
	"path": "C:/Users/User/Desktop/SA-MP FOLDER/pawno"
}
MAKE SURE YOU REPLACE "C:/Users/User/Desktop/SA-MP FOLDER/pawno" with your PAWNO DIRECTORY!

After that, Tools > Build Systems > Pawn and it will enable itself. Change your syntax highlighting to C++ (<removed why that is because some dude neg repped me for it (I'm going to accuse ******, sorry if I'm wrong)>) and you're good to go.

Compiler Box Colouring (OPTIONAL)

At first, the colour box looks too bright, so consider changing it to a more darker background!

http://stackoverflow.com/questions/1...n-sublime-text

Inside of the setting Todd had provided, use mine, it uses a the twilight theme (not the gay movie lol) and goes with the dark theme.

Код:
{
    // "color_scheme": "Packages/Theme - Default/Widgets.stTheme",
    "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme"
}
Happy coding! And the bump was worth it! :P
Reply
#5

You may want to add this:

Код:
<key>fileTypes</key>
	<array>
		<string>owl</string>
		<string>inc</string>
		<string>pwn</string>
	</array>
inside the appropriate file called *.tmLanguage


When i set up sublime, i was lazy: I copied the c++ package and added the above code to the appropriate file


I'm also attaching a theme I created to this post.
Reply
#6

Quote:
Originally Posted by Patrik356b
Посмотреть сообщение
You may want to add this:

Код:
<key>fileTypes</key>
	<array>
		<string>owl</string>
		<string>inc</string>
		<string>pwn</string>
	</array>
inside the appropriate file called *.tmLanguage


When i set up sublime, i was lazy: I copied the c++ package and added the above code to the appropriate file


I'm also attaching a theme I created to this post.
Alternate (much more easier tbh):



This is such a fantastic IDE.

__

There is a PAWN syntax called "SourcePawn", you can download the package however it is WIP, not much is coloured
Reply
#7

C++ syntax suffices IMO
Reply
#8

Awesome !!!

Finnaly a proper code folding that makes coding much easier and faster. Also View -> Indetation TAB 4 for pawn .
Thank you for this
Reply
#9

Sublime text 2 is very good thing! I think this program gonna change pawno.exe
Reply
#10

Hello,

I have this error when i compile :

Quote:

Running pawncc.exe -i includes J:\Informatique\Dйveloppement\server_samp\Midtown States Role Play\server\gamemodes\roleplay.pwn -;+
Traceback (most recent call last):
File ".\sublime_plugin.py", line 337, in run_
File ".\exec.py", line 154, in run
File ".\exec.py", line 45, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 17: ordinal not in range(12
Package Control: Skipping automatic upgrade, last run at 2013-07-17 18:09:57, next run at 2013-07-17 19:09:57 or after

Reply
#11

It does not show me the error/warning...
Reply
#12

Just updated the Word Completion and added some 0.3z callback, new parameters on OnPlayerTakeDamage and OnPlayerGiveDamage also added these following definitions in the Word Completion

pawn Code:
#define BULLET_HIT_TYPE_NONE            0
#define BULLET_HIT_TYPE_PLAYER          1
#define BULLET_HIT_TYPE_VEHICLE         2
#define BULLET_HIT_TYPE_OBJECT          3
#define BULLET_HIT_TYPE_PLAYER_OBJECT   4
Download Link: Click Me!

Fixed Syntax Highlighting (When using double ' (Apostrophe))
Download Link: Click Me!
Reply
#13

I would also like to share this line so we can close the output window:
Code:
{ "keys": ["ctrl+shift++r"], "command": "hide_panel", "args": {"panel": "output.exec"} },
Reply
#14

What a way to force Linux users? Path to the compiler to:
Quote:

/home/myname/server/pawno/pawncc.exe

If so indicate and after clicking on the F5 writes:

Quote:

[Errno 20] This is not a directory
[cmd: [u'pawncc.exe', u'-i includes', u'/home/myname/server/gamemodes/gamemode.pwn', u'-;+']]
[dir: /home/myname/server/gamemodes]
[path: /home/myname/server/pawno/pawncc.exe]
[Finished]

Help me
Reply
#15

Ext[R]eme after fiddling a bit with the code (I'm a complete newbie to this kind of thing) I managed to get the compiler working in sublime text with linux (ubuntu 12.04)
Quote:

{
"cmd": ["wine","/put/path/to/srv/pawno/pawncc.exe","$file_name","-;+","-v2","-d3","-\\)+"],
"working_dir": "${file_path}",
"file_regex": "(.*?)[(]([0-9]*)[)]"
}

PS: Sorry to bump up an old thread but I think some people might need this.
Reply
#16

Code:
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Storage\..\amx\amx_header.inc(118) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Storage\..\amx\opcode.inc(639) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Storage\..\amx\opcode.inc(659) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Storage\..\amx\asm.inc(111) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Coding\y_malloc/heapalloc.inc(201) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\y_foreach/impl.inc(1104) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\y_foreach/impl.inc(1413) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(197) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(275) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(602) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(913) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(1099) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\..\YSI_Coding\y_hooks/impl.inc(1193) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(412) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(422) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\YSI\..\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(438) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\sscanf2.inc(149) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\sscanf2.inc(193) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(957) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(994) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(1175) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2124) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2128) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2132) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2208) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2214) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2218) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2265) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2633) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2692) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(2814) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(3783) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4137) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4168) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4184) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4212) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4233) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4252) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4568) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(4985) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5005) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5051) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5099) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5148) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5159) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5178) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5205) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5222) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5242) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5405) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\weapon-config.inc(5415) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\ColAndreas.inc(378) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\config.pwn(319) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\config.pwn(342) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\config.pwn(359) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(399) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(444) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(783) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(825) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(841) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(852) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(882) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(898) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(904) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1314) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1377) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1373) : warning 203: symbol is never used: "playerid"
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1393) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1522) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(195) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1560) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1569) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1585) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1610) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1633) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1656) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1679) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1702) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1725) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1757) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1783) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1809) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1835) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1861) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1887) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1913) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\factions.pwn(1939) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\admins.pwn(95) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\admins.pwn(864) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\admins.pwn(882) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\admins.pwn(906) : warning 219: local variable "i" shadows a variable at a preceding level
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\admins.pwn(1121) : warning 219: local variable "i" shadows a variable at a preceding level
zarp.pwn(271) : warning 219: local variable "i" shadows a variable at a preceding level
zarp.pwn(972) : warning 219: local variable "i" shadows a variable at a preceding level
why am i having alot of warnings that have never been showed when i compiled by pawno?
Reply
#17

Code:
E:\ZARP-MASTER-SERVER\pawno\include\subscripts\global.pwn(1373) : warning 203: symbol is never used: "playerid"
E:\ZARP-MASTER-SERVER\gamemodes\zarp.pwn(1661) : warning 203: symbol is never used: "FactionCount"
E:\ZARP-MASTER-SERVER\gamemodes\zarp.pwn(1661) : warning 203: symbol is never used: "GetItemName"
E:\ZARP-MASTER-SERVER\gamemodes\zarp.pwn(1661) : warning 203: symbol is never used: "pPrisionPos"
Pawn compiler 3.2.3664
with pawno i only got 4 warnings. and its because i havent finished those yet.
but with Sublime Text i got those warning with alot of
Code:
warning 219: local variable "i" shadows a variable at a preceding level
and i dont understand what you meant...
Quote:
Originally Posted by [HLF]Southclaw
View Post
Try compiling from the command line without an IDE to get it set up first, then copy the working parameters into ST.
Reply
#18

[Error 2] The system cannot find the file specified
[cmd: [u'pawncc.exe', u'-i includes', u'C:\\Users\\vladut\\Desktop\\StronG Project\\gamemodes\\strong.pwn', u'-;+']]
[dir: C:\Users\vladut\Desktop\StronG Project\gamemodes]
[path: C:/Users/vladut/Desktop/StronG Project/pawno/pawncc.exe]
[Finished]
Reply
#19

Very nice, it's a cool editor, I don't like Notepad++ so this will be a helpful tutorial.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)