Carim123 Posted September 23, 2011 Author Share Posted September 23, 2011 This is based on a tutorial I found a while ago by some guy named Briaton (sp?). Credits obviously go to him, but as it was for EE, all I did was make it functional.Here'll be the result…![](http://www.freemmorpgmaker.com/files/imagehost/pics/cf636db5db57fd59c87020e53a80046a.png)This is a washed down version of my own one in IP, as I have purposely removed my extra modifications, etc. This blts the blocked tiles, walkable tiles, and player and npc locations. Don't expect me to hand over any more functions, and make them yourself. It's fairly easy to add to.```Public DDS_MiniMap As DirectDrawSurface7``````Public DDSD_MiniMap As DDSURFACEDESC2```If I need to tell you where that goes, you need to have a good read on some of the basic EO modules.In InitSurfaces, add…```If FileExist(App.Path & "\data files\graphics\minimap.bmp", True) Then Call InitDDSurf("minimap", DDSD_MiniMap, DDS_MiniMap)```DestroyDirectDraw:``` Set DDS_MiniMap = Nothing ZeroMemory ByVal VarPtr(DDSD_MiniMap), LenB(DDSD_MiniMap)```Now, anywhere in modDD7…```Sub BltMiniMap()Dim X As IntegerDim Y As IntegerDim i As LongDim Direction As ByteDim MMx As LongDim MMy As LongDim BLOCKrect As RECTDim PLAYERrect As RECTDim NPCrect As RECTDim WALKrect As RECTDim BLANKrect As RECTDim MapNum As LongDim XX As LongDim YY As Long Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255)) MapNum = Player(MyIndex).Map XX = Map.MaxX YY = Map.MaxY With BLOCKrect .Top = 8 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With With PLAYERrect .Top = 0 .Bottom = .Top + 4 .Left = 4 .Right = .Left + 4 End With With NPCrect .Top = 4 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With With WALKrect .Top = 4 .Bottom = .Top + 4 .Left = 4 .Right = .Left + 4 End With With BLANKrect .Top = 0 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With ' ALWAYS render the tiles before players. ' ALWAYS render blocked AFTER the tiles... ' walkable 'Have the blank first... For X = 0 To XX For Y = 0 To YY Select Case Map.Tile(X, Y).Type Case TILE_TYPE_BLANK MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) Engine_BltFast MMx, MMy, DDS_MiniMap, BLANKrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY Case TILE_TYPE_WALKABLE, TILE_TYPE_NPCAVOID MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) If Map.Tile(X, Y).Type <> TILE_TYPE_BLANK Then Engine_BltFast MMx, MMy, DDS_MiniMap, WALKrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY Case TILE_TYPE_BLOCKED MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) Engine_BltFast MMx, MMy, DDS_MiniMap, BLOCKrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY End Select Next Y Next X For X = 0 To XX For Y = 0 To YY If Map.Tile(X, Y).Type = Map.Tile(X, Y).DirBlock >= 1 Then MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) Engine_BltFast MMx, MMy, DDS_MiniMap, BLOCKrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY End If Next Y Next X ' ------------------------------------------- 'Players... For i = 1 To MAX_PLAYERS If Player(i).Vital(1) > 0 Then X = Player(i).X Y = Player(i).Y MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) Call DDS_BackBuffer.BltFast(MMx, MMy, DDS_MiniMap, PLAYERrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Next i 'NPCs. For i = 1 To MAX_MAP_NPCS If MapNpc(i).num > 0 Then X = MapNpc(i).X Y = MapNpc(i).Y MMx = Camera.Left + 5 + (X * 4) MMy = Camera.Top + 25 + (Y * 4) Select Case Npc(MapNpc(i).num).Behaviour Call DDS_BackBuffer.BltFast(MMx, MMy, DDS_MiniMap, NPCrect, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End Select End If Next iEnd Sub```In RenderGraphics, above the TexthDC backbuffer stuff, add```If Minimap = True Then BltMiniMap```In modGlobals```Public Minimap As Boolean```Now, in modInput, HandleKeyPresses, within the case stuff…``` Case "/minimap" Minimap = Not Minimap```This concludes the minimap side of things.Now, open frmEditor_Map, and in fraAttributes, add an option button called optBlank. We're going to add a blank tile type.In MapEditorMouseDown, above the End With, add;```If frmEditor_Map.optBlank.value Then .Type = TILE_TYPE_BLANK```Now, in modConstants, add;```Public Const TILE_TYPE_BLANK As Byte = 16```Change the 16 to whatever your constant is.This concludes the client-edits.Now, in server-side, add the same constant as above, and that's it. Although I have added a few checks, it's fairly strewn about, but this should be sufficient, shouldn't cause errors, and act as a completely blank, walkable tile. The purpose of this is to make the Minimap square clear, as if you leave the border, outside the walkable zone, etc, it will show up with a white square. If there are any errors, tell me, and I'll do my best to compile what I can.Now, save this in your graphics folder, and enjoy your new minimaps!![](http://www.freemmorpgmaker.com/files/imagehost/pics/b09903069db1c888cfaccfb02f45f22a.bmp)Please tell me if anything's missing, I'm fairly sure this is complete.NOTE: As with any form of Blting, you will be prone to FPS drops while this is in use. I haven't tested exactly how much of a drop occurs extensively, but I went from a previous of 143 to 132\. Go use however you want. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 24, 2011 Share Posted September 24, 2011 it's not working for me. Link to comment Share on other sites More sharing options...
Carim123 Posted September 24, 2011 Author Share Posted September 24, 2011 Did you type /minimap? Link to comment Share on other sites More sharing options...
Vus Posted September 24, 2011 Share Posted September 24, 2011 some screenshot would be nice :) Link to comment Share on other sites More sharing options...
Carim123 Posted September 24, 2011 Author Share Posted September 24, 2011 ![](http://www.freemmorpgmaker.com/files/imagehost/pics/cf636db5db57fd59c87020e53a80046a.png)Adding it to the OP… Link to comment Share on other sites More sharing options...
Vus Posted September 24, 2011 Share Posted September 24, 2011 thx :) Link to comment Share on other sites More sharing options...
Sealbreaker Posted September 24, 2011 Share Posted September 24, 2011 Looks like a thing most people on here should use, nice. But if your fps keeps above 40-60 (on a bad-decent pc) the fps is irrelevant anyways…-seal Link to comment Share on other sites More sharing options...
erkro1 Posted September 24, 2011 Share Posted September 24, 2011 This is very nice, thanks for sharing, I'll be defenitely gonna use this in WLW. ;) Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 24, 2011 Share Posted September 24, 2011 what do we save the file as in our folder Link to comment Share on other sites More sharing options...
erkro1 Posted September 24, 2011 Share Posted September 24, 2011 @Whackeddie99:> what do we save the file as in our folderPlease talk English Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 24, 2011 Share Posted September 24, 2011 it's a simple question:@VICTOR:> Now, save this in your graphics folder, and enjoy your new minimaps!> > ![](http://www.freemmorpgmaker.com/files/imagehost/pics/b09903069db1c888cfaccfb02f45f22a.bmp)It's default is a bunch of numbers. Link to comment Share on other sites More sharing options...
Beanie93 Posted September 24, 2011 Share Posted September 24, 2011 @Whackeddie99:> it's a simple question:> It's default is a bunch of numbers.Looking at the source would help;```If FileExist(App.Path & "\data files\graphics\minimap.bmp", True) Then``` Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 24, 2011 Share Posted September 24, 2011 yeah, i already realized that *facepalm*I am having a problem. I getCompile Error:Statements and labels invalid between Select Case and First Case.It highlights Call DDS_BackBuffer.BltFastin BltMinimapI removed the Select Case and End Select around it and everything seems to work right. Question mark Link to comment Share on other sites More sharing options...
Carim123 Posted September 24, 2011 Author Share Posted September 24, 2011 Yeah, sorry, forgot to remove the case around the NPC, as I removed the npc difference purposefully.Also, you should change it to "Engine_BltFast", not "DDS_BackBuffer.BltFast". I forgot about that.I should also note that the graphics are for demonstration purposes only, even if they're 4x4 squares, they're still mine. Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2011 Share Posted September 29, 2011 Looks great actually… But mind if you put an optional tutorial for thisawesome system... Like putting a button perhaps? Much easier than typing. -Kindly, Night~ Link to comment Share on other sites More sharing options...
Carim123 Posted September 29, 2011 Author Share Posted September 29, 2011 @Night~:> Looks great actually… But mind if you put an optional tutorial for this> awesome system... Like putting a button perhaps? Much easier than typing.> > -Kindly,> Night~Yeah, no.It's not difficult to add what's under /minimap in a new image/picture/button control. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 29, 2011 Share Posted September 29, 2011 Yeah, and if you don't want a command heres what you do.in Sub LoadMap```Minimap = Minimap```place near the bottom, before the error handler. and just delete the case for the /minimap command. Now it should be visible on start up. Link to comment Share on other sites More sharing options...
Ne-o-x Posted September 29, 2011 Share Posted September 29, 2011 This is for EE or EO?o.0 Link to comment Share on other sites More sharing options...
Carim123 Posted September 29, 2011 Author Share Posted September 29, 2011 @Ne[o:> x link=topic=75443.msg809748#msg809748 date=1317332322]> This is for EE or EO?> o.0Why would I make a tutorial for EE?@Whackeddie99:> Yeah, and if you don't want a command heres what you do.> > in Sub LoadMap> > ```> Minimap = Minimap> ```> place near the bottom, before the error handler. and just delete the case for the /minimap command. Now it should be visible on start up.Well…it's a way..albeit bad. Link to comment Share on other sites More sharing options...
Ne-o-x Posted September 29, 2011 Share Posted September 29, 2011 As expected :)Well I have been started to read the script, I don't wanna copy+paste something without understanding it, so here comes the first question:In this block of code```Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255)) MapNum = Player(MyIndex).Map XX = Map.MaxX YY = Map.MaxY With BLOCKrect .Top = 8 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With With PLAYERrect .Top = 0 .Bottom = .Top + 4 .Left = 4 .Right = .Left + 4 End With With NPCrect .Top = 4 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With With WALKrect .Top = 4 .Bottom = .Top + 4 .Left = 4 .Right = .Left + 4 End With With BLANKrect .Top = 0 .Bottom = .Top + 4 .Left = 0 .Right = .Left + 4 End With```You tell to the client(?) from where to read(?) that dots from the minimap.bmp ??*I hope you understand what I mean*Also even if I'm a noob when come to scripting (0/100 <- my lvl) I need to say that I like how clean is your script. Link to comment Share on other sites More sharing options...
elementaldisaster Posted November 1, 2011 Share Posted November 1, 2011 Thanks, really helped!If i could get it to work, anyone can… Link to comment Share on other sites More sharing options...
psyDelic Posted November 2, 2011 Share Posted November 2, 2011 My map isn't showing up.This line is never true. ```If Map.Tile(X, Y).Type = Map.Tile(X, Y).DirBlock >= 1 Then```other than that all the Engine_BltFast subs are called.In Engine_BltFast``` If Not ddS Is Nothing Then```never passes either.What was the blank tile option for? Link to comment Share on other sites More sharing options...
psyDelic Posted November 2, 2011 Share Posted November 2, 2011 I figured it out. Thanks. Link to comment Share on other sites More sharing options...
Magdreamer Posted November 2, 2011 Share Posted November 2, 2011 That's nifty :) Link to comment Share on other sites More sharing options...
psyDelic Posted November 2, 2011 Share Posted November 2, 2011 I find it very useful while mapping. Have you looked into limiting the display map to the players picscreen size? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now