Navigation

    forum

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

    GuardianGD

    @GuardianGD

    1
    Posts
    676
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    GuardianGD Follow

    Posts made by GuardianGD

    • My creep spawning code doesn't work

      My code is

      create:function(spawn,name,energy,data) { var partNum; var body = []; partNum = Math.floor(energy/250); for(var i = partNum;i > 0;i--) { body.push(WORK); body.push(CARRY); body.push(MOVE); body.push(MOVE); } body = body.sort().reverse() //console.log(body,name,JSON.stringify(data)) var ret = spawn.spawnCreep(body,name,{memory:data}); console.log(ret) return ret; }

      It doesn't work and it returns ERR_INVALID_ARGS.
      Also, in training room, it totally works!....

      • spawn is the structureSpawn object, object type
      • name is name of creep, string type ex) "W0 Spawn1"
      • data is memory of creep, object type ex) {role:"harvester"}
      • energy is the usable energy to spawn creep, int type
      • body is the creep's body array ex) [WORK,WORK,CARRY,CARRY,MOVE,MOVE,MOVE,MOVE]
      posted in Technical Issues and Bugs
      GuardianGD