Mirage Source http://miragesource.net/forums/ |
|
Extra Layers http://miragesource.net/forums/viewtopic.php?f=210&t=1090 |
Page 1 of 2 |
Author: | Rian [ Mon Jan 08, 2007 6:25 pm ] |
Post subject: | Extra Layers |
Tutorial Originally Posted By: Shadow Warning: If you use this tutorial, you will have to delete all your maps! Ok, now open the client project (Mirage.vbp) Open the Module called 'modTypes' and search for Code: Type TileRec Ground As Integer Mask As Integer Anim As Integer Fringe As Integer Type As Byte Data1 As Integer Data2 As Integer Data3 As Integer End Type Replace with Code: Type TileRec Ground As Integer Mask As Integer Anim As Integer Mask2 As Integer M2Anim As Integer Fringe As Integer FAnim As Integer Fringe2 As Integer F2Anim As Integer Type As Byte Data1 As Integer Data2 As Integer Data3 As Integer End Type Now search for (still in modTypes) Code: Sub ClearMap() In that sub Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Ground = 0 Map.Tile(x, y).Mask = 0 Map.Tile(x, y).Anim = 0 Map.Tile(x, y).Fringe = 0 Map.Tile(x, y).Type = 0 Map.Tile(x, y).Data1 = 0 Map.Tile(x, y).Data2 = 0 Map.Tile(x, y).Data3 = 0 Next x Next y With Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Ground = 0 Map.Tile(x, y).Mask = 0 Map.Tile(x, y).Anim = 0 Map.Tile(x, y).Mask2 = 0 Map.Tile(x, y).M2Anim = 0 Map.Tile(x, y).Fringe = 0 Map.Tile(x, y).FAnim = 0 Map.Tile(x, y).Fringe2 = 0 Map.Tile(x, y).F2Anim = 0 Map.Tile(x, y).Type = 0 Map.Tile(x, y).Data1 = 0 Map.Tile(x, y).Data2 = 0 Map.Tile(x, y).Data3 = 0 Next x Next y Search for Code: Sub BltTile(ByVal x As Long, ByVal y As Long) in that sub Replace Code: Dim Ground As Long Dim Anim1 As Long Dim Anim2 As Long With Code: Dim Ground As Long Dim Anim1 As Long Dim Anim2 As Long Dim Mask2 As Long Dim M2Anim As Long Replace Code: Ground = Map.Tile(x, y).Ground Anim1 = Map.Tile(x, y).Mask Anim2 = Map.Tile(x, y).Anim With Code: Ground = Map.Tile(x, y).Ground Anim1 = Map.Tile(x, y).Mask Anim2 = Map.Tile(x, y).Anim Mask2 = Map.Tile(x, y).Mask2 M2Anim = Map.Tile(x, y).M2Anim Replace Code: 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT) If (MapAnim = 0) Or (Anim2 <= 0) Then ' Is there an animation tile to plot? If Anim1 > 0 And TempTile(x, y).DoorOpen = NO Then rec.top = Int(Anim1 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else ' Is there a second animation tile to plot? If Anim2 > 0 Then rec.top = Int(Anim2 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If With Code: 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT) If (MapAnim = 0) Or (Anim2 <= 0) Then ' Is there an animation tile to plot? If Anim1 > 0 And TempTile(x, y).DoorOpen = NO Then rec.top = Int(Anim1 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else ' Is there a second animation tile to plot? If Anim2 > 0 Then rec.top = Int(Anim2 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If If (MapAnim = 0) Or (M2Anim <= 0) Then ' Is there an animation tile to plot? If Mask2 > 0 Then rec.top = Int(Mask2 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Mask2 - Int(Mask2 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else ' Is there a second animation tile to plot? If M2Anim > 0 Then rec.top = Int(M2Anim / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (M2Anim - Int(M2Anim / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If Now search for Code: Sub BltFringeTile(ByVal x As Long, ByVal y As Long) Replace Code: Dim Fringe As Long With Code: Dim Fringe As Long Dim FAnim As Long Dim Fringe2 As Long Dim F2Anim As Long Replace Code: Fringe = Map.Tile(x, y).Fringe with Code: Fringe = Map.Tile(x, y).Fringe FAnim = Map.Tile(x, y).FAnim Fringe2 = Map.Tile(x, y).Fringe2 F2Anim = Map.Tile(x, y).F2Anim Replace Code: If Fringe > 0 Then rec.top = Int(Fringe / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If With Code: If (MapAnim = 0) Or (FAnim <= 0) Then ' Is there an animation tile to plot? If Fringe > 0 Then rec.top = Int(Fringe / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else If FAnim > 0 Then rec.top = Int(FAnim / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (FAnim - Int(FAnim / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If If (MapAnim = 0) Or (F2Anim <= 0) Then ' Is there an animation tile to plot? If Fringe2 > 0 Then rec.top = Int(Fringe2 / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (Fringe2 - Int(Fringe2 / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else If F2Anim > 0 Then rec.top = Int(F2Anim / 7) * PIC_Y rec.Bottom = rec.top + PIC_Y rec.Left = (F2Anim - Int(F2Anim / 7) * 7) * PIC_X rec.Right = rec.Left + PIC_X 'Call DD_BackBuffer.Blt(rec_pos, DD_TileSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If Now Search for Code: Public Sub EditorMouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Replace Code: If frmMirage.optGround.Value = True Then .Ground = EditorTileY * 7 + EditorTileX If frmMirage.optMask.Value = True Then .Mask = EditorTileY * 7 + EditorTileX If frmMirage.optAnim.Value = True Then .Anim = EditorTileY * 7 + EditorTileX If frmMirage.optFringe.Value = True Then .Fringe = EditorTileY * 7 + EditorTileX With Code: If frmMirage.optGround.Value = True Then .Ground = EditorTileY * 7 + EditorTileX If frmMirage.optMask.Value = True Then .Mask = EditorTileY * 7 + EditorTileX If frmMirage.optAnim.Value = True Then .Anim = EditorTileY * 7 + EditorTileX If frmMirage.optMask2.Value = True Then .Mask2 = EditorTileY * 7 + EditorTileX If frmMirage.optM2Anim.Value = True Then .M2Anim = EditorTileY * 7 + EditorTileX If frmMirage.optFringe.Value = True Then .Fringe = EditorTileY * 7 + EditorTileX If frmMirage.optFAnim.Value = True Then .FAnim = EditorTileY * 7 + EditorTileX If frmMirage.optFringe2.Value = True Then .Fringe2 = EditorTileY * 7 + EditorTileX If frmMirage.optF2Anim.Value = True Then .F2Anim = EditorTileY * 7 + EditorTileX Replace Code: If frmMirage.optGround.Value = True Then .Ground = 0 If frmMirage.optMask.Value = True Then .Mask = 0 If frmMirage.optAnim.Value = True Then .Anim = 0 If frmMirage.optFringe.Value = True Then .Fringe = 0 With Code: If frmMirage.optGround.Value = True Then .Ground = 0 If frmMirage.optMask.Value = True Then .Mask = 0 If frmMirage.optAnim.Value = True Then .Anim = 0 If frmMirage.optMask2.Value = True Then .Mask2 = 0 If frmMirage.optM2Anim.Value = True Then .M2Anim = 0 If frmMirage.optFringe.Value = True Then .Fringe = 0 If frmMirage.optFAnim.Value = True Then .FAnim = 0 If frmMirage.optFringe2.Value = True Then .Fringe2 = 0 If frmMirage.optF2Anim.Value = True Then .F2Anim = 0 Now Search for: Code: Public Sub EditorClearLayer() Replace Code: ' Ground layer If frmMirage.optGround.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the ground layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Ground = 0 Next x Next y End If End If ' Mask layer If frmMirage.optMask.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the mask layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Mask = 0 Next x Next y End If End If ' Mask Animation layer If frmMirage.optAnim.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the animation layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Anim = 0 Next x Next y End If End If ' Fringe layer If frmMirage.optFringe.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the fringe layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Fringe = 0 Next x Next y End If End If With Code: ' Ground layer If frmMirage.optGround.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the ground layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Ground = 0 Next x Next y End If End If ' Mask layer If frmMirage.optMask.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the mask layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Mask = 0 Next x Next y End If End If ' Mask Animation layer If frmMirage.optAnim.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the animation layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Anim = 0 Next x Next y End If End If ' Mask 2 layer If frmMirage.optMask2.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the mask 2 layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Mask2 = 0 Next x Next y End If End If ' Mask 2 Animation layer If frmMirage.optM2Anim.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the mask 2 animation layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).M2Anim = 0 Next x Next y End If End If ' Fringe layer If frmMirage.optFringe.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the fringe layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Fringe = 0 Next x Next y End If End If ' Fringe Animation layer If frmMirage.optFAnim.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the fringe animation layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).FAnim = 0 Next x Next y End If End If ' Fringe 2 layer If frmMirage.optFringe2.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the fringe 2 layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).Fringe2 = 0 Next x Next y End If End If ' Fringe 2 Animation layer If frmMirage.optF2Anim.Value = True Then YesNo = MsgBox("Are you sure you wish to clear the fringe 2 animation layer?", vbYesNo, GAME_NAME) If YesNo = vbYes Then For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map.Tile(x, y).F2Anim = 0 Next x Next y End If End If Search for Code: If LCase(Parse(0)) = "mapdata" Then Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX SaveMap.Tile(x, y).Ground = Val(Parse(n)) SaveMap.Tile(x, y).Mask = Val(Parse(n + 1)) SaveMap.Tile(x, y).Anim = Val(Parse(n + 2)) SaveMap.Tile(x, y).Fringe = Val(Parse(n + 3)) SaveMap.Tile(x, y).Type = Val(Parse(n + 4)) SaveMap.Tile(x, y).Data1 = Val(Parse(n + 5)) SaveMap.Tile(x, y).Data2 = Val(Parse(n + 6)) SaveMap.Tile(x, y).Data3 = Val(Parse(n + 7)) n = n + 8 Next x Next y With Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX SaveMap.Tile(x, y).Ground = Val(Parse(n)) SaveMap.Tile(x, y).Mask = Val(Parse(n + 1)) SaveMap.Tile(x, y).Anim = Val(Parse(n + 2)) SaveMap.Tile(x, y).Mask2 = Val(Parse(n + 3)) SaveMap.Tile(x, y).M2Anim = Val(Parse(n + 4)) SaveMap.Tile(x, y).Fringe = Val(Parse(n + 5)) SaveMap.Tile(x, y).FAnim = Val(Parse(n + 6)) SaveMap.Tile(x, y).Fringe2 = Val(Parse(n + 7)) SaveMap.Tile(x, y).F2Anim = Val(Parse(n + 8)) SaveMap.Tile(x, y).Type = Val(Parse(n + 9)) SaveMap.Tile(x, y).Data1 = Val(Parse(n + 10)) SaveMap.Tile(x, y).Data2 = Val(Parse(n + 11)) SaveMap.Tile(x, y).Data3 = Val(Parse(n + 12)) n = n + 13 Next x Next y Now Search for Code: Sub SendMap() Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX With Map.Tile(x, y) Packet = Packet & .Ground & SEP_CHAR & .Mask & SEP_CHAR & .Anim & SEP_CHAR & .Fringe & SEP_CHAR & .Type & SEP_CHAR & .Data1 & SEP_CHAR & .Data2 & SEP_CHAR & .Data3 & SEP_CHAR End With Next x Next y With Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX With Map.Tile(x, y) Packet = Packet & .Ground & SEP_CHAR & .Mask & SEP_CHAR & .Anim & SEP_CHAR & .Mask2 & SEP_CHAR & .M2Anim & SEP_CHAR & .Fringe & SEP_CHAR & .FAnim & SEP_CHAR & .Fringe2 & SEP_CHAR & .F2Anim & SEP_CHAR & .Type & SEP_CHAR & .Data1 & SEP_CHAR & .Data2 & SEP_CHAR & .Data3 & SEP_CHAR End With Next x Next y thats all the Code for in the Client, Now for the hard part, Adding 'Option Buttons' to the Map Editor Ok, Open the form called 'frmMirage' Click on the Layers Frame, Make it Longer, so it looks something like this: Drag the 'Clear Button' down to the bottom click the OptionButton Add a Few OptionButtons so it looks something like this: Now to name them all, alright, they go like this: Ground's name is 'optGround' (Should already be done) Mask's name is 'optMask' (Should already be done) Animation's (first one, Animates Mask1) name is 'optAnim' (Should already be done) Mask2's name is 'optMask2' Animation's name is 'optM2Anim' Fringe's name is 'optFringe' (Should already be done) Animation's name is 'optFAnim' Fringe2's name is 'optFringe2' Animation's name is 'optF2Anim' Thats all in the Client to do! Congratulations for getting this far, now onto the Server! ______________________________________________________ open the Server project (Server.vbp) Open the Module called 'modTypes' and search for Code: Type TileRec Ground As Integer Mask As Integer Anim As Integer Fringe As Integer Type As Byte Data1 As Integer Data2 As Integer Data3 As Integer End Type Replace with Code: Type TileRec Ground As Integer Mask As Integer Anim As Integer Mask2 As Integer M2Anim As Integer Fringe As Integer FAnim As Integer Fringe2 As Integer F2Anim As Integer Type As Byte Data1 As Integer Data2 As Integer Data3 As Integer End Type Now search for Code: Sub ClearMap() In that sub Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map(MapNum).Tile(x, y).Ground = 0 Map(MapNum).Tile(x, y).Mask = 0 Map(MapNum).Tile(x, y).Anim = 0 Map(MapNum).Tile(x, y).Fringe = 0 Map(MapNum).Tile(x, y).Type = 0 Map(MapNum).Tile(x, y).Data1 = 0 Map(MapNum).Tile(x, y).Data2 = 0 Map(MapNum).Tile(x, y).Data3 = 0 Next x Next y With Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map(MapNum).Tile(x, y).Ground = 0 Map(MapNum).Tile(x, y).Mask = 0 Map(MapNum).Tile(x, y).Anim = 0 Map(MapNum).Tile(x, y).Mask2 = 0 Map(MapNum).Tile(x, y).M2Anim = 0 Map(MapNum).Tile(x, y).Fringe = 0 Map(MapNum).Tile(x, y).FAnim = 0 Map(MapNum).Tile(x, y).Fringe2 = 0 Map(MapNum).Tile(x, y).F2Anim = 0 Map(MapNum).Tile(x, y).Type = 0 Map(MapNum).Tile(x, y).Data1 = 0 Map(MapNum).Tile(x, y).Data2 = 0 Map(MapNum).Tile(x, y).Data3 = 0 Next x Next y Done with modTypes, now onto 'modServerTCP' Seach for Code: If LCase(Parse(0)) = "mapdata" Then Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map(MapNum).Tile(x, y).Ground = Val(Parse(n)) Map(MapNum).Tile(x, y).Mask = Val(Parse(n + 1)) Map(MapNum).Tile(x, y).Anim = Val(Parse(n + 2)) Map(MapNum).Tile(x, y).Fringe = Val(Parse(n + 3)) Map(MapNum).Tile(x, y).Type = Val(Parse(n + 4)) Map(MapNum).Tile(x, y).Data1 = Val(Parse(n + 5)) Map(MapNum).Tile(x, y).Data2 = Val(Parse(n + 6)) Map(MapNum).Tile(x, y).Data3 = Val(Parse(n + 7)) n = n + 8 Next x Next y With Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX Map(MapNum).Tile(x, y).Ground = Val(Parse(n)) Map(MapNum).Tile(x, y).Mask = Val(Parse(n + 1)) Map(MapNum).Tile(x, y).Anim = Val(Parse(n + 2)) Map(MapNum).Tile(x, y).Mask2 = Val(Parse(n + 3)) Map(MapNum).Tile(x, y).M2Anim = Val(Parse(n + 4)) Map(MapNum).Tile(x, y).Fringe = Val(Parse(n + 5)) Map(MapNum).Tile(x, y).FAnim = Val(Parse(n + 6)) Map(MapNum).Tile(x, y).Fringe2 = Val(Parse(n + 7)) Map(MapNum).Tile(x, y).F2Anim = Val(Parse(n + 8)) Map(MapNum).Tile(x, y).Type = Val(Parse(n + 9)) Map(MapNum).Tile(x, y).Data1 = Val(Parse(n + 10)) Map(MapNum).Tile(x, y).Data2 = Val(Parse(n + 11)) Map(MapNum).Tile(x, y).Data3 = Val(Parse(n + 12)) n = n + 13 Next x Next y Search for Code: Sub SendMap(ByVal Index As Long, ByVal MapNum As Long) Replace Code: For y = 0 To MAX_MAPY For x = 0 To MAX_MAPX With Map(MapNum).Tile(x, y) Packet = Packet & .Ground & SEP_CHAR & .Mask & SEP_CHAR & .Anim & SEP_CHAR & .Fringe & SEP_CHAR & .Type & SEP_CHAR & .Data1 & SEP_CHAR & .Data2 & SEP_CHAR & .Data3 & SEP_CHAR End With Next x Next y With Code: For y = 0 To MAX_MAPY
For x = 0 To MAX_MAPX With Map(MapNum).Tile(x, y) Packet = Packet & .Ground & SEP_CHAR & .Mask & SEP_CHAR & .Anim & SEP_CHAR & .Mask2 & SEP_CHAR & .M2Anim & SEP_CHAR & .Fringe & SEP_CHAR & .FAnim & SEP_CHAR & .Fringe2 & SEP_CHAR & .F2Anim & SEP_CHAR & .Type & SEP_CHAR & .Data1 & SEP_CHAR & .Data2 & SEP_CHAR & .Data3 & SEP_CHAR End With Next x Next y |
Author: | lordgivemick [ Tue Jan 09, 2007 1:00 am ] |
Post subject: | |
yes i like this but how can we make it so we have multiple attributes on one block. |
Author: | Obsidian [ Tue Jan 09, 2007 1:20 am ] |
Post subject: | |
Right now, you have an "attribute" that is saved as Type (a byte), check your "Type TileRec", you'll see... Type as Byte. If you want multiple attributes, my suggestion would be to make a Type2 as Byte, or Even Type2 and 3 depending on how many you want to do. Then, just set the editor up, so it can check for multiple "Types", ratehr than just one. It's quite simple actually. |
Author: | Robin [ Tue Jan 09, 2007 9:40 am ] |
Post subject: | |
Tile and type number algorism's ftw. |
Author: | William [ Tue Jan 09, 2007 12:21 pm ] |
Post subject: | |
I dont remember it being so long |
Author: | Robin [ Tue Jan 09, 2007 4:30 pm ] |
Post subject: | |
Code tags also ftw >.> |
Author: | Matt [ Tue Jan 09, 2007 4:37 pm ] |
Post subject: | |
He just pulled it from a text file, slapped in up, and posted it. Lol. At least it's up now. |
Author: | Robin [ Tue Jan 09, 2007 4:39 pm ] |
Post subject: | |
Now to wait for the Out Of Memory and Too Many Static Variables RTE to fill the bug section! Yaaaaay! |
Author: | Matt [ Tue Jan 09, 2007 4:40 pm ] |
Post subject: | |
Lol, I added this tut in last night for someone, and I had no issue with it. |
Author: | Robin [ Tue Jan 09, 2007 4:41 pm ] |
Post subject: | |
Just wait till people decide to make their maps 50x50, add more Data thingies and load 15 graphics files at the same time! |
Author: | Matt [ Tue Jan 09, 2007 4:43 pm ] |
Post subject: | |
Haha, yeah. Far as I know, you can't go higher than 30x30 with MS. Not that you would need to, 25x18 fits to 800x600. Lol. |
Author: | Robin [ Tue Jan 09, 2007 4:44 pm ] |
Post subject: | |
Scrolling maps ftw <3 Also, you could easily get over 1000x1000 if you found a way to save, store and load maps better! <3 Kenko |
Author: | Matt [ Tue Jan 09, 2007 4:45 pm ] |
Post subject: | |
Yeah, I'm sure you could. But I was just saying, default you can't go over 30x30, or is it 32x32? I'm not sure. |
Author: | Robin [ Tue Jan 09, 2007 4:47 pm ] |
Post subject: | |
God knows =\ But the default mirage way is great when displaying the whole map at once, although saving it all as longs and integers could be improved. |
Author: | Suki [ Tue Jan 09, 2007 9:36 pm ] |
Post subject: | |
Anyone know if in the near future there will be extra animation layers? More like: Mask 1 Animation 1 Animation 2 Mask 2 Animation 1 Animation 2 Etc........... *So totally against scrolling maps* XD. |
Author: | Matt [ Tue Jan 09, 2007 9:37 pm ] |
Post subject: | |
You could easily add it in. Just follow the tut and add the extra stuff in. Or did you mean something else? |
Author: | Suki [ Wed Jan 10, 2007 12:02 am ] |
Post subject: | |
Nope, that's what I meant. |
Author: | lucidar [ Wed Jan 10, 2007 8:30 am ] |
Post subject: | |
add a third part to the animation subs. So instead of the masks going 1, 2, 1, 2, 1, 2. It goes 1, 2, 3, 1, 2, 3 or 1, 2, 3, 2, 1, 2, 3, 2 Either way, add a third tile layer and third anim-process? Essentially you do jsut follow the tut and add extra stuff in The tutorial is older than me. Don't expect anything Ever. |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |