Problem with a walk script.

Started by Kiwi, Mon 29/12/2008 04:23:27

Previous topic - Next topic

Kiwi

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.

Khris

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:
Code: ags
  cEgo.ChangeRoom(2, x-coordinate, y-coordinate);   // fill in the coords

Kiwi

#2
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.













I wait from answer hehe.
Thank You.



Gilbert

Did you set a walk-to point? It may be possible that he always walk to that point.

monkey0506

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.

Khris

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.

Kiwi

#6
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.??

Kiwi

I'm so happy, thank you all people try to help me with my problem, but I finally do it.
Thank you very much.

Khris

So for future reference, what did you do to fix it?

Kiwi

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)

Pumaman

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.

SMF spam blocked by CleanTalk