I am creating a grid based rpg and I have problems with creating enemy AI. I havent found any examples which could help me. If you have any ideas/examples please tell me. Thanks in advice.
"creating enemy AI" is a bit vague. What exactly will they do? A simple pathfinding can be done with the rts behavior or by implementing the A* algorithm. http://en.wikipedia.org/wiki/A*_search_algorithm
One tip I can pass along is that in order to know where something is, you have to know where it isn't. The array object is very practical in that regard.
I want npc move towards player if they have player in LOS (i know how to do that). But the problem is that I want them to move not just randomly but using grid movement.
Develop games in your browser. Powerful, performant & highly capable.
I've found this game and I want to know how did he managed to do the enemy AI: scirra.com/forum/griddy-rpg_topic43858.html
If you want to know how Nillo made it, I'd say, simply ask him ;)
A simple example showing how to move objects grid-based can be learned here:
Grid Movement Alternative.cap
I made it as an example for another issue, so it's just a basic hint, something to start with. It does not use the grid movement behavior, that makes it versatile.