Removes the hint arrow from the client.
-- Create a hint arrow pointing at an npc arround you
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, npc = osrs.ClientOp.getNpcIdByName("Man")})
-- Press Q to clear out the hint arrow
test = function (keycode)
if(keycode == 32) then
osrs.print("Cleared out Hint Arrow")
hintArrow:clear()
end
end
osrs.Events.subscribe(test, osrs.Events.KEY_DOWN)
Retrieves the current mode of the hint arrow.
-- Create a hint arrow pointing at an npc arround you
local playerCoord = osrs.ClientOp.coord()
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, coord = playerCoord})
-- Get the npc's coord
--Sets to be NPC arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_NPC)
osrs.print(hintArrow:getArrowMode())
--Sets to be COORD arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_COORD)
osrs.print(hintArrow:getArrowMode())
--Sets to be Player arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_PLAYER)
osrs.print(hintArrow:getArrowMode())
--Any other value will result in the arrow being set inactive.
--Useful if you want to keep the arrow alive but don't actively want it.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_INACTIVE)
osrs.print(hintArrow:getArrowMode())
Returns the current flash off time of an arrow.
Returns the current flash rate of an arrow.
Returns the coord that the HintArrow is targetting, if TargetMode is set to COORD. Otherwise, returns a Map Coord with -1, -1, -1.
local playerCoord = osrs.ClientOp.coord()
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, coord = playerCoord})
-- Get the targeted coord
local coord = hintArrow:getTargetCoord()
osrs.print("Hint Arrow is currently targetting X: %i, Level: %i, Z: %i: ", coord.x, coord.level, coord.z)
Returns the ID of the player this arrow is targeting.
-- Get the ID of the local player
local wasFound, id = osrs.ClientOp.playerFindSelf();
-- Create a hint arrow with the local player as the target
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, player = id})
-- Get the players ID from the hint arrow
osrs.print(tostring(hintArrow:getTargetPlayer()))
Returns if this arrow is being drawn in the world.
Returns if this arrow is being drawn on the minimap.
Tries to set the "Arrow Mode" of this arrow. The arrow mode represents what type of arrow it is, NPC, Coord, or Player.
Mode to try set arrow to.
-- Create a hint arrow pointing at an npc arround you
local playerCoord = osrs.ClientOp.coord()
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, coord = playerCoord})
-- Get the npc's coord
--Sets to be NPC arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_NPC)
osrs.print(hintArrow:getArrowMode())
--Sets to be COORD arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_COORD)
osrs.print(hintArrow:getArrowMode())
--Sets to be Player arrow.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_PLAYER)
osrs.print(hintArrow:getArrowMode())
--Any other value will result in the arrow being set inactive.
--Useful if you want to keep the arrow alive but don't actively want it.
hintArrow:setArrowMode(osrs.HintArrow.ArrowMode.ARROW_INACTIVE)
osrs.print(hintArrow:getArrowMode())
Overrides the default rate at which the arrow flashes in client ticks. An off time higher than the flash rate will result in the arrow not appearing at all, but if you want to turn off an arrow temporarily use :setArrowMode(0) instead.
Actual math is:
(clientTick % flashRate) < offTime
Set whether this arrow is drawn in the world (Above tiles, NPC, or Player).
State to set this boolean.
Set the sprite of the Hint Arrow to the given sprite ID.
The ID of the sprite to assign to arrow.
Set whether this arrow is drawn on the minimap.
State to set this boolean.
Set the target coord this arrow is targeting.
A osrs.MapCoord representing the Height, X, and Z of the arrow.
-- Create a hint arrow pointing at a specified MapCoord
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, coord = osrs.MapCoord.new(-1,-1,-1)})
local coord = hintArrow:getTargetCoord()
osrs.printf("Hint Arrow is currently targetting X: %i, Level: %i, Z: %i: ", coord.x, coord.level, coord.z)
local playerCoord = osrs.ClientOp.coord()
hintArrow:setTargetCoord(playerCoord)
-- Get the targeted coord
coord = hintArrow:getTargetCoord()
osrs.printf("Hint Arrow is currently targetting X: %i, Level: %i, Z: %i: ", coord.x, coord.level, coord.z)
Set the NPC this arrow is targeting.
ShortID for the NPC in the world.
Set the player this arrow is targeting.
ID of the player to target.
-- Create a hint arrow with an empty player to target
local hintArrow = osrs.HintArrow.new({sprite = 123, drawInWorld = true, player = -1})
-- Get the ID of the local player
local wasFound, id = osrs.ClientOp.playerFindSelf();
-- Set the hint arrow target to the local player
hintArrow:setTargetPlayer(id)
This section is for hintArrows, arrows that are on the minimap and in the world that help draw attention to specific characters and areas. Everyone has played a game where there is a huge “?” above a character's head.
That question mark is really a hintArrow letting you know to talk to that specific character. Let's go over how you can create your own hint arrows for your plugin.
There are two different types of hintArrows you can make: a character hintArrow or a location hintArrow. A character hint arrow will appear on top of a player’s or npc’s head and follow them around, whereas a location hint arrow will appear at a specific location or coordinates in the game world. When you create a hintArrow, you can choose which type it will be with the hintArrow properties.
You also have the ability to customize what you want your hintArrows to look like. A hintArrow is able to look like any sprite (image) that is currently in the game, and it can also be customized using its function properties.
Once a hintArrow is created and drawn into the world there are a multitude of methods you can use on it. You can make the hintArrow blink on and off screen at different rates (setFlashRate), change its position (setTargetCoord), change the character it is following (setTargetNpc), change how it looks (setNewSprite), and much more. Have fun playing around with hintArrows, and have your plugin lead players to all kinds of fun locations or funny NPC’s.
Hint Arrows can be used for placing directional arrows on the minimap and in the world to draw attention to certain areas. Eventually placing them on the world map will be supported.
Passing an empty table will result in an inactive arrow object which can still be manipulated later. Arrows are intended to point at a single target so only pass a table with either coord, player, or npc, not all of them.
However if you do pass a table with more than one the order the "Arrow Mode" is set is coord -> player -> npc, so top priority is always NPC. Below is the full table you could pass into the .new function.