Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Thu 18/03/2004 22:14:52

Title: interfere with animated action
Post by: spook1 on Thu 18/03/2004 22:14:52
In my game at e certain point you find a pot of boiling substance. you have to take it of the fire, before it explodes.

I cannot script this.

If I do not use animateobjectex(..,..,..,..,..,1); to block the animation I cannot see the animation.

When I do block it, it plays all the way down to the explosion.

is there a a way to stop an animation halfway??

here is what i tried:

   if(viewnumber == 1){
//Display("startniceboiling");
       Wait(60);
       i=1;
       while(i<2){
       SetObjectView(0,10);
       AnimateObjectEx(0,0,10,0,0,1);  // nice boiling
       i++;
       }
       Display("Nice boiling starmix is ready!! You are wonderfull.");
      }
      if(viewnumber == 2){
//Display("startexplosion");
       i=1;
       SetObjectView(0,10);
//            while(i<150){
              AnimateObjectEx(0,1,10,0,0,1);
//          i++;
//          Wait(1);
//       }
       
           Display("Game over");
       QuitGame(0);
      }   

thanks in advance
Title: Re:interfere with animated action
Post by: Darth Mandarb on Fri 19/03/2004 06:57:38
I think your best bet would be to set a timer when the room loads.

If you don't have the object in inventory before the timer expires you play the explosion.

If you get the item before the timer expires you disable the timer.

Look up 'SetTimer' in the help file.  It's pretty easy to understand.

Good luck!

~ d
Title: Re:interfere with animated action
Post by: spook1 on Fri 19/03/2004 07:25:57
OK, but my next problem is: I cannot perform any action while animation is running at the same time.

How can I start an animation but stop it (e.g. by obtaining an invetory) before it is finished?
Title: Re:interfere with animated action
Post by: Scorpiorus on Tue 06/04/2004 19:50:06
QuoteHow can I start an animation but stop it (e.g. by obtaining an invetory) before it is finished?
What if you try SetObjectView (0, 10). That should stop it.

~Cheers