Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extra walking frame (when walking in game, not sprite sheet)
#1
I want it to where, when walking, it alternates between the walking frame, and the attacking frame. I want it to where the standing frame, is ONLY used for standing, not at any other time.

Does anyone know how to do this?

Mis was tryign to help me, but I think he got frustrated.

I can't figure this out.
Reply
#2
thee is a tut on the old forums somewhere, btu this should ahve a been a tutorial request.
Reply
#3
I'm sure it would have been, if only I was wanting a tut. =P

And I looked on the old forums, I couldn't find it.
Reply
#4
I could ahve sworn chase wrote sometihng sometime abou tit.
Reply
#5
If you find it, link me.
Reply
#6
Well Basicly you can just change a few numbers. Find the bltplayer sub. And change the anim=.

In MSE anim can be = 0,1,2 I believe.
0 - Standing
1- Walking
2 - Attacking

So just change them as you want them to be.
Reply
#7
It's no where near that simple william.
Reply
#8
oh it is xD.
Reply
#9
Advocate Wrote:It's no where near that simple william.
Hehe, yes it is, you simply just want to change those. Im pretty skilled with the frames cause Ive spent some time on it before, this is my code:
Code:
' Check for animation
    If Player(Index).Attacking = 0 Then
       Select Case GetPlayerDir(Index)
           Case DIR_UP
               If (Player(Index).YOffset < PIC_Y / 1) Then
                    Anim = 1
               End If
               If (Player(Index).YOffset < PIC_Y / 2) Then
                    Anim = 2
               End If
               If (Player(Index).YOffset < PIC_Y / 8) Then
                    Anim = 0
               End If
           Case DIR_DOWN
               If (Player(Index).YOffset > (PIC_Y / 1) * -1) Then
                    Anim = 1
               End If
               If (Player(Index).YOffset > (PIC_Y / 2) * -1) Then
                    Anim = 2
               End If
               If (Player(Index).YOffset > (PIC_Y / 8) * -1) Then
                    Anim = 0
               End If
           Case DIR_LEFT
               If (Player(Index).XOffset < PIC_Y / 1) Then
                    Anim = 1
               End If
               If (Player(Index).XOffset < PIC_Y / 2) Then
                    Anim = 0
               End If
           Case DIR_RIGHT
               If (Player(Index).XOffset < PIC_Y / 2 * -1) Then
                    Anim = 1
               End If
       End Select
   Else
       If Player(Index).AttackTimer + AttackSpeed > GetTickCount Then
           Anim = 3
       End If
   End If
*This will not work for other to use, cause you need a very edited sprites.bmp for it
Reply
#10
you do know that PIC_Y / 1 = PIC_Y right?....
and...you have the order wrong, it should be the pic_y/8 first, then the / 2 then the / 1.

if its not less than 32, then its definately not gonna be less than 16....or 4....
Reply
#11
Quote:you do know that PIC_Y / 1 = PIC_Y right?....
Yes, but its easier to see it that way, because then it follows all the others.

Quote:and...you have the order wrong, it should be the pic_y/8 first, then the / 2 then the / 1.
if its not less than 32, then its definately not gonna be less than 16....or 4....
But still, there wont be a difference if I move them around.
Reply
#12
oh I didnt notice you had them as separate ifs. If you flip them around and make it one if statement(with elses) then it would be better Tongue.
Reply
#13
But still would it run faster?

Code:
If (Player(Index).YOffset < PIC_Y / 1) Then
                    Anim = 1
               ElseIf (Player(Index).YOffset < PIC_Y / 2) Then
                    Anim = 2
               ElseIf (Player(Index).YOffset < PIC_Y / 8) Then
                    Anim = 0
               End If
Reply
#14
Lol, see, what I said is correct, it's not as easy as just changing those numbers, you had to code in more lines of code, not just change the numbers.

=P
Reply
#15
Advocate Wrote:Lol, see, what I said is correct, it's not as easy as just changing those numbers, you had to code in more lines of code, not just change the numbers.

=P

Advocate, listen to me, in your case you just need to change the numbers. In my case, I modified the walking part, my walking style is way different then yours.
Reply
#16
I had what I wanted in an old source of mine, it's NOT just a modification of the numbers. Unfortunatly, I do not have that source anymore.
Reply
#17
William Wrote:But still would it run faster?

Code:
If (Player(Index).YOffset < PIC_Y / 1) Then
                    Anim = 1
               ElseIf (Player(Index).YOffset < PIC_Y / 2) Then
                    Anim = 2
               ElseIf (Player(Index).YOffset < PIC_Y / 8) Then
                    Anim = 0
               End If

Not very noticably, but probably. It definately wouldn't be slower Tongue.

and like I said, switch them, so the smallest is at the top, and so on(pic_y/8)
Reply
#18
Thank you, sorry for going off-topic here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)