Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kiwi on Mon 29/12/2008 04:23:27

Title: Problem with a walk script.
Post by: Kiwi on Mon 29/12/2008 04:23:27
Hi, I'm new on this great page.
Ok, this is my problem.
I start to create a new game with AGS 3.1, all is going right but when I Use this script:

function oPuertaChoza_Interact()
{
cJoe.Walk(320, 237, eBlock, eWalkableAreas);
cJoe.Say("Tock Tock, I can inside of House?");
cEgo.Say("Come in");
}

Joe (my character) walk an other position. I Change eBlock to eNoBlock and nothing change, I change eWalkableAreas to eAnyWhere and he walk to all room, except to the position I want.

I need help, please.
This is I want:
Joe interact with the door, Joe walk to 320x 237y, Joe Said: Tock Tock, i can inside of house?, Roger said: Come in, and Joe change to the room 2.

I wait from the answer, hehe

PS: Sorry for my english, but I speak spanish and English it's dificult for me.
Title: Re: Problem with a walk script.
Post by: Khris on Mon 29/12/2008 11:21:07
So the only problem is that he doesn't walk to 320, 237, right?
(If you use eNoBlock, the script will continue right away, so that's not an option.)

You said he's walking somewhere else; did you draw the walkable areas correctly? Do they cover 320, 237?
Make sure you didn't by accident draw a hotspot or a walkbehind.

320 seems strange, are you making a hires game (room width = 640)?

The rest of your script looks fine, the only thing missing is the room change:
  cEgo.ChangeRoom(2, x-coordinate, y-coordinate);   // fill in the coords
Title: Re: Problem with a walk script.
Post by: Kiwi on Mon 29/12/2008 15:44:46
Thank you, yes, that is a Problem, the walkable areas are correctly, they cover 320, 237.
I try the same thing in other room, but nothing change, I give you images of my test of the problem.

(http://img228.imageshack.us/img228/9895/01xs4.jpg) (http://imageshack.us)
(http://img228.imageshack.us/img228/01xs4.jpg/1/w800.png) (http://g.imageshack.us/img228/01xs4.jpg/1/)

(http://img228.imageshack.us/img228/3646/16749200ym1.jpg) (http://imageshack.us)
(http://img228.imageshack.us/img228/16749200ym1.jpg/1/w800.png) (http://g.imageshack.us/img228/16749200ym1.jpg/1/)

(http://img115.imageshack.us/img115/421/84520994fm8.jpg) (http://imageshack.us)
(http://img115.imageshack.us/img115/84520994fm8.jpg/1/w800.png) (http://g.imageshack.us/img115/84520994fm8.jpg/1/)

(http://img120.imageshack.us/img120/1482/64278587qs1.jpg) (http://imageshack.us)
(http://img120.imageshack.us/img120/64278587qs1.jpg/1/w1280.png) (http://g.imageshack.us/img120/64278587qs1.jpg/1/)

I wait from answer hehe.
Thank You.


Title: Re: Problem with a walk script.
Post by: Gilbert on Mon 29/12/2008 16:02:37
Did you set a walk-to point? It may be possible that he always walk to that point.
Title: Re: Problem with a walk script.
Post by: monkey0506 on Mon 29/12/2008 16:07:05
Based on the screenshots...is your game in 320x200 resolution? Because the co-ordinates he's actually walking to seem like they match (188, 196) in a 320x200 room pretty well. It seems to me that maybe you're using the 2x Filter?

Filtering doesn't actually change the co-ordinate system, it only makes the graphics appear larger on-screen.
Title: Re: Problem with a walk script.
Post by: Khris on Mon 29/12/2008 16:38:33
It seems you're using an older version which still allows a resolution setting of 640x400 to play a 320x200 game.
That should be avoided like the plague because it screws up all kinds of things.

You're wildly mixing lowres and hires anyway it seems (your character seems to be drawn for 640 while a few objects and Roger are drawn for 320).
Decide on a resolution, then set that in General settings.
Title: Re: Problem with a walk script.
Post by: Kiwi on Mon 29/12/2008 17:36:12
Quote from: Gilbet V7000a on Mon 29/12/2008 16:02:37
Did you set a walk-to point? It may be possible that he always walk to that point.

No, I don't set a Walk to point, I only set Walk to point in hotspots. mm now I think it, If I set a Walk-to point on hospot, Maybe this is my problem?

PS: My English it's good?? My encglish not is very good. For people read my post, You understood me.??
Title: Re: Problem with a walk script.
Post by: Kiwi on Tue 30/12/2008 03:31:44
I'm so happy, thank you all people try to help me with my problem, but I finally do it.
Thank you very much.
Title: Re: Problem with a walk script.
Post by: Khris on Tue 30/12/2008 10:21:06
So for future reference, what did you do to fix it?
Title: Re: Problem with a walk script.
Post by: Kiwi on Tue 30/12/2008 16:52:17
I only use Left-Click on the co-ordinates I want, and in the scrip I write :

player.walk("here I paste the co-ordinates", eblock, walkableareas);

that is all. :P

Then all  my walk script go right. ;D

I wish for all in this web page, Happy New Year. 8)
Title: Re: Problem with a walk script.
Post by: Pumaman on Tue 30/12/2008 20:47:41
In the General Settings window, check the "Use low-resolution co-rdinates in script" setting. It looks like you may have accidentally enabled this, which makes AGS use 320x200-style co-ordinates. That means that you would need to halve all the X and Y numbers you are using.