![screeps code screeps code](https://www.moregameslike.com/wp-content/previews/screeps-61101-1.jpg)
SCREEPS CODE CODE
Try should print you the stack with the line number to better help determine the source of the error.Įrrors that cause your script to stop executing, these should provide a stack/line number you can trace down into your code to determine where the error is being caused. You can take a look at some examples in the Screepers' Snippets on Github, or check out the #client-abuse channel on Slack. This can be very helpful to add extra information into console, or make it more dynamic / easier to access rooms and much more.
![screeps code screeps code](https://pbs.twimg.com/media/ErT13M7XcAMTlPi.jpg)
![screeps code screeps code](https://assets2.rockpapershotgun.com/screepers.jpg)
This is due to console being mainly able to accept HTML, which allows for a whole host of things ranging from playing audio, creating links and buttons, to actually adding onto the UI itself. While a User should not modify the console.log itself, (the developers have warned against this) it is quite possible to use the console in many ways beyond simple text-output. You can see some examples of this in Screeps' official docs page on debugging, along with helpful tips about how returns from methods work and can be displayed.Ĭonsole & Client-Abuse If you want to see plain-text versions of objects (as they would print as in most cases) you can use JSON.stringifiy() to convert the object to plain text which makes it much easier to determine many things. Issues, Pull Requests, and contribution to the docs are welcome! See our Contributing Guidelines for more () will print to the game's console, you can add various variables, strings and the like to the printout. Maintaining the docs will also become a more community-focused effort, which means you too, can take part in improving the docs for this starter kit. Includes all the essentials to get you up and running with Screeps AI development in TypeScript, as well as various other tips and tricks to further improve your development workflow. We've also spent some time reworking the documentation from the ground-up, which is now generated through Gitbooks. If you find a problem or have a suggestion, please open an issue there. The type definitions for Screeps come from typed-screeps. Important! To upload code to a private server, you must have screepsmod-auth installed and configured! Typings Running npm run push-main is equivalent to rollup -c -environment DEST:main, and npm run watch-sim is equivalent to rollup -cw -dest sim. You can use -cw instead of -c to automatically re-run when your source code changes - for example, rollup -cw -environment DEST:main will automatically upload your code to the main configuration every time your code is changed.įinally, there are also NPM scripts that serve as aliases for these commands in package.json for IDE integration. Running rollup -c -environment DEST:main will compile your code, and then upload it to a screeps server using the main config from screeps.json.
![screeps code screeps code](https://steamcdn-a.akamaihd.net/steam/apps/464350/header.jpg)
Running rollup -c will compile your code and do a "dry run", preparing the code for upload but not actually pushing it. Move or copy to screeps.json and edit it, changing the credentials and optionally adding or removing some of the destinations. Screeps Typescript Starter uses rollup to compile your typescript and upload it to a screeps server. Fire up your preferred editor with typescript installed and you are good to go! Rollup and code upload