Character.Walk

Started by demophobie, Sun 07/10/2007 13:36:27

Previous topic - Next topic

demophobie

Hi!

I have a problem using Character.Walk.
What i want is (Lucas-Style), that my character automatically walks to where i clicked. And when he arrived his destination, then he for example says something.

I tried the following:

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
    {
    }
  else if (button == eMouseLeft)
    {
    character[MARTY].Walk(mouse.x, mouse.y, eBlock);
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
    mouse.Mode = 0;
    }
}

That works, but in the time he walks i'm unable to give him/her a new command.
There is a option with "eNoBlock" - i thought that would help me - but when i use eNoBlock he doesnt walk anymore.

What did i wrong?

Thanks for your help :-)

Ashen

If I'm understanding your problem correctly, check out Bernie's NoBlock module. It allows you to have 'queued' interactions that don't happen until the character finished walking, but can be cancelled while they're walking - just like the classic games. There's no native way to do that in AGS, unfortunately - if the module isn't quite what you want, at least you might be able to pick up a bit of code from it.
I know what you're thinking ... Don't think that.

demophobie

hey!

Thanks a lot! Thats what i was looking for.

Now all i have to do is to understand how this works. my english is not the best  ;D

demophobie

Hm i tried:

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
    {
    }
  else if (button == eMouseLeft)
    {
    if (mouse.Mode == 0)
               {
          ProcessClick(mouse.x, mouse.y, mouse.Mode);
          mouse.Mode = 0;
          }
    else  {
          NoBlock.Do(mouse.Mode, eLocationHotspot, NoBlock.GetHotXY(mouse.x, mouse.y));
          }
    }
}

But it doesn't work - did i misunderstood something?

demophobie

it doesnt work - its still blocking  ??? ???

SMF spam blocked by CleanTalk