Timed Loop Scripting Nightmare

Started by danatemachine, Sat 27/08/2005 07:15:22

Previous topic - Next topic

danatemachine

So I have tried many different things and none of them have worked, so rather than waste endless time writing them all here let me see what someone else might do.

Here it is:

When inventory item is used on hotspot, EGO automatically moves to the side, and a bird moves across the screen.  THats all simple, heres the hard part.  I want the bird to "eat seed view" for 5 seconds, then change to "look around view" for 5 seconds.  THen cycle back to eating again.  I want this too loop forever except when you leave the room, catch the bird, or it sees you walking.  If it sees you walking it flies away.  The object is so that you have to walk while its eating, then pause while its looking, then walk again untill you're close enough to grab it. 

WHEW thats alot.   Thanks for any help.

Pumaman

At the top of the room script, put something like:
int currentBirdActivity = 0;


In the room's Repeatedly Execute event, you can put someting like:

if (oBird.Animating == false) {
  if (currentBirdActivity == 0) {
    oBird.Animate( eating seed view );
    currentBirdActivity = 1;
  }
  else {
    oBird.Animate( look around view );
    currentBirdActivity = 0;
  }
}

SMF spam blocked by CleanTalk