QABS Plugin: Ignore other event colliders

Vetmora

Villager
Member
Joined
Aug 15, 2017
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hi guys,

I'm using the QABS suite of plugins: https://forums.rpgmakerweb.com/index.php?threads/qplugins-latest-qabs.73023/

Trying to figure out how to make it so that when an event with the <enemy:X> notetag returns to its original x and y when it can't find the player, that it then ignores other event colliders with a sprite that would be in the way of the path. By default it works when the door event doesn't have a sprite attached. But then when I put the door sprite on it blocks the path.

Not sure if anyone has much experience/knowledge with these plugins but the developer said I would need to edit somewhere in the below code.

Code:
 Game_Event.prototype.findRespawnLocation = function() {
    var x = this.event().x * QMovement.tileSize;
    var y = this.event().y * QMovement.tileSize;
    if (this.canPixelPass(x, y, 5)) {
      this.setPixelPosition(x, y);
      this.straighten();
      this.refreshBushDepth();
      return;
    }
    var dist = Math.min(this.collider('collision').width, this.collider('collision').height);
    dist = Math.max(dist / 2, this.moveTiles());
    var open = [x + ',' + y];
    var closed = [];
    var current;
    var x2;
    var y2;
    while (open.length) {
      current = open.shift();
      closed.push(current);
      current = current.split(',').map(Number);
      var passed;
      for (var i = 1; i < 5; i++) {
        var dir = i * 2;
        x2 = Math.round($gameMap.roundPXWithDirection(current[0], dir, dist));
        y2 = Math.round($gameMap.roundPYWithDirection(current[1], dir, dist));
        if (this.canPixelPass(x2, y2, 5)) {
          passed = true;
          break;
        }
        var key = x2 + ',' + y2;
        if (!closed.contains(key) && !open.contains(key)) {
          open.push(key);
        }
      }
      if (passed) break;
    }
    this.setPixelPosition(x2, y2);
    this.straighten();
    this.refreshBushDepth();
  };
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top