[Tutorial] Webstorm 2016 Setup
#1

Developing SA:MP with Webstorm 2016
1. Summary:

This tutorial will be going through how to set up a simple build and run server script from the Webstorm 2016 IDE as well as a few set up themes that help separate key words. I personally find Webstorm to be a nicer IDE because it allows you to set up build scripts which will let you automatically RCON or have you generate an API or changelog at the click of a button

2. Why Webstorm?

Webstorm is a lightweight IDE that allows you to install easy edit plugins like VIM. It is similar to sublime text but in my opinion performs a lot better and handles projects much more nicely. You can exclude files and folders so that when searching the entire project you can ignore specific files.

Webstorm allows the use of Gulp and Node development, meaning that you can kick off a node version of your server which, in the right hands allows you to debug and handle server side stuff a bit nicer. Gulp files are used to set off build scripts (The ones I've provided are merely: Build and Run), meaning you can build the AMX or write a script to kick off a changelog formatter or format an API sheet.

3. Setting up the build / run scripts
  1. Copy and Paste the "build" folder into your existing project or copy the entire folder to start anew
  2. Right click the "build/GulpFile.js" and select "Show Gulp Tasks"
3.1. Setting up File Type recognition / Key words
  1. Go to File -> Settings -> Editor -> File Types
  2. In the top section, click on the green plus and input the following:
    Name: Pawn
    Description: Pawn
    Line Comment: //
    Block comment start: /*
    Block comment end: */
    Hex prefix: 0x
    Support Paired braces: true
    Support paired brackets: true
    Support string escapes: true
  3. Add Keyword associations, I typically do the following:
    • TAB 1
    • #include
    • #pragma

      TAB 2
    • #define

      TAB 3
    • forward
    • new
    • print
    • public
    • return
    • stock

      TAB 4
    • float:
    • text:
  4. Go to Editor -> Colors & Fonts -> Custom and input your own custom colour scheme
3.2. Per-script edits?
When starting a script, it's very important that you edit the GulpFile.js. This is because the current version of the package I've provided doesn't allow an easier and more intuitive way of selecting which file to compile. The edit is as follows:

HTML Code:
var gulp = require('gulp');
var run = require('gulp-run');

gulp.task("build: script", function(){
   process.chdir("../pawno/");
   return run("pawncc.exe ../gamemodes/[FILENAME].pwn").exec();
});

gulp.task("run: samp-server", function(){
   process.chdir("../");
   return run("start samp-server.exe").exec();
});
Replace [FILENAME] with the name of your script

4. Conclusion

The reason I use Webstorm is because I mainly use it for work but it also harbours a lot of nice little features that I personally find handy like being able to split files vertically and horizontally to work on the same file in two places at once. The only issue for me is that you need to pay for a license.

If this has helped in any way, any feedback would be appreciated. It took me less than an hour to get the project together.

5. Download:
Windows: Here
Reply
#2

Never heard of it. Can I develop SA-MP with it, though?
Reply
#3

Quote:
Originally Posted by SickAttack
View Post
Never heard of it. Can I develop SA-MP with it, though?
Yeah, you'd edit the PWN as you would in sublime text but it allows a project management tree much more nicely. You would then just hit CTRL F5 and it would build, same as usual and you can even hit another shortcut to run the server.exe
Reply
#4

if we can develop samp whats the point of suggestions we could just add it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)