The Daily Click ::. Forums ::. Klik Coding Help ::. Seperate Sprites for Body Parts - Animation Problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
1st May, 2005 at 17:12:08 -

What I'm trying to do is have the main character and the main characters weapons as seperate sprites. Simple technique - the benefits are obvious and if you don't know what I'm talking about you probably can't think up a solution anyways.

So heres my problem. When the main character changes animations, the different weapons must change their animations to match that of the main character right? Well, this sometimes works but other times the animations are out of sync. In other words frame 1 of main character would play while fram 2 of weapon would be playing, frame 2 of main character playing, frame 3 of weapon playing etc.

I tried two versions of code. The first goes something like this:
Press SPACE
- Main character change animation to attack
- Weapon change animation to attack

The 2nd version uses fast loops:
Press SPACE
- Begin loop "anim attack"
On Loop "Anim attack"
- Main character change animation to attack
- Weapon change animation to attack

Both versions have frequent animation synchronization problems; and although you'd think the 2nd version would work better, its actually worse :S

Help appreciated.

 
n/a

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
1st May, 2005 at 17:23:40 -

Maybe try forcing the Weapon object's animation frame to match the Character object's when the weapon change animation is playing?

i.e.
User presses SPACE
Change (Character) Animation to "Weapon Change"
Change (Weapon) Animation to "Weapon Change"


(Character) Animation "Weapon Change" is playing + (Weapon) Animation "Weapon Change" is playing:
(Weapon) Change Animation Frame > Use a calculation > Retrieve Data from Object > (Character) Animation > Current Frame.

That should work in theory.

Image Edited by the Author.

 
Image

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
1st May, 2005 at 17:31:21 -

How do i do that? :|

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
1st May, 2005 at 17:32:57 -

How do i do that? :|

 
n/a

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
1st May, 2005 at 17:33:13 -

I just told you step by step. Conditions in Bold and Events in Itallics, with the Objects in (Brackets). Just follow what I said and it should work.

EDIT: By "Weapons Change" animation, I meant "Attack" or whatever you've called the animation. I didn't read it properly.

Image Edited by the Author.

 
Image

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
1st May, 2005 at 17:49:40 -

Ooops sorry bout that . My eyes must have gone wrong for a sec.

Yes that SHOULD theoretically work but it doesn't . There's still a slight gap inbetween the sprites. I'll try to incorporate fast loop with your logic.

 
n/a

Cybermaze



Registered
  03/04/2003
Points
  853
2nd May, 2005 at 05:52:25 -

Well ... it sounds a little odd. Obviously the 2 animations have the same speed?

Other than that it sounds more like a possible bug you have found than wrong coding. But Im not an expert anyways.

And I cannot say I have tried anything like that before.

But you use the latest version of MMF/TGF (or whatever you use)?

 
If you knew, I would have to kill you...

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
2nd May, 2005 at 18:46:45 -

I have the same problem. AsparagusTrevor's method works most of the time, but there will still be times when it isn't synchronized correctly.

 
http://www.klik-me.com

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
2nd May, 2005 at 20:34:28 -

Good to know I'm not the only one thats got this problem.

I've tried AsparagusTrevor's idea along with fast loops and it seems to help. The synchronization is off by like a fraction of a millisecond but still noticable especially if your sprites are dark and they're against a light background. Guess I'll just have to live with it :S

MMF is strange - sometimes I just say:

Press SPACE
- Weapon play animation attack
- Player play animation attack

and it works fine.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click