MMORPG
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Últimos assuntos
» Eclipse naruto V1.0,1.1
[Tuto]MiniMap I_icon_minitimeTer Out 28, 2014 8:44 am por Kaue

» { Equipemanto }
[Tuto]MiniMap I_icon_minitimeQua Mar 26, 2014 8:24 pm por Emanuelb2

» Ajuda :D plis
[Tuto]MiniMap I_icon_minitimeTer Mar 11, 2014 9:00 pm por jamethon

» [Deleta por favo esse topico]
[Tuto]MiniMap I_icon_minitimeSeg Mar 10, 2014 10:55 pm por Emanuelb2

» [PERGUNTA] Como Por sistemas de reset automático e diminuir os mapas? [ EEB ]
[Tuto]MiniMap I_icon_minitimeSeg Mar 10, 2014 10:25 pm por Kaue

» [Recrutamento] PA ( para quem sabe manusear Pixel Art )
[Tuto]MiniMap I_icon_minitimeDom Mar 09, 2014 8:41 pm por Kaue

» Eclipse Origins 2.0 DOWLOAD(ATT)
[Tuto]MiniMap I_icon_minitimeDom Mar 09, 2014 6:10 pm por Emanuelb2

» Ganhar Item ao Matar Player
[Tuto]MiniMap I_icon_minitimeDom Mar 09, 2014 6:15 am por Kaue

» Oque acontece com o administrador do forum!
[Tuto]MiniMap I_icon_minitimeSex Mar 07, 2014 3:21 pm por Kaue

Parceiros
Fórum grátis


[Tuto]MiniMap

Ir para baixo

[Tuto]MiniMap Empty [Tuto]MiniMap

Mensagem por *Star* Qui Dez 20, 2012 10:50 am

Ola Galerinha do Forum,Hoje vim ensinar a Vocês o novo Tutorial:MiniMap.

Exemplo:
[Tuto]MiniMap Minima10

Vamos Começar o tuto.

Abra o Client~Side

Abra o ModDirectX e procure por:

Código:
Option Explicit

De enter 2 vezes e adicione:

Código:
Public DDSD_MiniMap As DDSURFACEDESC2
Public DD_MiniMap As DirectDrawSurface7

Presione CTRL+F e pesquise por Sub InitSurfaces repare que abaixo da explicação ' Check for files existing, tem uma linha semelhante a linha abaixo.

Código:
    If FileExist("\GFX\sprites.bmp") = False Or FileExist("\GFX\Itens.bmp") = False Or FileExist("\GFX\bigsprites.bmp") = False Or FileExist("\GFX\emoticons.bmp") = False Or FileExist("\GFX\Flechas.bmp")= False Then
        Call MsgBox("Alguns arquivos gráficos estão faltando!", vbOKOnly, GAME_NAME)
        Call GameDestroy
    End If

Substitua para:

Código:
    If FileExist("\GFX\sprites.bmp") = False Or FileExist("\GFX\Itens.bmp") = False Or FileExist("\GFX\bigsprites.bmp") = False Or FileExist("\GFX\emoticons.bmp") = False Or FileExist("\GFX\Flechas.bmp") = False Or FileExists("\GFX\minimap.bmp") = False Then
        Call MsgBox("Alguns arquivos gráficos estão faltando!", vbOKOnly, GAME_NAME)
        Call GameDestroy
    End If

Agora em cima da linha que você acabou de substituir, logo abaixo de Sub InitSurfaces adicione o seguinte bloco de códigos.

Código:
DDSD_MiniMap.lFlags = DDSD_CAPS
    DDSD_MiniMap.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
    Set DD_MiniMap = DD.CreateSurfaceFromFile(App.Path & "\GFX\minimap.bmp", DDSD_MiniMap)
    SetMaskColorFromPixel DD_MiniMap, 0, 0

Ainda nesse modulo procure pela Sub DestroyDirectX depois da declaração Dim i As Long adicione o código abaixo.

Código:
Set DD_MiniMap = Nothing

Agora va em cima de Sub DestroyDirectX e adicione essa Sub.

Código:
'Modified to work with EE by Braiton
Sub BltMiniMap()
Dim I As Long
Dim x As Integer
Dim y As Integer
Dim MMx As Long
Dim MMy As Integer

    ' Tiles Layer
    ' Select MM Tile to Use for Tiles Layer
    rec.Top = 8
    rec.Bottom = 16
    rec.Left = 0
    rec.Right = 8
   
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_BLOCKED Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
   
    ' Player Layer
    ' Select MM Tile to Use for Players Layer
    rec.Top = 16
    rec.Bottom = 24
    rec.Left = 0
    rec.Right = 8
 
    For I = 1 To MAX_PLAYERS
        If Player(I).Map = Player(MyIndex).Map Then
            x = Player(I).x
            y = Player(I).y
            MMx = 400 + (x * 8)
            MMy = 32 + (y * 8)
            If Not I = MyIndex Then
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        End If
    Next I

    ' MyPlayer Layer
    rec.Top = 32
    rec.Bottom = 40
    rec.Left = 0
    rec.Right = 8
    x = Player(MyIndex).x
    y = Player(MyIndex).y
    MMx = 400 + (x * 8)
    MMy = 32 + (y * 8)
    Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
   
   
    ' NPC Layer
    ' Select the MM Tile to use for the NPC Layer
    rec.Top = 24
    rec.Bottom = 32
    rec.Left = 0
    rec.Right = 8
   
    For I = 1 To MAX_MAP_NPCS
        If MapNpc(I).Num > 0 Then
            x = MapNpc(I).x
            y = MapNpc(I).y
            MMx = 400 + (x * 8)
            MMy = 32 + (y * 8)
            Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        End If
    Next I
   
    'Shops (Thanks to NexSteve)
    rec.Top = 40
    rec.Bottom = 48
    rec.Left = 0
    rec.Right = 8
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_SHOP Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
    'Walkable tiles (Thanks to Me)

    rec.Top = 48
    rec.Bottom = 56
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_WALKABLE Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
    'Warps (Thanks to Me)

    rec.Top = 56
    rec.Bottom = 64
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_WARP Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y

