Navigation

    forum

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

    Posts made by LogicalKip

    • RE: Questions about market system

      Thanks for your answer, it helps a lot.

       

      For X and Y, I was talking about minerals, energy, or subscription tokens.

      Also, in your example, do you confirm remaining amount is 10k, and not 9k (since it's the 'leftover') ? Does that value change when someone buys some ?

       

      What about when I place a buy order ? I guess remainingAmount is how many I want to buy, but for amount (or the other way around), surely it can't mean the same thing as before, as I can't "only have 1k in the terminal right now". I'm buying some, doesn't matter what I have. Is it the credits I have ? Or how many I could afford, based on the credits I have and the price I propose ? Or maybe how much space is left in the terminal ? Something else entirely ?

      Seems to me the documentation could use an update and a bit more accuracy.

      posted in Help
      LogicalKip
    • Questions about market system

      I already went to the documentation but couldn't find my answers.

      What is the difference between amout and remainingAmount ? What about when it's buy, and when it's sell ? I thought I could think of a meaning, but remainingAmount is not even the lesser one when the values are different, as I would expect.

      Also :

      Can you buy X and sell Y in the same tick ?

      Can you buy X and sell X in the same tick ?

      posted in Help
      LogicalKip
    • Did your creeps start going into other rooms on their own ?

      My creeps sometimes go into the next (unoccupied) room, wait at the controller, and die slowly. It was even worse when a player was still in that room, because my creeps would just get shot and it looked like an attack (if you read this, I'm sorry !).

      I'm not asking you to debug any code, that would be too laborious. I'm just hoping someone had a similar problem, so that their solution will give me an idea of what's wrong.

      The only reasons to go in other rooms are for the specialized creeps : capture a room (minimal body) and die, and get some energy to a designated "needy" room (massive body). But no room is designated and those going have typical bodies 😞

      I'm a fairly new player (3/3 rooms, started summer 2016 and don't play often), so there isn't that much complexity in my code, but I can't figure out why they do that ; especially since it's not always, I can't debug.

      Any ideas, stories ?

      posted in Help
      LogicalKip
    • RE: How can I detect that I have respawned ?

      This is what I managed to get :

      function newGame() {
          let roomNames = _.keys(Game.rooms);
          let res = false;
          if (roomNames.length === 1) {
              let onlyRoom = Game.rooms[roomNames[0]];
              if (typeof onlyRoom.memory.newGame === "undefined") {
                  for (let oldRoom in Memory.rooms) {
                      delete Memory.rooms[oldRoom].newGame;
                  }
                  res = true;
                  onlyRoom.memory.newGame = false;
              }
          }
          return res;
      }

       

      Haven't tested it much, but it looks fine, especially since you can hide the ugliness behind a nice if (newGame()).

      Bonus : it should not return true after massive attacks, leaving you with 0 screeps and only a spawn, which could make it look like it's a start.

      Mega bonus : it should work even if you spawn in a room you used to own.

      posted in General Discussion
      LogicalKip
    • RE: How can I detect that I have respawned ?

      Well yeah, that's more or less the boolean I was talking about. That works the first time, but in Screeps, Memory remains the same unless told otherwise, doesn't it ? When I respawn after that, Memory.some.random.thing will still keep its value, and therefore won't go in the if, right ? Or am I missing something ?

      posted in General Discussion
      LogicalKip
    • How can I detect that I have respawned ?

      Hi,

      I would like to do certain things once, every time I respawn in the multiplayer world : some computations, set ups and such, but I can't find a way to do it. Game.time==0 only works in simulation, because the ticks keep going in multiplayer.

      What I've done so far feels weak and isn't automatic : manually setting a boolean in the console every time I restart.

      Any ideas ? Have you ever needed this ?

      posted in General Discussion
      LogicalKip