How do I make a character move and have dialogue

So I pretty much want the npc to be able to move around and then when you interact with them, they speak and then go back to moving. Something like this:

NPC----------O
! !
! !
! !
! !
O-------------O
Player comes up
O-----NPC-P----O NPC says dialogue
! !
! !
O----------------O
NPC continues one back on their route.
So, how do I do this
Just put message in NPC event on action button and set a route in autonomous movements ("custom" probably)? If I understood corrrectly what you want, it's just the basics. Did you go through the tutorial?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-character-move-and-have-dialogue.182565/