So, I have been working on a little game that is testing out the mouse. I was wondering if you could script it so that when you click on an NPC, something would happen, like you could show a text box, move them with the mouse as long as the left button is held down, or when they get clicked on, they move to a new tile. Is any of this possible?
Use the "NPC at pixel" command. If your mouse cursor is a slice rather than an NPC, it's even easier, because it won't return the cursor NPC. For example.
Code:
if (mouse click (left button)) then (
variable (npc ref)
npc ref := npc at pixel(mouse pixel x, mouse pixel y)
if (npc ref) then (
# something!
)
)
variable (npc ref)
npc ref := npc at pixel(mouse pixel x, mouse pixel y)
if (npc ref) then (
# something!
)
)