'Dropped item (Thanks to Aranshada)

    rec.Top = 64
    rec.Bottom = 72
    rec.Left = 0
    rec.Right = 8
   
    For I = 1 To MAX_MAP_ITEMS
        If MapItem(I).Num > 0 Then
            x = MapItem(I).x
            y = MapItem(I).y
            MMx = 400 + (x * 8)
            MMy = 32 + (y * 8)
            Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        End If
    Next I
       
   
    ' PKers(Thanks to me)
    rec.Top = 104
    rec.Bottom = 112
    rec.Left = 0
    rec.Right = 8
 
    For I = 1 To MAX_PLAYERS
        If Player(I).Map = Player(MyIndex).Map Then
            If Player(I).PK = YES Then
                x = Player(I).x
                y = Player(I).y
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                If Not I = MyIndex Then
                    Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                End If
            End If
        End If
    Next I

 'Signs (Thanks to Braiton)

    rec.Top = 112
    rec.Bottom = 120
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_SIGN Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
            'Key Doors (Thanks to Braiton)

    rec.Top = 120
    rec.Bottom = 128
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_KEY Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                'Doors (Thanks to Braiton)

    rec.Top = 128
    rec.Bottom = 136
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_DOOR Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                    'Scripted Tile (Thanks to Braiton)

    rec.Top = 136
    rec.Bottom = 144
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_SCRIPTED Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
   
                            'Heal (Thanks to Braiton)

    rec.Top = 152
    rec.Bottom = 160
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_HEAL Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                                'Notice (Thanks to Braiton)

    rec.Top = 160
    rec.Bottom = 168
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_NOTICE Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                                    'Arena (Thanks to Braiton)

    rec.Top = 168
    rec.Bottom = 176
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_ARENA Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                                        'Player House (Thanks to Braiton)

    rec.Top = 176
    rec.Bottom = 184
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_SPRITE_CHANGE Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
   
                                            'Grapple (Thanks to Braiton)

    rec.Top = 184
    rec.Bottom = 192
    rec.Left = 0
    rec.Right = 8
 
    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
            If Map(Player(MyIndex).Map).Tile(x, y).Type = TILE_TYPE_CBLOCK Then
                MMx = 400 + (x * 8)
                MMy = 32 + (y * 8)
                Call DD_BackBuffer.BltFast(MMx, MMy, DD_MiniMap, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
        Next x
    Next y
 
   
End Sub

Agora feche o modDirectx e abra o modGameLogic e procure por:

Código:
Public ii As Long, iii As Long
Public sx As Long

abaixo adicione:

Código:
Public Minimap As Boolean

Em em Sub Main() presione CTRL+F e pesquise por:

Código:
' Não estamos em jogo!

abaixo de:

Código:
    InArrowEditor = False
    InSpawnEditor = False

Adicione:

Código:
Minimap = False

Agora abra o módulo ModGameLogic, e pesquise por Sub GameLoop(), procure pelo codigo abaixo.

Código:
' Release DC
            Call DD_BackBuffer.ReleaseDC(TexthDC)

Logo abaixo adicione o seguinte código:

Código:
' Blit out MiniMap
        If Minimap = True Then
            Call BltMiniMap
        End If

Agora procure pela linha ' // Commands //, logo abaixo adicione o seguinte código.

Código:
'Escolha a ver ou não ver minimap
                        If LCase(Mid(MyText, 1, 8)) = "/minimap" Then
            If Minimap = True Then
                Minimap = False
            Else
                Minimap = True
            End If
            Exit Sub
        End If

No final do modulo adicione a seguinte sub.

Código:
Sub MiniMapOff(Index)
Minimap = False
If Minimap = True Then
            Call BltMiniMap
        Else
        End If
End Sub

Sub MiniMapOn(Index)
Minimap = True
If Minimap = True Then
            Call BltMiniMap
        End If
End Sub

Pronto, agora para ativar o mini-mapa digite /minimap, para desativa-lo também é /minimap.

Testado e Aprovado!

By:Perfect Engine.

Ajudei? Clique no + no cantinho.
*Star*
*Star*

Mensagens : 9
Pontos : 28
Reputação : 1
Data de inscrição : 19/12/2012
Idade : 28

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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