Skip to content

Bring the official Starcraft 2 C++ api in a native node.js module

Notifications You must be signed in to change notification settings

Elkantor/sc2api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version stability Join the chat at https://gitter.im/sc2api/Lobby contact

sc2api

A node.js module to easily create bots for Starcraft 2 in javascript

The role of this package is to bring the official Starcraft 2 C++ API to node.js, through a native node module.
The whole API will be usable fully with the power of javascript, to perform an easiest way to create and debug your bot.

bulb [Warning] This project is currently under development, and is likely to be modified and to include all kinds of bugs.

Installing / Getting started

You have two options to use this module, one easiest by installing it with npm (or yarn), and one a little more hard, by cloning this repository and building & installing it manually.

So for the first option, you can directly install the module by using npm, if you already have a node.js project setted up :

npm install --save sc2api

Or by using yarn :

yarn add sc2api

For the second option, if you choose to build & install it manually by cloning this repository, you can follow the commands listed below (assuming that you want to create a new node.js project to use this module) :

First, clone the repository in the folder of you choice with the following command :

git clone https://github.com/Elkantor/sc2api.git
cd sc2api

Next, you need to initialize a new node.js project with the following command :

bulb If you don't already have node.js installed, use a package manager like chocolatey to get it on windows, for exemple, or download and install it manually from its official website : https://nodejs.org/.

Before to be able to install the module, you need to compile it.
To do that, this project use node-gyp (a node.js module which works with python 2.7).
Follow the instructions listed in the official node-gyp installation guide, to be sure to be able to use node-gyp as expected, depending on your OS.

And finally, you can build and install the module with the following command :

bulb This command is actually going to do two things : it will compile this native module, calling the "node-gyp rebuild" command, and install the module to bring it to your node.js project. If you are curious about it, you can see and configure these commands in the "scripts" section in the package.json file.

npm install

Documentation

You will find all the documentation, with exemples, to quickly getting start in the doc folder.

bulb [Warning] the documentation is currently under development, and will be available as soon as possible.

For exemple, the getting_start file shows you an exemple to quickly create a default bot (wich don't do anything, just sets up the parameters and launch the game with the default bot behavior).

Developing

Built With

  • nan (native abstractions for node.js), to be able to use the v8 google's C++ engine, without worring about its version.
  • node-gyp for compiling C++ native addon modules for Node.js.
  • sc2client-api, the official C++ API by Blizzard, to create bot for Starcraft 2.

Rules / Coding Standard

This project follow some rules, to be as consistent and comprehensible as possible.

  • semver, for the version of the package.
  • Google C++ Style Guide : I do my best to try to conform to the Google C++ Style Guide, for the C++ code of this native addon.

Additional Downloads

Maps and Replays

Just like the official Starcraft 2 C++ API, this repository only comes with a few maps for testing.

Additional maps and replays can be found here.

Licensing

(The ISC License)

Copyright (C) 2018 - Victor Gallet [email protected]

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

Bring the official Starcraft 2 C++ api in a native node.js module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published