Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. dogzilla3
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    dogzilla3

    @dogzilla3

    2
    Posts
    1026
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    dogzilla3 Follow

    Posts made by dogzilla3

    • RE: Memory.creeps have no names?

      Ah! Thanks, I think I figured it out... correct me if Im wrong. The .name is a property of the creep instance. Which is not what is stored in memory. So when I call memCreeps[deadCreep].name Im attempting to access the .name property of the of the creep's memory instead of the creep instance. Which will obviously error because the creep's memory doesnt contain a name property.

      posted in Help
      dogzilla3
    • Memory.creeps have no names?

      Not sure what is going on here but when I try to iterate through my creeps in memory I an unable to do anything useful with them... i.e. access their memory and what not.

      Any ideas?

       

      var memCreeps = Memory.creeps;
      console.log(JSON.stringify(memCreeps)); //outputs as expected


      for (var deadCreep in memCreeps)

      {
      console.log("Creep: " + memCreeps[deadCreep].name); //outputs "Creep: undefined
      var spawn = Game.getObjectById(memCreeps[deadCreep].homeSpawnID);
      console.log(spawn.name); //Throws an error
      }

      posted in Help
      dogzilla3