moveTo to NOT leave room
-
Hi again,
Does anyone know how to force moveTo command work ONLY in the room you're in? At the moment my creeps wish to exit the room (into a walled off area) because they think it's faster than walking through a swamp. I notice room.find has options but unsure of how I would write something for it (if possible)
creep.moveTo(sourceFlag.pos)
http://support.screeps.com/hc/en-us/articles/203079011-Room#find
Thanks,
Primoz
-
set the 'maxRooms' option to '1'.
-
In case it's not clear, any options passed to moveTo will be passed on to findRoute.
-
Thanks, though it still doesn't appear to work - am i using it correctly?
creep.moveTo(sourceFlag.pos, [maxRooms = 1])
-
creep.moveTo(sourceFlag.pos, {maxRooms: 1})
-
awesome thanks that worked