repeat wait [SOLVED]

Started by Candle, Sun 12/12/2004 06:58:06

Previous topic - Next topic

Candle

I would like for it to wait 20 sec and then walk again but if I add  Wait(20); it then turns in to a blocking move and I don't want that .

Code: ags
 // script for room: Repeatedly execute
if (character[LADYTALL].walking == 0) { //if not walking
  MoveCharacterPath (LADYTALL, 183, 98);
  MoveCharacterPath (LADYTALL, 123, 83);
} 

So how can I make it stand for 20 then walk again ?

Radiant

Code: ags


//outside the functions
int state = 0;

 // script for room: Repeatedly execute

if (character[LADYTALL].walking == 0) { //if not walking
  if (state == 0) MoveCharacterPath (LADYTALL, 183, 98);
  if (state == 21) MoveCharacterPath (LADYTALL, 123, 83);
  state ++;
}


Candle

That seems to work a little . it walks to the right then to the left and stops . and I have it in the repeatexecute ?

Gilbert

#3
Did you want her to repeat and repeat, so she's going and going and going?

Try this then:
Code: ags

//outside the functions
int state = 0;

 // script for room: Repeatedly execute

if (character[LADYTALL].walking == 0) { //if not walking
 if (state == 0) {
    MoveCharacterPath (LADYTALL, 183, 98);
    MoveCharacterPath (LADYTALL, 123, 83);
 }
 state ++;
 if (state == 800) state=0; //20 secs=800 loops
}


Candle

Thank you that work fine ..

SMF spam blocked by CleanTalk