Navigation

    forum

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

    Pausbrak

    @Pausbrak

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

    Pausbrak Follow

    Posts made by Pausbrak

    • RE: Creep Death and Respawn

      There are a lot of different ways to do this.  What I do is have a "master controller" that knows how many and what type of creeps it needs for a specific task (e.g. each source in my room has a harvester controller that knows how many harvesters/couriers it should have).  Each controller keeps a list of IDs for the creeps it owns, and every tick it checks to see if the creep is still alive (`Game.getObjectById()` returns null if the creep is dead).  If one or more creeps are dead, the controller asks for a new creep of the same type to be spawned.

      If instead you would rather have creeps respawn themselves, you can do that by storing a creep's information in memory (mostly the body, since everything else should already be in memory).  When a creep dies, the memory entry still exists.  You can iterate through `Memory.creeps` to find any creep that no longer exists in `Game.creeps`.  Once you've found one or more creeps that are dead, you can respawn them using the data in memory.  Note that you need to do this before you spawn any new creeps in a tick, or it will try to "respawn" those newly-created creeps and likely error out.

      posted in Help
      Pausbrak
    • RE: Memory Changed By Another Account - Account Breached

      Happened to me at some point today as well.  It's hard to be sure because my script will partially bootstrap itself, but based on all the missing data I'm guessing my entire memory was wiped.  The extra data that was added seemed to be in the exact same format that was shown in this thread:  http://screeps.com/forum/topic/1221/Memory-Corruption-

      posted in Technical Issues and Bugs
      Pausbrak