MMORPG Brasil
Ola, visitante! Agradecemos sua visita, para ter acesso a todo nosso conteúdo recomendamos que faça um cadastro no fórum, com ele você pode participar de tópicos e ter acesso a todas áreas da comunidade!

Participe do fórum, é rápido e fácil

MMORPG Brasil
Ola, visitante! Agradecemos sua visita, para ter acesso a todo nosso conteúdo recomendamos que faça um cadastro no fórum, com ele você pode participar de tópicos e ter acesso a todas áreas da comunidade!
MMORPG Brasil
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Sprites 4x4 pára sprites 4x3

5 participantes

Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Sprites 4x4 pára sprites 4x3

Mensagem por GustavoNunes Ter 15 maio 2012, 20:32

bom gente, resolvi cortar as sprites de EE para EO, e aconteceu o seguinte:
o EO lê esse tipo de sprite:
[x] [x] [x] [x]Frente
[x] [x] [x] [x]Lado
[x] [x] [x] [x]Lado
[x] [x] [x] [x]Traz

Tem como fazer com que ele leia esse tipo:
[x] [x] [x]Frente
[x] [x] [x]Lado
[x] [x] [x]Lado
[x] [x] [x]Traz

Obrigado desde já.


Última edição por GustavoNunes em Sáb 19 maio 2012, 09:26, editado 1 vez(es)
GustavoNunes
GustavoNunes
Membro Sênior
Membro Sênior

Mensagens : 345

http://PHANTOMWAR.webnode.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Convidad Sáb 19 maio 2012, 08:57

lê esse tipo de sprite:
[x] [x] [x]Frente
[x] [x] [x]Lado
[x] [x] [x]Lado
[x] [x] [x]Traz

Tem como fazer com que ele leia esse tipo:
[x] [x] [x]Frente
[x] [x] [x]Lado
[x] [x] [x]Lado
[x] [x] [x]Traz

Qual a diferença ? .-.
avatar
Convidad
Convidado


Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por GustavoNunes Sáb 19 maio 2012, 09:27

pronto corrigi, malz
GustavoNunes
GustavoNunes
Membro Sênior
Membro Sênior

Mensagens : 345

http://PHANTOMWAR.webnode.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Kairos Sáb 19 maio 2012, 17:48

Tem sim, é bem simples, só q tem um tempo q eu vi isso da ultima vez.. vou dar uma olhada nisso assim q tiver um tempo e posto aqui certinho se vc ainda tiver precisando.
Kairos
Kairos
Novato
Novato

Mensagens : 36

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Sαkurαy Sáb 19 maio 2012, 19:57

Bom, para fazer ele ler só 3 frames, basta alterar a bltPlayer e bltNPC por estas:

BltPlayer:


