Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Minimap 1.3


iHero
 Share

Recommended Posts

**Beginning**

First download the following file in your \data files\graphics named minimap and see if the file is saved in bmp.

![](http://img52.imageshack.us/img52/9902/minimaph.png)

[http://www.mediafire…fh6oh4t5gj1j023](http://www.mediafire.com/?fh6oh4t5gj1j023)

What exists on the minimap?

* White icon when there's nothing on the map.
* Icon that shows the players that are present on the map.
* Icon that shows NPCs that are on the map.
* Icon showing map of blocks.
* Icon for different players killers.
* Icon that shows the teleportation of the map.
* Icon that shows the items from the map.
* Icon that shows the map and shops by attribute and by being NPC.
* Different icon for each type of NPC.

**Screenshot**

![](http://img717.imageshack.us/img717/149/minimapn.png)

**Client~side**

> modDirectDraw7

Find:

```
' Render the bars

BltBars
```

Below add:

```
' minimap

If Options.Minimap = 1 Then BltMiniMap
```

Find:

```
Public DDS_Bars As DirectDrawSurface7
```

Below add:

```
Public DDS_MiniMap As DirectDrawSurface7
```

Find:

```
Public DDSD_Bars As DDSURFACEDESC2
```

Below add:

```
Public DDSD_MiniMap As DDSURFACEDESC2
```

Find:

```
If FileExist(App.Path & "\data files\graphics\bars.bmp", True) Then Call InitDDSurf("bars", DDSD_Bars, DDS_Bars)
```

Below add:

```
If FileExist(App.Path & "\data files\graphics\minimap.bmp", True) Then Call InitDDSurf("minimap", DDSD_MiniMap, DDS_MiniMap)
```

Find:

```
Set DDS_Target = Nothing

ZeroMemory ByVal VarPtr(DDSD_Target), LenB(DDSD_Target)
```

Below add:

```
Set DDS_MiniMap = Nothing

ZeroMemory ByVal VarPtr(DDSD_MiniMap), LenB(DDSD_MiniMap)
```

At the end of the module add:

```
Sub BltMiniMap()

Dim i As Long

Dim x As Integer, Y As Integer

Dim CameraX As Long, CameraY As Long

Dim BlockRect As RECT, WarpRect As RECT, ItemRect As RECT, ShopRect As RECT, NpcOtherRect As RECT, PlayerRect As RECT, PlayerPkRect As RECT, NpcAttackerRect As RECT, NpcShopRect As RECT, BlankRect As RECT

Dim MapX As Long, MapY As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

' Map size

MapX = Map.MaxX

MapY = Map.MaxY

' ****************

' ** Rectangles **

' ****************

' Blank

With BlankRect

.top = 4

.Bottom = .top + 4

.Left = 0

.Right = .Left + 4

End With

' Player - Norm

With PlayerRect

.top = 0

.Bottom = .top + 4

.Left = 4

.Right = .Left + 4

End With

' Player - PK

With PlayerPkRect

.top = 0

.Bottom = .top + 4

.Left = 8

.Right = .Left + 4

End With

' NPC - Attack when attacked

With NpcAttackerRect

.top = 0

.Bottom = .top + 4

.Left = 12

.Right = .Left + 4

End With

' NPC - Shopkeeper

With NpcShopRect

.top = 0

.Bottom = .top + 4

.Left = 16

.Right = .Left + 4

End With

' NPC - Others

With NpcOtherRect

.top = 0

.Bottom = .top + 4

.Left = 20

.Right = .Left + 4

End With

' Attributes - Block

With BlockRect

.top = 4

.Bottom = .top + 4

.Left = 4

.Right = .Left + 4

End With

' Attributes - Warp

With WarpRect

.top = 4

.Bottom = .top + 4

.Left = 8

.Right = .Left + 4

End With

' Attributes - Item

With ItemRect

.top = 4

.Bottom = .top + 4

.Left = 12

.Right = .Left + 4

End With

' Attributes - Shop

With ShopRect

.top = 4

.Bottom = .top + 4

.Left = 16

.Right = .Left + 4

End With

' Set attributes in map

For x = 0 To MapX

For Y = 0 To MapY

' Camera loc

CameraX = Camera.Left + 25 + (x * 4)

CameraY = Camera.top + 25 + (Y * 4)

' Blank tile

Engine_BltFast CameraX, CameraY, DDS_MiniMap, BlankRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

Select Case Map.Tile(x, Y).Type

Case TILE_TYPE_BLOCKED

Engine_BltFast CameraX, CameraY, DDS_MiniMap, BlockRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

Case TILE_TYPE_WARP

Engine_BltFast CameraX, CameraY, DDS_MiniMap, WarpRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

Case TILE_TYPE_ITEM

Engine_BltFast CameraX, CameraY, DDS_MiniMap, ItemRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

Case TILE_TYPE_SHOP

Engine_BltFast CameraX, CameraY, DDS_MiniMap, ShopRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

End Select

Next Y

Next x

' Set players in mini map

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

' Player loc

x = Player(i).x

Y = Player(i).Y

' Camera loc

CameraX = Camera.Left + 25 + (x * 4)

CameraY = Camera.top + 25 + (Y * 4)

Select Case Player(i).PK

Case NO

Call Engine_BltFast(CameraX, CameraY, DDS_MiniMap, PlayerRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

Case YES

Call Engine_BltFast(CameraX, CameraY, DDS_MiniMap, PlayerPkRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

End Select

End If

Next i

' Set npcs in mini map

For i = 1 To Npc_HighIndex

If MapNpc(i).num > 0 Then

' Npc loc

x = MapNpc(i).x

Y = MapNpc(i).Y

' Camera loc

CameraX = Camera.Left + 25 + (x * 4)

CameraY = Camera.top + 25 + (Y * 4)

Select Case Npc(MapNpc(i).num).Behaviour

Case NPC_BEHAVIOUR_ATTACKONSIGHT Or NPC_BEHAVIOUR_ATTACKWHENATTACKED

Call Engine_BltFast(CameraX, CameraY, DDS_MiniMap, NpcAttackerRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

Case NPC_BEHAVIOUR_SHOPKEEPER

Call Engine_BltFast(CameraX, CameraY, DDS_MiniMap, NpcShopRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

Case Else

Call Engine_BltFast(CameraX, CameraY, DDS_MiniMap, NpcOtherRect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

End Select

End If

Next i

' Error handler

Exit Sub

errorhandler:

HandleError "BltMiniMap", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub
```

> frmMain

Within the picOptions create a label with the following caption:

> MiniMap

Now create a PictureBox with any name in it and add 2 optionsBox with the following settings

OptionBox1

> Name: optMiniMapOn
>
> Caption: On

OptionBox2

> Name: optMiniMapOff
>
> Caption: Off

Within the optMiniMapOn add:

```
' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Options.Minimap = 1

SaveOptions

' Error handler

Exit Sub

errorhandler:

HandleError "optMiniMapOn_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub
```

And within the optMiniMapOff add:

```
' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Options.Minimap = 0

SaveOptions

' Error handler

Exit Sub

errorhandler:

HandleError "optMiniMapOff_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub
```

> modTypes

At the end of Private Type OptionsRec before the End type, add:

```
Minimap As Byte
```

> modDatabase

Find:

```
Call PutVar(fileName, "Options", "Debug", Str(Options.Debug))
```

Below add:

```
Call PutVar(fileName, "Options", "MiniMap", Str(Options.Minimap))
```

Find:

```
Options.Debug = 0
```

Below add:

```
Options.Minimap = 1
```

Find:

```
Options.Debug = GetVar(fileName, "Options", "Debug")
```

Below add:

```
Options.Minimap = GetVar(fileName, "Options", "MiniMap")
```

Find:

```
If Options.Sound = 0 Then

frmMain.optSOff.Value = True

Else

frmMain.optSOn.Value = True

End If
```

Below add:

```
If Options.Minimap = 0 Then

frmMain.optMiniMapOff.Value = True

Else

frmMain.optMiniMapOn.Value = True

End If
```

Now delete the config.ini

**Credits**

iRicardo
Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply

Top Posters In This Topic

![](http://www.freemmorpgmaker.com/files/imagehost/pics/5b9b954043c6220cad38b7eff2ba6bd0.bmp)
this is the option box the hole thing do you understand ?????
else you need to learn a lot about programming not that i am a good programmer (i am a bad programmer)
but i can read and understand everything
Link to comment
Share on other sites

@Tic:

> Method or Data member not found
>
> highlighting ".Minimap ="

pay someone to do this in your place… >.> ^^

Also looks good and clear, I see you are adding here simple but needed tutorials, keep it up and good luck. ;)

p.s. I see you arent centering code any more.. :D
Link to comment
Share on other sites

Don't you think serenades minimap looks alittle better though? I don't think I like the extra white area around the map but still good job adding all the different things to it even though I would prefer to use the blank tile attribute to get rid of the extra nonplayable area

also u said

> I looked at various forums, three types of minimaps and theyall had tocreate a new type called white tile to make a piece ofwhiteminimap to know that there was nothing in a certain place,

I'm not sure you understood his map system cause the white is automatically drawn and a "blank tile" is used to remove extra not needed white space… Not a "white tile" to draw a white space....
Link to comment
Share on other sites

@Tic:

> Method or Data member not found
>
> highlighting ".Minimap ="

Add in /Data Files/**config.ini**

Like That

```
[Options]
Game_Name=Eclipse Origins
Username=
Password=
SavePass= 0
IP=localhost
Port= 7001
MenuMusic=reddwarf.mid
Music= 1
Sound= 1
Debug= 0
MiniMap = 1
```
@santa-clause:

> ![](http://www.freemmorpgmaker.com/files/imagehost/pics/5b9b954043c6220cad38b7eff2ba6bd0.bmp)
> this is the option box the hole thing do you understand ?????
> else you need to learn a lot about programming not that i am a good programmer (i am a bad programmer)
> but i can read and understand everything

What the problem ,Sorry hehhe :P
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...