Walking to an object before executing... Stuff

Started by Mathy, Mon 07/04/2008 18:26:41

Previous topic - Next topic

Mathy

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:

Code: ags
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:

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


Confused...

Khris

In the .Walk command, add the eBlock parameter after the coordinates...


SMF spam blocked by CleanTalk