Author Topic: More than one idle animation per view? ( SOLVED )  (Read 208 times)  Share 

Short version:

I read the help file... useful stuff but I can't really tie them together.
How do I make the game show one idle animation after 5 seconds...and another idle animation for the same view (let's say Front) after another 5 seconds?

LucasArts style game.

Long Version:

Let's say the default idle view is 6.
And the other idle view is 7.

I think I can set up a global timer... and when that timer reaches zero I can change idle view of character to 7.
Then reset the timer.
And do it again to change it back to 6.

Question is... how do I "phrase" that in code?
I can't quite put my finger on it.
« Last Edit: 16 Jul 2011, 16:53 by silverwolfpet »

Re: More than one idle animation per view?
« Reply #1 on: 16 Jul 2011, 15:46 »
There's a built-in timer function but I prefer using a variable.

[code]

// top of the script:

int idlewait = 200;   // at normal gamespeed one second equals 40 gameloops

// in the repeatedly execute:

if (idlewait > 0) idlewait--;

if (idlewait == 0){
  idlewait = 200;      
  if (Character..IdleView == 6) Character.SetIdleView(7, 1); // 1 is the delay
  else Character.SetIdleView(6, 1);
}

[/code]

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: More than one idle animation per view?
« Reply #2 on: 16 Jul 2011, 16:00 »
You must use player, not Character:

[code]    player.SetIdleView(13 - player.IdleView, 1);[/code]
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: More than one idle animation per view?
« Reply #3 on: 16 Jul 2011, 16:09 »
I have two characters...so it's fine with "character" for me.

Thank you very much! It's brilliant!

I just need to polish it a little... for some reason it sometimes cuts off the animation. I'll figure it out :) Thanks!

Oh and if I want to have three idle views?

EDIT: added a "else if" and made it work. Thanks!!
« Last Edit: 16 Jul 2011, 16:50 by silverwolfpet »

Dualnames

  • AGS Baker
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: More than one idle animation per view?
« Reply #4 on: 16 Jul 2011, 16:25 »
[code]
int idlewait, cc=1, idleviews=3;//the number of idleviews can be adjusted

// in the repeatedly execute:

idlewait++;

if (idlewait == cc*5*40)
  {
  Character.SetIdleView(5+cc, 1); //assuming the idle views are 6,7,8,9 ecc..
  cc++;
    if (cc>idleviews)
    {
    cc=1;
    idlewait=0; 
    }
  }
[/code]

Re: More than one idle animation per view?
« Reply #5 on: 16 Jul 2011, 16:51 »
Thank you!
And "else if" seemed to do the job too. :)