[Tuto]MiniMap
Página 1 de 1
[Tuto]MiniMap
Ola Galerinha do Forum,Hoje vim ensinar a Vocês o novo Tutorial:MiniMap.
Exemplo:
Vamos Começar o tuto.
Abra o ModDirectX e procure por:
De enter 2 vezes e adicione:
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.
Substitua para:
Agora em cima da linha que você acabou de substituir, logo abaixo de Sub InitSurfaces adicione o seguinte bloco de códigos.
Ainda nesse modulo procure pela Sub DestroyDirectX depois da declaração Dim i As Long adicione o código abaixo.
Agora va em cima de Sub DestroyDirectX e adicione essa Sub.
Agora feche o modDirectx e abra o modGameLogic e procure por:
abaixo adicione:
Em em Sub Main() presione CTRL+F e pesquise por:
abaixo de:
Adicione:
Agora abra o módulo ModGameLogic, e pesquise por Sub GameLoop(), procure pelo codigo abaixo.
Logo abaixo adicione o seguinte código:
Agora procure pela linha ' // Commands //, logo abaixo adicione o seguinte código.
No final do modulo adicione a seguinte 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.
Exemplo:
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*- Mensagens : 9
Pontos : 28
Reputação : 1
Data de inscrição : 19/12/2012
Idade : 28
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|
Ter Out 28, 2014 8:44 am por Kaue
» { Equipemanto }
Qua Mar 26, 2014 8:24 pm por Emanuelb2
» Ajuda :D plis
Ter Mar 11, 2014 9:00 pm por jamethon
» [Deleta por favo esse topico]
Seg Mar 10, 2014 10:55 pm por Emanuelb2
» [PERGUNTA] Como Por sistemas de reset automático e diminuir os mapas? [ EEB ]
Seg Mar 10, 2014 10:25 pm por Kaue
» [Recrutamento] PA ( para quem sabe manusear Pixel Art )
Dom Mar 09, 2014 8:41 pm por Kaue
» Eclipse Origins 2.0 DOWLOAD(ATT)
Dom Mar 09, 2014 6:10 pm por Emanuelb2
» Ganhar Item ao Matar Player
Dom Mar 09, 2014 6:15 am por Kaue
» Oque acontece com o administrador do forum!
Sex Mar 07, 2014 3:21 pm por Kaue