Unexpected Memory Behavior
-
Hi,
I'm new to the game and have been having some weird behavior with memory when spawning new creeps. I'll execute the following line from the console
Game.spawns.Spawn1.createCreep([WORK,WORK,WORK,CARRY,CARRY,MOVE,MOVE],undefined,{job: 'wallrepair', collectMore: true})
But when I check the memory of the new creep, job is 'builder', instead of 'wallrepair'.
I've tried a few things including changing the name of the variable from job to role, type ect. in addition tp using different string for 'wallrepair'. But every time, no matter what is typed in, the job, role, type is always 'builder'. Does anyone have any suggestions.
Thanks
-
My guess is, you have code looking like that somewhere:
if (creep.memory.role = 'builder')
instead of
if (creep.memory.role == 'builder')
-
That was it, Thanks