Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Sat 26/02/2011 07:43:19

Title: Make object fade in quicker
Post by: barefoot on Sat 26/02/2011 07:43:19
Hi

I have the following script. What changes would I need for the object to fade in  a bit quicker?

Also I believe there may be a plugin for this type of thing.. Fading an object out is no problem.



function region1_WalksOnto()
{
  cwizard.ChangeView(28);
  Wait(2);
  cwizard.ChangeView(29);
  Display("You gaze into the oasis and notice its tranqulity. Thoughts become clearer the mind becomes pure. An image begins to appear");

  int trans = object[0].Transparency;
  while (trans < 100) {
  trans++;
  object[0].Transparency=100-trans;
  Wait(1);

}

  object[0].Visible = true;
  obluesage.SetView(30);
  obluesage.Animate(0, 5,  eRepeat, eNoBlock);
  cEgo.SayAt(395, 20, 250, "Magrid. I am Kazziba an anxient sage. I am appearing to you in a vision. We pray everyday for you. Be strong.");
  obluesage.SetView(30, 0, 0);
}


Cheers

barefoot


Title: Re: Make object fade in quicker
Post by: barefoot on Sat 26/02/2011 07:51:11
Hi

I looked again at the code and moved the object[0].Visible = true; and it works as it should now..


unction region1_WalksOnto()
{
 cwizard.ChangeView(28);
 Wait(2);
 cwizard.ChangeView(29);
 Display("You gaze into the oasis and notice its tranqulity. Thoughts become clearer the mind becomes pure. An image begins to appear");
object[0].Visible = true;
 int trans = object[0].Transparency;
 while (trans < 100) {
 trans++;
 object[0].Transparency=100-trans;
 Wait(1);

}


 obluesage.SetView(30);
 obluesage.Animate(0, 5,  eRepeat, eNoBlock);
 cEgo.SayAt(395, 20, 250, "Magrid. I am Kazziba an anxient sage. I am appearing to you in a vision. We pray everyday for you. Be strong.");
 obluesage.SetView(30, 0, 0);
}


barefoot


Title: Re: Make object fade in quicker
Post by: suicidal pencil on Sat 26/02/2011 10:00:49
Instead of incrementing 'trans' by one, try a higher number.

try 'trans += 5;'
Title: Re: Make object fade in quicker
Post by: barefoot on Sat 26/02/2011 11:03:04
Hi

I shall make a note of that..

cheers suicidal pencil

barefoot
Title: Re: Make object fade in quicker
Post by: mode7 on Sat 26/02/2011 13:25:59
Alternatively you could also use the AGStween module which can tween all sorts of settings including transparency in an very easy to use manner.
Title: Re: Make object fade in quicker
Post by: barefoot on Thu 03/03/2011 20:54:15
Cheers mode7.. i'll look into that

barefoot