Tutorial Issue - Assigning Roles



  • Hello,

    In the Tutorial, there is a step to assign roles to creeps. The "Code Tip" is something like:

    Game.creeps.Worker1.role = 'harvester';
    Game.creeps.Worker2.role = 'harvester';
    Game.creeps.Builder1.role = 'builder';
    

    And does not work, but this does:

    Game.creeps.Worker1.memory.role = 'harvester';
    Game.creeps.Worker2.memory.role = 'harvester';
    Game.creeps.Builder1.memory.role = 'builder';
    

  • Dev Team

    I guess you are talking about this step:

    Memory.creeps.Worker1.role = 'harvester';
    Memory.creeps.Worker2.role = 'harvester';
    Memory.creeps.Builder1.role = 'builder';
    

    Note the Memory global object, not the Game object.



  • Oops. Yes, I meant to say the Memory object method is not working, in ADDITION to Game.creeps.Worker1.role.

    I noticed this always happens at the Tutorial point where you begin building roads. The very first time I went through the tutorial, I was able to start building the roads, but was receiving emailed error messages from the server, for not building my spawn1 in the regular game.

    After I came back to the Tutorial, these errors started happening.

    Memory.creeps.Worker1.role = 'harvester';

    results in:

    [1:58:39 PM] TypeError: Cannot read property 'Worker1' of undefined
    at _console1434229119212_0:1:5332
    at Object.c.runCode:5:30325

    Just as this doesn't work:

    Game.creeps.Worker1.role = 'harvester';
    < harvester
    Game.creeps.Builder1.role = 'builder';
    < builder
    Game.creeps.Builder1.role;
    < undefined
    Game.creeps.Builder1.memory.role;
    < undefined



  • Also,

    After arriving at the point of the Build Roads tutorial step, the Memory editor cannot be used to reassign the roles--the changes do not persist.

    The Memory object appears to not work--at all.

    Memory.creeps = { Worker1 : { role: 'harvester'}, Worker2 : { role: 'harvester'}, Builder1 : { role: 'builder'}};
    < [2:14:49 PM] Found Harvester.
    < [2:14:49 PM] Found Harvester.
    < [2:14:49 PM] Found Builder.
    < [object Object]
    JSON.stringify(Memory);
    < {}
    JSON.stringify(Memory.creeps);
    < undefined


  • Dev Team

    This must be fixed now.