Navigation

    forum

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

    Nerfling

    @Nerfling

    3
    Posts
    702
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Nerfling Follow

    Posts made by Nerfling

    • RE:

      @jbyoshi Thanks for the help; I'm kinda ashamed, seems like the error wasn't caused by _pos_a, but by _pos_b, in my actual code I use the variable "_closest" to find a RoomPosition which i pass to PathFinder.search, i also recently added another variable with the same name wich calculated distance, so in this case _pos_a was correct, but _pos_b was a integral value.

      I'm dumb, I stayed up too long, programmers need sleep too I guess.

      Thanks for your help 🙂

      it works again 🙂

      posted in Technical Issues and Bugs
      Nerfling
    • RE:

      this is an example in game, where i stored _pos_a to the memory, you can see it's filled in correctly, with the right room name, i circled in red where _pos_a square is located

      0_1559918957621_Capture.PNG

      posted in Technical Issues and Bugs
      Nerfling
    • I recently started encountering this error on a private server:

      at parseRoomName (<isolated-vm>:20356:15)
      at toWorldPosition (<isolated-vm>:20408:22)
      at <isolated-vm>:20452:26
      at arrayMap (<isolated-vm>:2645:25)
      at Function.map (<isolated-vm>:7949:14)
      at Object.search (<isolated-vm>:20442:23)
      at Object.search (<isolated-vm>:27254:42)
      

      I simplified the code to the following minimum which still creates the error:

      var _pos_a = new RoomPosition(25, 25, 'W3N7');
      var _pos_b = new RoomPosition(30, 30, 'W3N7');
      
      var _cost_matrix = CostMatrixExit();
      var _path = PathFinder.search(_pos_a, { pos: _pos_b, range: 1 }, { roomCallback: _cost_matrix });
      

      _cost_matrix is a function as follows:

       CostMatrixExit: function ()
      {
          let _cost_matrix = new PathFinder.CostMatrix;
          maxOps = 2000;
          for (var _x = 0; _x < 50; _x++)
              for (var _y = 0; _y < 50; _y++)
              {
                  if (_x < 1 || _x > 49 || _y < 1 || _y > 49)
                      _cost_matrix.set(_x, _y, 255);
              }
          return _cost_matrix;
      },
      

      I'm not sure what has gone wrong, it did work before, for a long time.

      If anyone can help me out I would greatly appreciate it 🙂

      posted in Technical Issues and Bugs
      Nerfling