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.
grimsk8ter11
Unregistered
thee is a tut on the old forums somewhere, btu this should ahve a been a tutorial request.
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.
grimsk8ter11
Unregistered
I could ahve sworn chase wrote sometihng sometime abou tit.
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
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.
It's no where near that simple william.
Misunderstood
Unregistered
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
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
Misunderstood
Unregistered
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....
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
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.
Misunderstood
Unregistered
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  .
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
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
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
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
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.
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.
Misunderstood
Unregistered
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  .
and like I said, switch them, so the smallest is at the top, and so on(pic_y/8)
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Thank you, sorry for going off-topic here.
|