javascript - Screeps - Unable to access Creep Memory -


i'm relatively new screeps, , i've been working towards building own basic ai system. however, i've run snag in initial testing. have script determines jobs do, , creeps request available jobs. i've been able store job object creep's memory, cannot recall later.

i can confirm in memory tab of information there, , stored correctly, when try access it, ever undefined.

this memory looks once it's set

i create jobs using template function:

jobfactory: function()     {         // generates blank job template         var job = {             'id': null,     // id of job double id of target                                       (ie. energy source id)             'type': null,   // used classify job tickets extent             'spots': 0,     // total # of creeps can assigned             'workers': []   // current # , ids of creeps assigned         };         return job;     }, 

then i'm able store fine with: creep.memory.job = job;

how i'm trying access is: console.log("creep job: " + creep.memory.job);

i've compared game tutorial, , life of me can't seem figure out why can't access object memory.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -