Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added importing steps to readme #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ In devtools, you can run `generateSector('E5S5')` to generate a sector around `E
Generate walls will generate solid rooms surrounding the generated ones, this prevents pathfinding that result from exits leading to the 'void'
On that note, don't leave any room open to the 'void', doing so _will_ cause pathfinding errors

### Importing a map

#### Preperation
Run the command `system.resetAllData()` in your screeps server cli to reset the server.
You'll now have to remove all the game objects from your default map by executing the three following commands in the server cli:
1. `storage.db.rooms.drop()`
2. `storage.db['rooms.terrain'].drop()`
3. `storage.db['rooms.objects'].drop()`

#### Importing
1. Download the map you would like to import from https://maps.screepspl.us/.
2. Open the map tool in your browser and drag-&-drop the downloaded JSON file into the view.
3. Click on the "Save Open" button in the bottom menu (validate the POST request to "/api/maptool/set" in the Network tab of your Developers console, should return an array with the boolean true for each of your map tiles).
4. Reload the map tool in your browser.
5. Open developer console (F12 in Chrome) and run the command `terrain.filter(t => t.terrain == '1'.repeat(2500)).forEach(t => { t.remote = false, t.status = 'out of borders'})`.
6. Now click on "Save Closed" (validate the POST request to "/api/maptool/set" in the Network tab of your Developers console, should return an array with the boolean true for each of your border map tiles). This will correctly store the border rooms around the highway which will be present in for instance BotArena and SWC maps.

#### Post-processing
The imported map data may have included some source and mineral data related to ticks (such as regeneration, invader spawning etc) which you'll want to reset. It is therefore suggested to run the following commands in your server-cli to reset this data:
1. `storage.db['rooms.objects'].update({ type: 'controller' }, { $unset: { reservation: true, safeMode: true, safeModeCooldown:true, safemode: true, ticksToDowngrade: true,ticksToDowngrade:true,user:true }, $set: { level: 0,safeModeAvailable:0 } })`
2. `storage.db['rooms.objects'].update({ type: 'source' }, {$set: { nextRegenerationTime: 50 } })`
3. `storage.db['rooms.objects'].update({ type: 'mineral' }, {$set: { nextRegenerationTime: 50 } })`
4. `storage.db['rooms.objects'].update({ type: 'controller' }, {$set: { ticksToDowngrade: 0 } })`

# Config

Edit `.screepsrc` to configure
Expand Down