Hi
I'm Polish and my English isn't very good, sorry :oops:
1. I changed sprites size from 32x32 to 32x64 and it isn't ok. It shows sprites in a good size, but upper part of the sprite doesn't fit to the lower.
This problem exist only in few position, not everytime.
Look:
![[Image: bladpf1.jpg]](http://img72.imageshack.us/img72/41/bladpf1.jpg)
Sprite of Gieroes is ok, upper and lower parts fit to each other, but Styku96's sprite's parts doesnt fit.
Any sugestions to solve it?
2. Are there any functions, commands to change image? For Example to blur it or make some other effect on it.
Thanks for any reply, and again sorry for my English;]
1.
Imageshack is blocked on my campus network so I can't see the image, but it could be a problem with positioning in sprites.bmp (or .png/.gif/.whatever-you-use). There could be an error in coding if it's just like... your top half is facing left and bottom is facing forward, or something. I can't say for sure since I can't see it nor your code.
2.
I haven't a clue.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Make sure the animation code in BltPlayer matches that of BltPlayerTop.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
I didn't change any code in blting, only changed 32x32 to 32x64.
How can I show you this image?;p
It's Like That:
+++++
+++++
It's a sprite.
Everything + should by under +, but sometimes it's like that:
+++++
+++++
Position of upper part is another than lower.
Any ideas?
Ups, I didn't say sth 
I use Elysium Diamond and I think, ekhm, Im sure that bltplayertop is there;]
FIX:
It's Like That:
+++++
+++++
It's a sprite.
Everything + should by under +, but sometimes it's like that:
+++++
.+++++
Position of upper part is another than lower.
Ok, I discovered sth.
This bug appears only on two frames-right walking.
It appears when char goes to right. Any ideas now?
Stomach Pulser
Unregistered
Give us a picture of you sprite on the tilesheet, cause I don't see anything wrong with the sprite...
He means one straight from the sheet, so we have something to compare to find the problem
Ok, look
![[Image: spriteerrorkx9.jpg]](http://img237.imageshack.us/img237/2589/spriteerrorkx9.jpg)
First line is from sprites.bmp, secound is from game. Do you see it now?
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Gierek Wrote:Ok, look
![[Image: spriteerrorkx9.jpg]](http://img237.imageshack.us/img237/2589/spriteerrorkx9.jpg)
First line is from sprites.bmp, secound is from game. Do you see it now?
I've already told you how to solve your problem. Your animation code in BltPlayer and BltPlayerTop are mismatched.
Robin Wrote:Make sure the animation code in BltPlayer matches that of BltPlayerTop.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Actually, now I look again it might not be the animation code but the offset lines.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Posts: 262
Threads: 11
Joined: Apr 2023
Reputation:
0
ED2 always had a problem with 32x64 sprites, if you mean that the top half of the player is moved a pixel to the left or right.
There was a fix on the old forum somewhere there, but its lost forever.
Ok..
BltPlayer:
Code: Sub BltPlayer(ByVal Index As Long)
Dim Anim As Byte
Dim x As Long, y As Long
Dim AttackSpeed As Long
If GetPlayerWeaponSlot(Index) > 0 Then
AttackSpeed = 1000 - (GetPlayerSPEED(Index) * 2)
Else
AttackSpeed = 1000
End If
' Only used if ever want to switch to blt rather then bltfast
' I suggest you don't use, because custom sizes won't work any longer
With rec_pos
.Top = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (SIZE_Y - PIC_Y)
.Bottom = .Top + PIC_Y
.Left = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
.Right = .Left + PIC_X + ((SIZE_X - PIC_X) / 2)
End With
' Check for animation
Anim = 0
If Player(Index).Attacking = 0 Then
Select Case GetPlayerDir(Index)
Case DIR_UP
If (Player(Index).YOffset < PIC_Y / 2) Then Anim = 1
Case DIR_DOWN
If (Player(Index).YOffset > PIC_Y / 2 * -1) Then Anim = 1
Case DIR_LEFT
If (Player(Index).XOffset < PIC_Y / 2) Then Anim = 1
Case DIR_RIGHT
If (Player(Index).XOffset > PIC_Y / 2 * -1) Then Anim = 1
End Select
Else
If Player(Index).AttackTimer + Int(AttackSpeed / 2) > GetTickCount Then
Anim = 2
End If
End If
' Check to see if we want to stop making him attack
If Player(Index).AttackTimer + AttackSpeed < GetTickCount Then
Player(Index).Attacking = 0
Player(Index).AttackTimer = 0
End If
rec.Top = GetPlayerSprite(Index) * SIZE_Y + (SIZE_Y - PIC_Y)
rec.Bottom = rec.Top + PIC_Y
rec.Left = (GetPlayerDir(Index) * (3 * (SIZE_X / PIC_X)) + (Anim * (SIZE_X / PIC_X))) * PIC_X
rec.Right = rec.Left + SIZE_X
x = GetPlayerX(Index) * PIC_X - (SIZE_X - PIC_X) / 2 + sx + Player(Index).XOffset
y = GetPlayerY(Index) * PIC_Y - (SIZE_Y - PIC_Y) + sx + Player(Index).YOffset + (SIZE_Y - PIC_Y)
If SIZE_X > PIC_X Then
If x < 0 Then
x = Player(Index).XOffset + sx + ((SIZE_X - PIC_X) / 2)
If GetPlayerDir(Index) = DIR_RIGHT And Player(Index).Moving > 0 Then
rec.Left = rec.Left - Player(Index).XOffset
Else
rec.Left = rec.Left - Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
End If
End If
If x > MAX_MAPX * 32 Then
x = MAX_MAPX * 32 + sx - ((SIZE_X - PIC_X) / 2) + Player(Index).XOffset
If GetPlayerDir(Index) = DIR_LEFT And Player(Index).Moving > 0 Then
rec.Right = rec.Right + Player(Index).XOffset
Else
rec.Right = rec.Right + Player(Index).XOffset - ((SIZE_X - PIC_X) / 2)
End If
End If
End If
Call DD_BackBuffer.BltFast(x - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub
BltPlayerTop:
Code: Sub BltPlayerTop(ByVal Index As Long)
Dim Anim As Byte
Dim x As Long, y As Long
Dim AttackSpeed As Long
If GetPlayerWeaponSlot(Index) > 0 Then
AttackSpeed = item(GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))).AttackSpeed
Else
AttackSpeed = 1000
End If
' Only used if ever want to switch to blt rather then bltfast
' I suggest you don't use, because custom sizes won't work any longer
With rec_pos
.Top = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (SIZE_Y - PIC_Y)
.Bottom = .Top + PIC_Y
.Left = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
.Right = .Left + PIC_X + ((SIZE_X - PIC_X) / 2)
End With
' Check for animation
Anim = 0
If Player(Index).Attacking = 0 Then
Select Case GetPlayerDir(Index)
Case DIR_UP
If (Player(Index).YOffset < PIC_Y / 2) Then Anim = 1
Case DIR_DOWN
If (Player(Index).YOffset < PIC_Y / 2 * -1) Then Anim = 1
Case DIR_LEFT
If (Player(Index).XOffset < PIC_Y / 2) Then Anim = 1
Case DIR_RIGHT
If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 1
End Select
Else
If Player(Index).AttackTimer + Int(AttackSpeed / 2) > GetTickCount Then
Anim = 2
End If
End If
' Check to see if we want to stop making him attack
If Player(Index).AttackTimer + AttackSpeed < GetTickCount Then
Player(Index).Attacking = 0
Player(Index).AttackTimer = 0
End If
rec.Top = GetPlayerSprite(Index) * SIZE_Y
rec.Bottom = rec.Top + (SIZE_Y - PIC_Y)
rec.Left = (GetPlayerDir(Index) * (3 * (SIZE_X / PIC_X)) + (Anim * (SIZE_X / PIC_X))) * PIC_X
rec.Right = rec.Left + SIZE_X
x = GetPlayerX(Index) * PIC_X - (SIZE_X - PIC_X) / 2 + sx + Player(Index).XOffset
y = GetPlayerY(Index) * PIC_Y - (SIZE_Y - PIC_Y) + sx + Player(Index).YOffset
If y < 0 Then
y = 0
If GetPlayerDir(Index) = DIR_DOWN And Player(Index).Moving > 0 Then
rec.Top = rec.Top - Player(Index).YOffset
Else
rec.Top = rec.Top - Player(Index).YOffset + (SIZE_Y - PIC_Y)
End If
End If
If SIZE_X > PIC_X Then
If x < 0 Then
x = Player(Index).XOffset + sx + ((SIZE_X - PIC_X) / 2)
If GetPlayerDir(Index) = DIR_RIGHT And Player(Index).Moving > 0 Then
rec.Left = rec.Left - Player(Index).XOffset
Else
rec.Left = rec.Left - Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
End If
End If
If x > MAX_MAPX * 32 Then
x = MAX_MAPX * 32 + sx - ((SIZE_X - PIC_X) / 2) + Player(Index).XOffset
If GetPlayerDir(Index) = DIR_LEFT And Player(Index).Moving > 0 Then
rec.Right = rec.Right + Player(Index).XOffset
Else
rec.Right = rec.Right + Player(Index).XOffset - ((SIZE_X - PIC_X) / 2)
End If
End If
End If
Call DD_BackBuffer.BltFast(x - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
What source do you use?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Right, I suggest you tell us that before hand as this is a Mirage forum, so we assume that you're using Mirage Source.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Posts: 262
Threads: 11
Joined: Apr 2023
Reputation:
0
Gierek Wrote:Ups, I didn't say sth 
I use Elysium Diamond and I think, ekhm, Im sure that bltplayertop is there;]
Eh.. Robin
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
He posted that after me.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
I don't know the fix but I really like the sprites
:p
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
There's no need to post then.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Robin Wrote:There's no need to post then.
No need to be so anal towards the people you dislike/hate
but since your.. administrator I'll be the small one here and
just back off.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
I don't hate you >_>
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
|