Navigation

    forum

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

    thegreattriscuit

    @thegreattriscuit

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

    thegreattriscuit Follow

    Posts made by thegreattriscuit

    • RE: spawn.createCreep() always returns -6, except from console?

      D'oh!  Leaving this for posterity:

       

      There's a couple places where I did things like `var SPAWN = Game.spawns['Spawn1'];`.

      This only get's ran or updated infrequently (maybe when you push new code?).  NOT every tick.  

      So all my calls were going toward this "stale" version of the object.  

      Moved those things into an `init()` function, and it works!  

      posted in Help
      thegreattriscuit
    • spawn.createCreep() always returns -6, except from console?

      given the following:

          SPAWN = Game.spawns['Spawn1'];
          WORKER = [WORK, WORK, CARRY, MOVE];

          spawning = {

              /** @param {String} role **/
              build: function(role){
                  if(SPAWN.spawning) {
                      return;
                  }
                  console.log(SPAWN.createCreep(WORKER, null, {role: role}));
                  }
          }

       

      From the console (or anywhere else in my code) `spawning.build('builder')` fails (outputting -6).  But in the console I can `SPAWN.createCreep(WORKER, null, {role: role})` and it works fine.  Any ideas?

      posted in Help
      thegreattriscuit