Navigation

    forum

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

    Posts made by Lucio

    • RE: Defining Individual sources

      @lucio

      I figured out that you can't grab the ID straight from the game, i'm trying to push the id's into an array instead. However, it says that room is undefined.

      Note that I am using the training mode in order to play Screeps; I do not have a subscription yet.

      posted in Help
      Lucio
    • RE: Defining Individual sources

      @jbyoshi

      So I'm having trouble saving the id.

      pretend that this is a source id: a15a83d0649349cfc8394ee1

      var source1 = Game.getObjectById('a15a83d0649349cfc8394ee1');

      if(source1 > 0)
      {
          Game.spawns.Spawn1.createCreep([WORK,WORK,MOVE], undefined, {role: 'Driller1'});
      }
      

      I am still trying to figure out how to define a source by its id, any help would be appreciated.

      posted in Help
      Lucio
    • Defining Individual sources

      So I currently have code that defines the amount of sources in a room by using the creep's memory...

      var source = creep.room.find(FIND_SOURCES).;
      var NumberOfSources = source.length;
      

      I'm trying to assign a group/team of creeps to certain sources

      For example: miningTeam1 would go to the closest source, miningTeam2 would go to the second closest source, miningTeam3 would go to the third closest source, etc...

      I'm having trouble finding a way to separate each individual source, any help would be appreciated thanks!

      posted in Help
      Lucio
    • RE: Defining the Amount of Sources in a Room

      Just keep that in mind

      posted in Help
      Lucio
    • RE: Defining the Amount of Sources in a Room

      So the code only seemed to work for a little bit and when I came back it didn't work. I assume its because I didn't spawn any creeps and the creep.room.find(FIND_SOURCES) couldn't be defined without any creeps spawned.

      posted in Help
      Lucio
    • RE: Defining the Amount of Sources in a Room

      @gankdalf Ill see what I can do about your code but I'm going for a way to define the amount of sources and use it anywhere in my code.

      posted in Help
      Lucio
    • RE: Defining the Amount of Sources in a Room

      That works!

      if (numberOfDrills < source.length)
      {
          name = Game.spawns.Spawn1.createCreep([WORK,WORK,MOVE], undefined, {role: 'Driller'});
      }
      posted in Help
      Lucio
    • Defining the Amount of Sources in a Room

      Is there a way to define the amount of sources in a room? If I can then I can spawn an appropriate number of creeps for each source.

      posted in Help
      Lucio