Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: burakaxx on Mon 15/11/2004 16:00:35

Title: =Problem with the Move character code
Post by: burakaxx on Mon 15/11/2004 16:00:35
 
in my game, when control on the main char(EGO) some other char(TAM) must go to some specific point(x =100 ,y=185) without blocking and when he arrives he must say something  meanwhile controls have open in main character.i cant use move blocking code of course but in the move other codes, (TAM) first make speech and doesn't move there   i tried  if (character[TAM].x=100) or getcharacterat commands to control specific point i also tried  some varieble for same location but no......   pls help
   here is the copy of script

SetCharacterView(3,23);
MoveCharacterDirect(3,100,185);
if ((character[TAM].x==100)&&(character[TAM].y==185)) {
DisplaySpeech(3,  "string...");
MoveCharacterToHotspot(3,4);
}
Title: Re: =Problem with the Move character code
Post by: Radiant on Mon 15/11/2004 16:59:12
What you should do is, either use

while (character[TAM].walking) Wait (1);


Or, check the values in your repeatedly_execute function

Title: Re: =Problem with the Move character code
Post by: burakaxx on Mon 15/11/2004 17:05:43
 i solved the problem codes was correct  but like this i learned it new

MoveCharacterDirect(3,100,185);
   if ((character[TAM].x==100)&&(character[TAM].y==185)) {
     DisplaySpeech(3, "  ");
     MoveCharacterToHotspot(3,4);
   }
Title: Re: =Problem with the Move character code
Post by: Ishmael on Mon 15/11/2004 18:04:11
I didn't quite get have you solved the problem or not..?

Anyway, in case you haven't, use the room repeadetly_execute function and enter this:

  if ((character[TAM].x==100)&&(character[TAM].y==185)) {
     DisplaySpeech(3, "  ");
     MoveCharacterToHotspot(3,4);
  }

in there. You just gotta make sure the character doesn't walk to this point at any other time.