I've tried this:
~~~
player.Walk(45, 270);
Wait(50);
player.ChangeRoom(5);
It works depending on the distance the player has to walk. Is there some way of waiting until he reaches the position?
Just set the character walking command to blocking, like:
player.Walk(45, 270, eBlock);
See:
https://adventuregamestudio.github.io/ags-manual/Character.html#characterwalk (https://adventuregamestudio.github.io/ags-manual/Character.html#characterwalk)
If you don't want to block the game you can try my module:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-gotthere-0-5/
There's also my module in case you run into any issues with Khris's:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-cancellablewalk-1-0/ (https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-cancellablewalk-1-0/)
Thanks, you guys. The block worked fine but I'll check out the modules if there is a problem.
Using a blocking walk will work fine in technical terms; allowing the player to abort the action that takes control away from them is just good game design.