Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mathy on Mon 07/04/2008 18:26:41

Title: Walking to an object before executing... Stuff
Post by: Mathy on Mon 07/04/2008 18:26:41
I feel kinda stupid for asking this, but I couldn't find it anywhere, even though it's basic knowledge... *sigh*

Question #1: I want my character to walk to a door, face it and open it. But when I click with Interact cursor on the door, it opens whilst he walks towards it. And on top of it, he doesn't turn around when he reaches it.

My code is the following:

function oFridge1_Interact()
{
cLars.Walk (185,180);
cLars.FaceObject (oFridge1);
oFridge1.Visible = false;
oFridge2.Visible = true;
}


Question #2: I move the character a bit to the left and click the new object (the opened fridge-door) to close it, and he moonwalks back on the old spot.
    Note: At the moment I only have the animations for walking left and right.

My code:

function oFridge2_Interact()
{
cLars.Walk (185,180);
cLars.FaceObject (oFridge2);
oFridge2.Visible = false;
  oFridge1.Visible = true;
  }


Confused...
Title: Re: Walking to an object before executing... Stuff
Post by: Khris on Tue 08/04/2008 01:33:51
In the .Walk command, add the eBlock parameter after the coordinates...
Title: Re: Walking to an object before executing... Stuff
Post by: Mathy on Tue 08/04/2008 06:37:50
Ah, thanks :)