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

Can't create flag in room with no creeps in it. #24

Open
Mirroar opened this issue Feb 12, 2017 · 8 comments · May be fixed by #53
Open

Can't create flag in room with no creeps in it. #24

Mirroar opened this issue Feb 12, 2017 · 8 comments · May be fixed by #53

Comments

@Mirroar
Copy link

Mirroar commented Feb 12, 2017

Trying to create a flag using RoomPosition.createFlag in a room with no creeps in it fails.

let destinationPos = new RoomPosition(25, 25, roomName);
destinationPos.createFlag(flagName);

Game console output:

Error: Could not access room W3N7
    at . ([...]\steamapps\common\Screeps\server\node_modules\@screeps\engine\dist\game\rooms.js:1444:19)
    at .createFlag (evalmachine.:1:72)
    [...]

Private server version is 2.3.0

@sparr
Copy link
Contributor

sparr commented Sep 27, 2017

You cannot perform any operations on a room in which you have no visibility (creeps or structures).

@TheRealMaxion
Copy link

You can create flags in rooms without vision through the GUI, thus the reasoning why the code should perhaps be able to as well.
Currently your code has to create the flag in a room with vision and then move it to the room that has no vision on the next tick.

@AlinaNova21
Copy link
Contributor

AlinaNova21 commented Sep 27, 2017 via email

@sparr
Copy link
Contributor

sparr commented Sep 28, 2017

@TheRealMaxion I did not know about that trick. Thanks!

@ags131 RoomPosition.createFlag() sounds like a good idea. Any idea why it doesn't already exist?

@TheRealMaxion
Copy link

@sparr it exists but it uses the room object internally

@sparr
Copy link
Contributor

sparr commented Sep 28, 2017

Proposal: move most of the relevant code to RoomPosition.createFlag() and have Room.createFlag() call that, instead of vice versa?

@sparr sparr linked a pull request Sep 28, 2017 that will close this issue
@Strikeeaglechase
Copy link

Any update? The inability to create flags in remote rooms is very annoying.

@sparr
Copy link
Contributor

sparr commented Jun 17, 2023

@Strikeeaglechase Contribution to my PR may help move this along. I wasn't able to get it working before I stopped playing, but it was really close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants