Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Mon 30/05/2011 14:31:25

Title: Move view one frame at a time by button.. script help
Post by: barefoot on Mon 30/05/2011 14:31:25
Hi

I have looked but have not yet found any answer to what I am trying to achieve.

There is one view of numbers 0-9 (View Name: Numbers)

0 is the view frame (object) that shows first (it does NOT animate).

Each time you press a button it forwards one frame of the loop of its current loop frame...

eg:  0 showing, click button goes to 1 click button again goes to 2 etc etc

You basically have to set 5 numbers correctly ie 87563

I will keep looking but hope help is at hand to help me configure this.

I know this can be done using plain objects which is a workaround but that means endless scripting. I would like to find Loop Frame +1 sort of advance script.

cheers

barefoot




Title: Re: Move view one frame at a time by button.. script help
Post by: Khris on Mon 30/05/2011 18:56:45
So you're using room objects to display the digits, right?
Just advance their .Graphic:

Say the 0 sprite is 52 (9 is 61):

oDigit1_Interact() {
  if (oDigit1.Graphic == 61) oDigit1.Graphic = 52;
  else oDigit1.Graphic++;
}


If you were looking, how did you not find Object.Graphic (http://www.adventuregamestudio.co.uk/manual/Object.Graphic.htm)...?
Title: Re: Move view one frame at a time by button.. script help
Post by: barefoot on Mon 30/05/2011 20:44:15
Hi Khris

I am doing a similar thing as your code. Mine is based on an object which is visible and by clicking a button will advance that object to the next object: 0 to 1, 1 to 2, cycling from 0 to 3 and back to 0.

Even so, the script for changing the graphic (as per manual) is a good one. But i did want one button that by clicking scrolls through the view one graphic at a time.

I can understand what you have put and the Manual info which I could incorporate.

thanks again

barefoot