xD
Let say I was tired ^^
Hi,
I was trying to share the energy load to spwan genral purpose creep (as attacker, healer,...) betwen rooms and found something weird..
function checkAttackFlag(tFlags)
{
for(var i = 0; i < tFlags.length; ++i)
{
var defender = _.filter(Game.creeps, (minion) => { return minion.memory.role == 'defender' && minion.memory.target == tFlags[i].name})
var qt = defender.length;
_.forEach(Game.spawns, function(spawn) {
if(!(qt < tFlags[i].memory.qt))
return false;
if(!_.includes(spawnUsed, spawn.name))
{
var newName = Game.spawns.HomeSweetHome.createCreep(defenderLayout[tFlags[i].memory.rank], {role:'defender', criticalStatus:false, target:tFlags[i].name});
if(_.isString(newName))
{
console.log(spawn.name+'=>Spawning new defender('+tFlags[i].name+') '+newName);
spawnUsed.push(spawn.name);
++qt;
}
else
{
console.log("Busy ("+tFlags[i].name+"): "+spawn.name+" | ");
}
}
});
}
}
As you can see 5 creeps were order to be produce but in fact only HomeSweetHome did produce a creep and spawn1 was already producing an other creep but it did return a name and not ERR_BUSY..
Is there a link with loadash I don't know..
Hi,
It could be nice to have a double click when you want to remove a flag like with creeps or structures, because too many time with a miss click when trying to click on "view memory" I delete the flags and I think I'm not the only one ^^
Thanks,
Shadow_Bird
Indeed I'm more interested with distance rather than path because it's only to choose the closest spawn from a flag.. And the pathfinder is very costly.
@cyberblast I didn't have time to check the pathfinder docs and getRoomLinearDistance, yet
Hi,
I'm trying to find the closest objects from an array of objects that could be across differents room.
I tried pos.findClosestByRange but it only work if it's in the same room (The documentation doesn't say it by the way).
Also I tried wit pos.GetRangeTo but it return infinity.
So do we have to process RoomName and calculate by ourself the distance ?
Thanks,
Shadow_Bird
Thanks,
I was writting the scout way but I didn't though about simulating my own ticksToEnd ;).
Hi,
I'm trying to have efficients claimer because at low RCL they are costly. What I'm trying to do is analyze the situation in the targeted room (by a flag) to know if I have to spawn a claimer to make the reservation ticks go up. The problem is that I have no vision in the room so I can't check the controller (I didn't unlock the observer yet), is there any workarround ?
Thanks,
Shadow_Bird
Hey
You could also check for energy available. With every find function you can add a function to filter your research.
var source = spawn.pos.findClosestByRange(FIND_SOURCES, {
filter:(source)=>{ return /*your test here*/ true;}
});
if(!source){/**no sources found, do something else*/}
if(creep.harvest(source) == ERR_NOT_IN_RANGE) {
creep.moveTo(source);
}
http://support.screeps.com/hc/en-us/articles/203079211-Source
Ok, I didn't know that boosted creep drop minerals I only saw energy when I did encountered them
Hi,
I found something strange today, someone did have zynthium hydride stored in a container but he didn't had any lab/terminal and no one in the area have one of them... So how could that be ?
Room history => https://screeps.com/a/#!/history/E52N53?t=12829360