Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: plebeo on Mon 06/06/2005 10:02:25

Title: problem with "MoveCharacterBlocking" command!
Post by: plebeo on Mon 06/06/2005 10:02:25
Hi everybody!
I have a question:

We all know that with The command "MoveCharacterBloking" we are able to move our character near a object or hotspot after that we have selected a command (like "open" or "use).

I wanna explain the problem with an example:

I give an order to my character like "Open door"!
The character begins to move near the door but during this action, I decide to change command and I select "open window"!
Now I want that my character walks immediately to the window and leaves the previous action!
How can I do this?

Thanks!
Title: Re: problem with "MoveCharacterBlocking" command!
Post by: Gilbert on Mon 06/06/2005 10:11:44
Don't use MoveCharacterblocking(), use MoveCharacter() instead.
Title: Re: problem with "MoveCharacterBlocking" command!
Post by: plebeo on Mon 06/06/2005 10:17:25
I explain better:

I want that the character "moves" and "speaks" near the object I have choose!
If I use "MoveCharacter" and then "DisplaySpeech..", the character only speaks and don't move!

there is another way to do this?
Title: Re: problem with "MoveCharacterBlocking" command!
Post by: Gilbert on Mon 06/06/2005 10:26:53
In that case it's a more complicated problem which possibly involves more scriptings.
One way around it is to use a variable to keep track on the characters's action.
Something like on top of the room script:
int egoaction;

When you have to move the character to a hotspot or whatever, just use MoveCharacter() and set the variable to some value.
For example:
MoveCharacter(EGO, 100,50);
egoaction=1; //For other action set it to other value


Then in repeatedly execute event of the room, script something like:
if (character[EGO].walking==0)
Ã,  if (egoaction==1) {
Ã,  Ã,  DisplaySpeech(blah bla bla)
Ã,  Ã,  egoaction=0; //resets it
Ã,  } else if (egoaction==2) {
Ã,  Ã,  //some other stuff for other actions
Ã,  Ã,  egoaction=0;
Ã,  } ...
}


However, since it's considered a more technical scripting stuff it's not recommended to make things complicated like this for first time games, until one is more familiar with the engine. There may be simpler solutions though.
Title: Re: problem with "MoveCharacterBlocking" command!
Post by: Mozesh on Mon 06/06/2005 11:46:58
EDIT: Oops sorry 'bout that.
Title: Re: problem with "MoveCharacterBlocking" command!
Post by: Gilbert on Mon 06/06/2005 12:00:31
That doesn't solve his problem, as it's basically identical to MoveCharacterBlocking().