This repo is a WIP starter template for the current Closed Alpha of Screeps Arena
Screeps Arena is a new game under active development, this repo is unoffcial and maintained by the screepers community
Any issues you experience with this repo should be created as an issue in this repo, the Screeps Arena devs should NOT be contacted!
TODO:
- Update readme
- A way to seperate the code for the different arenas
-
dist
should have multiple folders, one for each arena and their versions (ctf advanced as an example) - A way to push code to a specific arena
npm run push alpha-capture-the-flag
- Will probably be a copy of files to the correct location, depending on what location has been choosen in the arena client.
- If we can't detect the locations, we will probably need a
screeps-arena.json
file where people can set up their desired output destinations
- Initial typing declarations for Screeps Arena
- Fletch out typings for Screeps Arena
- We should probably make a new repo later for
typed-screeps-arena
that can be published to@types/screeps-arena
- We should probably make a new repo later for
Current Issues:
- Generated rollup result in wrong import statements that are not relative, this causes your code to fail and will prevent you from pressing
Play
import { Creep } from "game";
in .ts but it should beimport { Creep } from "/game";
in the.mjs
output
- eslint warnings
- Unable to resolve path to module 'game' (.eslintimport/no-unresolved)
Screeps Arena Typescript Starter is a starting point for a Screeps Arena AI written in Typescript. It provides everything you need to start writing your AI whilst leaving main.ts
as empty as possible.
The initial example code from the steam forum is included in src/alpha-capture_the_flag/main.ts
You will need:
- Node.JS (10.x || 12.x)
- A Package Manager (Yarn or npm)
- Rollup CLI (Optional, install via
npm install -g rollup
)
Open the folder in your terminal and run your package manager to install the required packages and TypeScript declaration files:
# npm
npm install
# yarn
yarn
Fire up your preferred editor with typescript installed and you are good to go!
- Run
npm run build
to produce a file indist/alpha-capture_the_flag/main.mjs
- Open up
dist/alpha-capture_the_flag/main.mjs
and make screeps arena api imports relative.import { Creep } from "game";
in .ts but it should beimport { Creep } from "/game";
in the.mjs
output
- Copy the
main.mjs
file to your desired location.
The type definitions for Screeps Arena currently resides in the @types
folder
Issues, Pull Requests, and contribution to the docs are welcome! See our Contributing Guidelines for more details.