Little code help.

Started by Candle, Wed 26/10/2005 01:33:47

Previous topic - Next topic

Candle

I have Melt come in the room and CHEF walk in and say the message.
But when I add the message he just says the message and never walks in?

Code: ags
Wait(80);

  if (character[CHEF].walking == 0) {
    MoveCharacter(CHEF, 93, 127);
  }  
character[CHEF].Say("Well Melt what can I do for you today");
 

I tried it with in the } but it still did it.

Gilbert

Use MoveCharacterBlocking() instead, otherwise the speech will be displayed before he walks.
Also, are you sure that when that "if" line was executed the character was not walking? Otherwise the "character[CHEF].walking==0" part won't work.
Check also if the character is standing on a non-walkable area, you need to Use MoveCharacterDirect() (or set the direct parameter in MoveCharacterBlocking() ) to walk on non-walkable areas.

Candle

Well he was moving just fine till I added the talking part. I'll try the MoveCharacterBlocking() and see what happens.
That did the trick .
thanks.

Gilbert

and I didn't notice until now, I thought you're using V2.62, but from that .Say() part you're using V2.7+, so it's recommended to use V2.7 style scripting for more readible codes, like:
Code: ags

Wait(80);

 Ã, if (cChef.Moving == 0) {
 Ã,  Ã, cChef.Walk(93, 127, eBlock);
 Ã, } Ã, 
cChef.Say("Well Melt what can I do for you today");

Candle

Ok will do . thanks again.

SMF spam blocked by CleanTalk