Hello everybody!
I am new to the game and haven't done much JavaScript. But I am enjoying it a lot and am using the forum and StackExchange to slowly work my way forward. Today I encountered one problem that I think was worth asking abut here:
I use two calls to list certain creeps, but I get very different behaviour of the resulting (arrays?)
Game.spawns.Spawn1.room.find(FIND_CREEPS, {filter: function(object) {return object.memory.role == 'Harvester'}});
//Returns all Harvesters in the room, as expected. Individual elements of the result can be passed to creeps as commands
or
_(Game.creeps).filter({ memory: { role: 'Harvester' }});
//Returns all my Harvesters in the world, as expected. But individual elements are not recognized by commands to other creeps.
Can anyone tell me what's going on here?
Thanks a lot in advance!