Community

AGI Programming => Mega Tokyo AGI Archive => Topic started by: Zonkie on December 11, 2002, 10:07:29 AM

Title: Timed playing of views
Post by: Zonkie on December 11, 2002, 10:07:29 AM
I'm not into AGI countdown variables yet, but I have a question about them, which I hope you can help me with: I have an animation that is supposed to be repeated, but not on a regular basis. I want it to be played every 30 seconds or so. How would I be able to program a countdown that would make the view play every set number of seconds? And also, I noticed that I can't end.of.loop a view a few times after each other, for example to play an animation three times only, using an incrementing variable in between. What would I have to do here?

Thank you for your help,

Zonkie
Title: Re:Timed playing of views
Post by: Jelle on December 11, 2002, 10:21:19 AM
Quote
And also, I noticed that I can't end.of.loop a view a few times after each other, for example to play an animation three times only, using an incrementing variable in between. What would I have to do here

Well, I don't know if this is the best solution, but I know that in PQ2, they do it like this:

Code: [Select]
if (said("do","animation") && !f100) {
  set(f100);
  animate(o1);
  //blabla

  start.cycling(o1);
  v100=0;
}
v100++;

if (v100==50) {
  reset(f100);
  stop.cycling(o1);
}

You don't know how long (in seconds) it will cycle, but you can say how many times you do a certain loop... If a loop has 5 cels, and you wait until v100 = 50 then the loop will be cycled 10 times (each cel will be displayed 10 times)

If you want the loop being drawn on a random moment, do this:

Code: [Select]
if (!f100) {
  random(0,20,v101);
  if (v101==0) {
    set(f100);
    animate(o1);
    //blabla

    start.cycling(o1);
    v100=0;
  }
}

v100++;

if (v100==50) {
  reset(f100);
  stop.cycling(o1);
}
Title: Re:Timed playing of views
Post by: Joey on December 11, 2002, 03:08:54 PM
pq2 was sci jelle.
Title: Re:Timed playing of views
Post by: Nick Sonneveld on December 14, 2002, 04:25:32 AM
I think it's obvious he's referring to Police Quest instead.  I've noticed PQ1 does use the timers that he speaks of.

There's one right at the start of the game where you have to be in the briefing room before a certain time.  If you read the paper, it actually jumps ahead in time for you so people start entering soon after you finish reading.

- Nick
Title: Re:Timed playing of views
Post by: Jelle on December 14, 2002, 02:44:33 PM
Check room 17 in Space Quest II, when the ego is trapped he goes up and down a few times, but it's just one cycle over and over...