problem with "MoveCharacterBlocking" command!

Started by plebeo, Mon 06/06/2005 10:02:25

Previous topic - Next topic

plebeo

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!

Gilbert

Don't use MoveCharacterblocking(), use MoveCharacter() instead.

plebeo

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?

Gilbert

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.

Mozesh

#4
EDIT: Oops sorry 'bout that.

Gilbert

That doesn't solve his problem, as it's basically identical to MoveCharacterBlocking().

SMF spam blocked by CleanTalk