OSRS Plugin API
    Preparing search index...

    Class CollisionMap

    Index

    Constructors

    Methods

    • Gets the bitflags for the specified point.

      Parameters

      • x: number

        x-coordinate for the point.

      • z: number

        z-coordinate for the point.

      Returns number

      local playerCoord = osrs.ClientOp.coord()
      local map = osrs.World.getCollisionMap(playerCoord.level)
      local selectCoord = playerCoord:move(0,4,4)
      osrs.ClientOp.highlightTileOn(selectCoord:toBitPacked(), 6, true);
      local flags = map:getBitFlags(selectCoord.x, selectCoord.z)
      if(osrs.Math.Bitwise.isSet(flags, osrs.CollisionFlag.SQ_BLOCKED)) then
      osrs.print("Tile blocks movement")
      else
      osrs.print("Tile does not block movement")
      end
    • Returns whether there is a line of sight from the starting point to the end point. Returns false if not in direct line of sight.

      Parameters

      • x1: number

        x-coordinate for the start point.

      • z1: number

        z-coordinate for the start point.

      • x2: number

        x-coordinate for the end point.

      • z2: number

        z-coordinate for the end point.

      Returns boolean

      local playerCoord = osrs.ClientOp.coord()
      local map = osrs.World.getCollisionMap(playerCoord.level)
      local endCoord = playerCoord:move(0,4,4)
      osrs.ClientOp.highlightTileOn(endCoord:toBitPacked(), 6, true);
      if(map:lineOfSight(playerCoord.x, playerCoord.z, endCoord.x, endCoord.z)) then
      osrs.print("Can see tile")
      else
      osrs.print("Can not see tile")
      end
    • Returns whether it is possible to walk from the starting point to the end point. Returns false if not walkable or if the given coordinates are on different levels.

      Parameters

      • x1: number

        x-coordinate for the start point.

      • z1: number

        z-coordinate for the start point.

      • x2: number

        x-coordinate for the end point.

      • z2: number

        z-coordinate for the end point.

      Returns boolean

      local playerCoord = osrs.ClientOp.coord()
      local map = osrs.World.getCollisionMap(playerCoord.level)
      local endCoord = playerCoord:move(0,4,4)
      osrs.ClientOp.highlightTileOn(endCoord:toBitPacked(), 6, true);
      if(map:lineOfWalk(playerCoord.x, playerCoord.z, endCoord.x, endCoord.z)) then
      osrs.print("Can walk to tile")
      else
      osrs.print("Can not walk to Tile")
      end