animated standing pose question

Started by Yikes, Mon 03/01/2011 14:52:20

Previous topic - Next topic

Yikes

i hope this doesnt sound stupid ;D; but i couldnt find this in particular here...
i saw the standing pose is being one frame only (frame 0) but is it possible for a character to have a constantly animated standing pose... in .png? my playercharacter has a specific movement when standing that is different to the walking movement on top of it its not a pixel style but drawn with semi translucent lines (just as sample: imagine a blob bouncing in one place when it stays put while when it moves it does jumps) do i have to override it with the idle function or something like that or does that only work with animated gifs? i hope I'm not asking for something impossible...

Matti

This is quite possible, look up "idle view" in the manual. You can assign an idle view to characters and set how often it should animate (e.g. repeatedly).

Yikes

ah but that means i cant add an actual "idle"-idle (lol stupid term) to the character though right?
...or at least i wouldnt know how to work around that xept with a lot of frames hm...;;;
i guess ill dig through the manual some more x_x

Matti

Sorry, I didn't notice that you already mentioned the idle view. But I don't really get your problem. Regarding your blob example: Why not make a jumping movement view and an idle bouncing view? What do you mean with idle-idle?

Khris

It think Yikes wants one animation while the character is standing (idle) and a different one after the character has stood in place for a while (idle-idle).

This is very much possible but has to be scripted manually. I'll try a few things and get back to you.

Yikes

#5
Quote from: Khris on Mon 03/01/2011 19:14:59
It think Yikes wants one animation while the character is standing (idle) and a different one after the character has stood in place for a while (idle-idle).

This is very much possible but has to be scripted manually. I'll try a few things and get back to you.
yup thats what i meant!
after the standing animation i wanted to make it look around as idle then reverting back to the standing animation
but holy damn i guess i took quite a bite out of that apple for a first :( haha

Khris

Here's something I whipped up quickly:
IdleIdle.scm

Import it by right-clicking the scripts node.

This adds the following command:
   Character.SetIdleIdleView(int idle, int idleidle, int delay_seconds)

So say we want the player character to idle using view 3 and idle-idle using view 4 after 10 seconds:

Code: ags
  player.SetIdleIdleView(3, 4, 10);

Yikes

ho damn ;D
thanks a lot ill try it out as soon as i get the animations down!
i was worried that i might draw them for naught so im glad things work like this too!

Knox

Wow cool...I was searching for something like this too, thanx Khris!
--All that is necessary for evil to triumph is for good men to do nothing.

poltergeist

Thanks a lot Khris! I was monitoring this topic for a helpful reply :D

Khris

You're welcome, this is sort of pre-alpha though and was only tested very superficially, not even with NPCs.

Yikes

actually im facing another problem: i'm not sure how to put an idle animation from all 4 viewpoints (say the character will walk upwards but then when standing reverts to the initial idle-pose facing the towards the camera) not to mention the idle-idle from all 4 viewpoints ...urgh

Knox

You're gonna need a system that detects what direction your character is facing (maybe query your character's loop number), and then depending on that number, link it to the proper view of the idle to play.

I can post what Ive done in my own game for this problem if no one else posts a solution for you...my code *could* be a bit long  for nothing though cause: me no programmer.

--All that is necessary for evil to triumph is for good men to do nothing.

Khris

Yikes:
All you do is fill the first four loops of the view with the frames facing down.
Is this what you were asking?
Not sure, because it sounds like you wanted four different animations depending on the direction the player is facing, but my module already does that.

monkey0506

@knox:

It should be an idle view, not an idle loop..so the loops within the idle view should correspond to, say, the standing/walking/talking/etc. views' loops..and the "system" you're talking about should be the AGS engine. :P

Knox

oh I though he meant:

Say his character is facing down, when he goes into the idle, you need to tell AGS to query the direction that the character is facing, and then play the idle animation from the queried character's position (in this case, down)...so then with the int of the query, you can then get the proper idle view/loop to play :P

Bah, maybe I didnt quite get what he was getting at! Im using this system though for my K9 dog, depending on where my player is and what direction my K9 is facing, I can command the dog to turn towards the player with a custom anim based on his initial position and target angle...

...but again, I DO complicate things immensely, muaa  ;D
--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

For a normal idle view you don't have to manually track the direction the player is facing and then play the appropriate loop's animation..if you want to have a secondary idle view (or possibly multiple secondary idle views) played at intervals throughout the duration of the animation of the normal idle view (what Khris refers to as an "idle idle view") then that would have to be handled manually since AGS does not make standard provisions for it.

And even if you were handling it manually, you wouldn't strictly need any additional tracking, you could just use:

Code: ags
player.LockView(VIEW);
player.Animate(player.Loop, player.AnimationSpeed, eOnce, eNoBlock);
player.UnlockView();


Also, when you say that you're using a "custom anim" for turning..did you actually draw additional frames, or are you simply just manually changing the loop of the character? Because there is Character.FaceLocation which would do that..but I'm sure you knew that..? Oh..and for facing the player it would be:

Code: ags
cK9.FaceCharacter(player);

Knox

Oh, yeah, Ive got custom additional turning frames...I use faceCharacter/Object though for certain situations
--All that is necessary for evil to triumph is for good men to do nothing.

barefoot

Hi Khris

have tried your idleidle.scm and its a great idea  :=

barefoot
I May Not Be Perfect but I Have A Big Heart ..

Shane 'ProgZmax' Stevens

#19
Another approach would be to create some custom properties for the character that hold maximum and current values for view playback 'delay' as well as the range of views you have idle animations in (6 views starting with view 10, for example) and then, when the delay is zero, randomly select one of the views for that range and set it to the idleview and reset the delay.  This way you could have as many idle animations as you want, randomly cycling through the list of available views.  You could even customize it to give 'preference' to certain views, like if you want his default view to play more often.  In this way you'd also avoid the need to lock and unlock the view or play it back manually as the engine would automatically handle it.

SMF spam blocked by CleanTalk