14-09-2006, 01:35 AM
i think this MIGHT work... i just kinda went through and coded it really quick... it requires two new variables for the NPC rec... one really isn't necissary you can just make it a public timer if you want, but then they'll all be flapping at the same time or whatever... replace the
and try using this... it's untested... but it should definately be a step in the right direction for you... i think.... haha....
That would be if you added the "constant" to the npc rec, it would also require you to add "MoveTimer" to the Npc Rec... but that obviously wouldn't need to be saved... let me know how that goes...
Code:
' Check for animation
Anim = 0
If MapNpc(MapNpcNum).Attacking = 0 Then
Select Case MapNpc(MapNpcNum).Dir
Case DIR_UP
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2) Then Anim = 1
Case DIR_DOWN
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2 * -1) Then Anim = 1
Case DIR_LEFT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2) Then Anim = 1
Case DIR_RIGHT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 1
End Select
Else
If MapNpc(MapNpcNum).AttackTimer + 500 > GetTickCount Then
Anim = 2
End If
End If
and try using this... it's untested... but it should definately be a step in the right direction for you... i think.... haha....
Code:
' Check for animation
Anim = 0
If MapNpc(MapNpcNum).Attacking = 0 Then
If Npc(MapNpc(MapNpcNum).num).Constant = 1 Then
' Move them constantly.. every 150 milliseconds or so...
If GetTickCount > Npc(MapNpc(MapNpcNum).num).movetimer + 150 Then
If Anim = 1 Then
Select Case MapNpc(MapNpcNum).Dir
Case DIR_UP
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2) Then Anim = 2
Case DIR_DOWN
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2 * -1) Then Anim = 2
Case DIR_LEFT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2) Then Anim = 2
Case DIR_RIGHT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 2
End Select
Else
Select Case MapNpc(MapNpcNum).Dir
Case DIR_UP
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2) Then Anim = 1
Case DIR_DOWN
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2 * -1) Then Anim = 1
Case DIR_LEFT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2) Then Anim = 1
Case DIR_RIGHT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 1
End Select
End If
Npc(MapNpc(MapNpcNum).num).movetimer = GetTickCount
End If
Else
Select Case MapNpc(MapNpcNum).Dir
Case DIR_UP
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2) Then Anim = 1
Case DIR_DOWN
If (MapNpc(MapNpcNum).YOffset < PIC_Y / 2 * -1) Then Anim = 1
Case DIR_LEFT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2) Then Anim = 1
Case DIR_RIGHT
If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 1
End Select
End If
Else
If MapNpc(MapNpcNum).AttackTimer + 500 > GetTickCount Then
Anim = 2
End If
End If
That would be if you added the "constant" to the npc rec, it would also require you to add "MoveTimer" to the Npc Rec... but that obviously wouldn't need to be saved... let me know how that goes...