Código:
Public Sub BltPlayer(ByVal Index As Long)
Dim Anim As Byte, i As Long, X As Long, Y As Long
Dim Sprite As Long, spritetop As Long
Dim Rec As DxVBLib.RECT
Dim attackspeed As Long
Dim Anim2 As Byte
   
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Sprite = GetPlayerSprite(Index)

    If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
   
    CharacterTimer(Sprite) = GetTickCount + SurfaceTimerMax

    If DDS_Character(Sprite) Is Nothing Then
        Call InitDDSurf("characters" & Sprite, DDSD_Character(Sprite), DDS_Character(Sprite))
    End If
   

   
    ' speed from weapon
    If GetPlayerEquipment(Index, Weapon) > 0 Then
        attackspeed = Item(GetPlayerEquipment(Index, Weapon)).Speed
    Else
        attackspeed = 1000
    End If

    ' Reset frame
    If Player(Index).Step > 2 Then
        Anim = 0
    ElseIf Player(Index).Step = 1 Then
        Anim = 1
    End If
   
    ' Check for attacking animation
    If Player(Index).AttackTimer + (attackspeed / 2) > GetTickCount Then
        If Player(Index).Attacking = 1 Then
            Anim = 2
        End If
    Else
        ' If not attacking, walk normally
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset > 8) Then Anim = Player(Index).Step
            Case DIR_DOWN
                If (Player(Index).YOffset < -8) Then Anim = Player(Index).Step
            Case DIR_LEFT
                If (Player(Index).XOffset > 8) Then Anim = Player(Index).Step
            Case DIR_RIGHT
                If (Player(Index).XOffset < -8) Then Anim = Player(Index).Step
        End Select
    End If
   
    If Player(Index).Step > 2 Then Anim = 0


    ' Check to see if we want to stop making him attack
    With Player(Index)
        If .AttackTimer + attackspeed < GetTickCount Then
            .Attacking = 0
            .AttackTimer = 0
        End If
    End With

    ' Set the left
    Select Case GetPlayerDir(Index)
        Case DIR_UP
            spritetop = 3
        Case DIR_RIGHT
            spritetop = 2
        Case DIR_DOWN
            spritetop = 0
        Case DIR_LEFT
            spritetop = 1
    End Select

    With Rec
        .top = spritetop * (DDSD_Character(Sprite).lHeight / 4)
        .Bottom = .top + (DDSD_Character(Sprite).lHeight / 4)
        .Left = Anim * (DDSD_Character(Sprite).lWidth / 3)
        .Right = .Left + (DDSD_Character(Sprite).lWidth / 3)
    End With

    ' Calculate the X
    X = GetPlayerX(Index) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2)

    ' Is the player's height more than 32..?
    If (DDSD_Character(Sprite).lHeight) > 32 Then
        ' Create a 32 pixel offset for larger sprites
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - ((DDSD_Character(Sprite).lHeight / 4) - 32)
    Else
        ' Proceed as normal
        Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset
    End If

    ' render the actual sprite
    Call BltSprite(Sprite, X, Y, Rec)
   
    ' check for paperdolling
    For i = 1 To UBound(PaperdollOrder)
        If GetPlayerEquipment(Index, PaperdollOrder(i)) > 0 Then
            If Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll > 0 Then
                Call BltPaperdoll(X, Y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
            End If
        End If
    Next
   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "BltPlayer", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


BltNPC:

Código:
Public Sub BltNpc(ByVal MapNpcNum As Long)
Dim Anim As Byte, i As Long, X As Long, Y As Long, Sprite As Long, spritetop As Long
Dim Rec As DxVBLib.RECT
Dim attackspeed As Long
   
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If MapNpc(MapNpcNum).num = 0 Then Exit Sub ' no npc set
   
    Sprite = Npc(MapNpc(MapNpcNum).num).Sprite

    If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
   
    CharacterTimer(Sprite) = GetTickCount + SurfaceTimerMax

    If DDS_Character(Sprite) Is Nothing Then
        Call InitDDSurf("characters" & Sprite, DDSD_Character(Sprite), DDS_Character(Sprite))
    End If

    attackspeed = 1000

    ' Reset frame
    Anim = 0
    ' Check for attacking animation
    If MapNpc(MapNpcNum).AttackTimer + (attackspeed / 2) > GetTickCount Then
        If MapNpc(MapNpcNum).Attacking = 1 Then
            Anim = 2
        End If
    Else
        ' If not attacking, walk normally
        Select Case MapNpc(MapNpcNum).Dir
            Case DIR_UP
                If (MapNpc(MapNpcNum).YOffset > 8) Then Anim = MapNpc(MapNpcNum).Step
            Case DIR_DOWN
                If (MapNpc(MapNpcNum).YOffset < -8) Then Anim = MapNpc(MapNpcNum).Step
            Case DIR_LEFT
                If (MapNpc(MapNpcNum).XOffset > 8) Then Anim = MapNpc(MapNpcNum).Step
            Case DIR_RIGHT
                If (MapNpc(MapNpcNum).XOffset < -8) Then Anim = MapNpc(MapNpcNum).Step
        End Select
    End If
   
    If MapNpc(MapNpcNum).Step > 2 Then Anim = 0

    ' Check to see if we want to stop making him attack
    With MapNpc(MapNpcNum)
        If .AttackTimer + attackspeed < GetTickCount Then
            .Attacking = 0
            .AttackTimer = 0
        End If
    End With

    ' Set the left
    Select Case MapNpc(MapNpcNum).Dir
        Case DIR_UP
            spritetop = 3
        Case DIR_RIGHT
            spritetop = 2
        Case DIR_DOWN
            spritetop = 0
        Case DIR_LEFT
            spritetop = 1
    End Select

    With Rec
        .top = (DDSD_Character(Sprite).lHeight / 4) * spritetop
        .Bottom = .top + DDSD_Character(Sprite).lHeight / 4
        .Left = Anim * (DDSD_Character(Sprite).lWidth / 3)
        .Right = .Left + (DDSD_Character(Sprite).lWidth / 3)
    End With

    ' Calculate the X
    X = MapNpc(MapNpcNum).X * PIC_X + MapNpc(MapNpcNum).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2)

    ' Is the player's height more than 32..?
    If (DDSD_Character(Sprite).lHeight / 4) > 32 Then
        ' Create a 32 pixel offset for larger sprites
        Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).YOffset - ((DDSD_Character(Sprite).lHeight / 4) - 32)
    Else
        ' Proceed as normal
        Y = MapNpc(MapNpcNum).Y * PIC_Y + MapNpc(MapNpcNum).YOffset
    End If

    Call BltSprite(Sprite, X, Y, Rec)
   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "BltNpc", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

Problema resolvido!


Créditos: Sakuray
Sαkurαy
Sαkurαy
Membro Veterano
Membro Veterano

Mensagens : 1386

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por GustavoNunes Dom 20 maio 2012, 08:24

Fiz direitinho mas deu erro quando abri : erro 53, file not found
GustavoNunes
GustavoNunes
Membro Sênior
Membro Sênior

Mensagens : 345

http://PHANTOMWAR.webnode.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Sαkurαy Dom 20 maio 2012, 09:30

File not found? o.o
Você organizou tudinho as sprite, na ordem que quer, e tal? o.o
Isso dae eu tirei do meu dbz, que é usado 3 frames também, e abre de boa o.o
Sαkurαy
Sαkurαy
Membro Veterano
Membro Veterano

Mensagens : 1386

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por GustavoNunes Dom 20 maio 2012, 09:44

mas, nem adianta mais, migrei pra EEB pois fica bem mais facil fazer um DBZ nela. vlw ai pela colaboração.+1
GustavoNunes
GustavoNunes
Membro Sênior
Membro Sênior

Mensagens : 345

http://PHANTOMWAR.webnode.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Cris~ Dom 20 maio 2012, 09:52

Bom se ainda quiser eu tenho um tutorial aki que eu uso e funcionou Se quiser ainda ^^
Cris~
Cris~
Membro Veterano
Membro Veterano

Mensagens : 1574

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por GustavoNunes Dom 20 maio 2012, 09:54

nem presisa mais mas msm assim mto orbigado pelo apoio
GustavoNunes
GustavoNunes
Membro Sênior
Membro Sênior

Mensagens : 345

http://PHANTOMWAR.webnode.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por St4rk Dom 20 maio 2012, 11:13

Problema Resolvido, Tópico Fechado.
St4rk
St4rk
Membro de Honra
Membro de Honra

Mensagens : 2251

http://mylittledev.wordpress.com

Ir para o topo Ir para baixo

Sprites 4x4 pára sprites 4x3 Empty Re: Sprites 4x4 pára sprites 4x3

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos