move to then display message

Started by AntoPolo, Thu 07/05/2009 11:21:44

Previous topic - Next topic

AntoPolo

hi im new here so thank you for all the help that im sure i will get.

ok so ive got this bit of script:

function comp_Look()
{
player.Walk(229, 162);
Display("it says .........");
}

what im confused about is it does what i want it to do but not in the order i want it to. i want the player to walk to it and then display the message, instead it displays the message and then moves to it.

what have i done wrong?

Khris

To quote the manual:

QuoteCharacter.Walk(int x, int y, optional BlockingStyle, optional WalkWhere);

...

If blocking is eNoBlock (the default) then control returns to the script immediately, and the character will move in the background.

If blocking is eBlock then this command will wait for the character to finish moving before your script resumes.

Thus, you need to do:

Code: ags
function comp_Look()
{
  player.Walk(229, 162, eBlock);
  Display("it says .........");
}

AntoPolo

thank you ;D . im sure that isnt in my manual ive looked several times  :P


SMF spam blocked by CleanTalk