carater walking to wrong coordinates

Started by jpcr, Mon 24/11/2008 15:22:02

Previous topic - Next topic

jpcr

hi All,

i have this simple code :

cEgo.Walk(448, 320, eBlock, eWalkableAreas);

when i run it , it does not go to 448 but to the end of the screen (640).

anybody has an idea what's wrong? would it be a bug?

i use ags 3.1

thanks

jp

GarageGothic

Sounds like you haven't set your game to use hi-res coordinates. Before AGS 3.1, all games - even hi-res ones - used a 320x240 coordinate grid for the room/screen coordinates. This meant that in hi-res games you could only place objects and characters on every second pixel which could be quite annoying. Since version 3.1, we do have native hi-res coordinates for pixel-precise placement. However, the old system was retained as an option to ensure backwards compatibility.

In your case, it sounds like the option "Use low-resolution co-ordinates in script" in the General Settings menu has been set to "true". So in your example, the character is actually trying to walk to the (hi-res) coordinate (896, 640) but gets stopped by the screen edge. Either set it to "false" or divide your coordinates by two (224, 160) to make sure the character moves to the right place.

SMF spam blocked by CleanTalk