the_best_flash Posted April 13, 2009 Author Share Posted April 13, 2009 This will change the maps so that instead of having a blocked tile attribute that blocks the entire tile, a tile could be made so that walking off it in certain directions is blocked and have another attribute (Like a warp tile that's exit/entrance is blocked from all sides but one.) (After the update has been installed old style blocks can still be used if you prefer.)I will not be including .rar files containing the source code. It will all have to be copy/pasted from below.After installing this you will need to use the provided converter to convert your maps.CAUTION: make a back up copy of your maps. Just in case something goes wrong.> Example.> > Before the edit a player is standing on a tile. To keep the player from walking up, down, and left you must set the tiles attributes to the left, right, and above him to a B. This prevents anyone from walking on those three tiles and prevents them from having any other attributes.> > With the edit a player is standing on a tile. To keep the player from walking up, down, and left you check the up, down, and left check boxes in the editor, and place a directionally blocked tile down where the would be standing. The tiles to the left, right, and above the player remain unchanged, and the tile you just placed can have another attribute (Such as warp, or health).Editor![](http://sitebuilder.yola.com/sites/Debe/D1d9/D9cd/Dccf/U8a4986cb1e638eb8011efccdc99d1ebe/8a4986cb1f46964e011f5993442647e6/resources/block_editor.png?timestamp=1239584096589)Checking the check boxes inside the 'tile' will block the direction on the tile you click on. Clicking on boxes outside the 'tile' will block the tiles next to the tile you just selected.Selecting 'hide In Editor' will make the red squares disappear to make mapping easier.Example Map(Note: By using the map grid you can see what part of the tile the red squares are on. The part of the tile that the squares are on will be the direction that the player CANNOT walk off the tiles.)![](http://sitebuilder.yola.com/sites/Debe/D1d9/D9cd/Dccf/U8a4986cb1e638eb8011efccdc99d1ebe/8a4986cb1f46964e011f5993442647e6/resources/block_map.png?timestamp=1239584193184)On the left hand side of the image, near the boxes. A player can walk 'between' the boxes while another player is standing on the tile directly below them, but they won't be able to walk to each other, or attack each other. This is particularly useful for creating stairs. When you want a player to be able to walk next to the stairs, but not be able to get to the stairs, while at the same time allowing a player to walk on the stairs.**Code****CLIENT**1.In modGameEditor in EditorMouseDown() under the first ' ElseIf MapEditorSelectedType = 2 Then ' just below ' With map(GetPlayerMap(MyIndex)).Tile(X, y) ' put:```] If .Type = 0 Or .Type = TILE_TYPE_ALLOW_ARROW Then If .Type = TILE_TYPE_ALLOW_ARROW Then frmMapBlock.block_arrow = 0 End If If .block_down Then frmMapEditor.optBlocked.Value = True End If If .block_left Then frmMapEditor.optBlocked.Value = True End If If .block_right Then frmMapEditor.optBlocked.Value = True End If If .block_up Then frmMapEditor.optBlocked.Value = True End If frmMapBlock.block_down.Value = -1 * CInt(.block_down) frmMapBlock.block_left.Value = -1 * CInt(.block_left) frmMapBlock.block_right.Value = -1 * CInt(.block_right) frmMapBlock.block_up.Value = -1 * CInt(.block_up) If X < MAX_MAPX Then frmMapBlock.right_b.Value = -1 * CInt(map(GetPlayerMap(MyIndex)).Tile(X + 1, y).block_left) Else frmMapBlock.right_b.Value = 0 End If If y > 0 Then frmMapBlock.up_b.Value = -1 * CInt(map(GetPlayerMap(MyIndex)).Tile(X, y - 1).block_down) Else frmMapBlock.up_b.Value = 0 End If If y < MAX_MAPY Then frmMapBlock.down_b.Value = -1 * CInt(map(GetPlayerMap(MyIndex)).Tile(X, y + 1).block_up) Else frmMapBlock.down_b.Value = 0 End If If X > 0 Then frmMapBlock.left_b = -1 * CInt(map(GetPlayerMap(MyIndex)).Tile(X - 1, y).block_right) Else frmMapBlock.left_b = 0 End If End If```Under the next ' ElseIf MapEditorSelectedType = 2 Then ' just below ' If frmMapEditor.optBlocked.Value = True Then ' Change:``` .Type = TILE_TYPE_BLOCKED```To:``` If frmMapBlock.OldStyle Then .Type = TILE_TYPE_BLOCKED ElseIf frmMapBlock.hideblock.Value = 0 Then If frmMapBlock.block_arrow.Value = 0 Then .Type = TILE_TYPE_ALLOW_ARROW End If If frmMapBlock.block_up Then .block_up = True Else .block_up = False End If If frmMapBlock.block_down Then .block_down = True Else .block_down = False End If If frmMapBlock.block_left Then .block_left = True Else .block_left = False End If If frmMapBlock.block_right Then .block_right = True Else .block_right = False End If If frmMapBlock.right_b And X < MAX_MAPX Then map(GetPlayerMap(MyIndex)).Tile(X + 1, y).block_left = True End If If frmMapBlock.up_b And y > 0 Then map(GetPlayerMap(MyIndex)).Tile(X, y - 1).block_down = True End If If frmMapBlock.down_b And y < MAX_MAPY Then map(GetPlayerMap(MyIndex)).Tile(X, y + 1).block_up = True End If If frmMapBlock.left_b And X > 0 Then map(GetPlayerMap(MyIndex)).Tile(X - 1, y).block_right = True End If End If```Under the third ' ElseIf MapEditorSelectedType = 2 Then ' just below ' .String3 = vbNullString ' put:``` If frmMapBlock.hideblock.Value = 0 Then .block_down = False .block_left = False .block_right = False .block_up = False End If```2.In modGameLogic in Sub GameInit() under ' InGame = True ' put:``` prev_x = -1 prev_y = -1```In Sub GameLoop() under ' Blit out attribs if in editor Change:``` If InEditor Then```To:``` If InEditor And frmMapEditor.HideAtt = 0 Then```In under the above line of code, just below ' With map(GetPlayerMap(MyIndex)).Tile(X, y) ' Change:``` If .Type = TILE_TYPE_BLOCKED Then Call DrawText(TexthDC, X * PIC_X + sx + 8 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx + 8 - (NewPlayerY * PIC_Y) - NewYOffset, "B", QBColor(BRIGHTRED)) End If```To:``` If .Type = TILE_TYPE_BLOCKED Then If frmMapBlock.hideblock = 0 Then Call DrawText(TexthDC, X * PIC_X + sx + 8 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx + 8 - (NewPlayerY * PIC_Y) - NewYOffset, "B", QBColor(BRIGHTRED)) End If End If If .block_down And frmMapBlock.hideblock = 0 Then Call DrawText(TexthDC, X * PIC_X + sx + 12 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx + 18 - (NewPlayerY * PIC_Y) - NewYOffset, CStr(Chr$(25)), QBColor(BRIGHTRED)) End If If .block_left And frmMapBlock.hideblock = 0 Then Call DrawText(TexthDC, X * PIC_X + sx + 2 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx + 8 - (NewPlayerY * PIC_Y) - NewYOffset, CStr(Chr$(27)), QBColor(BRIGHTRED)) End If If .block_right And frmMapBlock.hideblock = 0 Then Call DrawText(TexthDC, X * PIC_X + sx + 22 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx + 8 - (NewPlayerY * PIC_Y) - NewYOffset, CStr(Chr$(26)), QBColor(BRIGHTRED)) End If If .block_up And frmMapBlock.hideblock = 0 Then Call DrawText(TexthDC, X * PIC_X + sx + 12 - (NewPlayerX * PIC_X) - NewXOffset, y * PIC_Y + sx - 2 - (NewPlayerY * PIC_Y) - NewYOffset, CStr(Chr$(24)), QBColor(BRIGHTRED)) End If```In Function CanMove() under:``` Else Call SetPlayerDir(MyIndex, DIR_RIGHT) X = X + 1 End If```Put:``` If DirUp Then If map(GetPlayerMap(MyIndex)).Tile(X, y + 1).block_up Then CanMove = False End If ElseIf DirDown Then If map(GetPlayerMap(MyIndex)).Tile(X, y - 1).block_down Then CanMove = False End If ElseIf DirLeft Then If map(GetPlayerMap(MyIndex)).Tile(X + 1, y).block_left Then CanMove = False End If ElseIf DirRight Then If map(GetPlayerMap(MyIndex)).Tile(X - 1, y).block_right Then CanMove = False End If End If```3.In modGlobals, somewhere put:```'block additionPublic prev_x As LongPublic prev_y As Long```4.In modHandleData in HandeData() under ' If casestring = "mapdata" Then ' just below ' .F2AnimSet = Val(parse(n + 25)) ' Change:Everything in:``` For X = 0 To MAX_MAPX 'Code Next X```To:``` With map(Val(parse(1))).Tile(X, y) .Ground = Val(parse(n)) .Mask = Val(parse(n + 1)) .anim = Val(parse(n + 2)) .Mask2 = Val(parse(n + 3)) .M2Anim = Val(parse(n + 4)) .Fringe = Val(parse(n + 5)) .FAnim = Val(parse(n + 6)) .Fringe2 = Val(parse(n + 7)) .F2Anim = Val(parse(n + 8)) .Type = Val(parse(n + 9)) .Data1 = Val(parse(n + 10)) .Data2 = Val(parse(n + 11)) .Data3 = Val(parse(n + 12)) .String1 = parse(n + 13) .String2 = parse(n + 14) .String3 = parse(n + 15) .light = Val(parse(n + 16)) .GroundSet = Val(parse(n + 17)) .MaskSet = Val(parse(n + 18)) .AnimSet = Val(parse(n + 19)) .Mask2Set = Val(parse(n + 20)) .M2AnimSet = Val(parse(n + 21)) .FringeSet = Val(parse(n + 22)) .FAnimSet = Val(parse(n + 23)) .Fringe2Set = Val(parse(n + 24)) .F2AnimSet = Val(parse(n + 25)) .block_down = parse(n + 26) .block_left = parse(n + 27) .block_right = parse(n + 28) .block_up = parse(n + 29) End With n = n + 30```5.In modTypes at the BOTTOM of ' Type TileRec ' put:``` blocked As Boolean block_up As Boolean block_down As Boolean block_right As Boolean block_left As Boolean ```6.In modDirectX in BltArrow() under ' If Player(Index).Arrow(z).ArrowPosition = 0 Then' just below ' If y > Player(Index).Arrow(z).ArrowY + Arrows(Player(Index).Arrow(z).ArrowNum).Range - 2 Then' put:``` prev_x = -1 prev_y = -1```Under ' If Player(Index).Arrow(z).ArrowPosition = 1 Then ' just below ' If y < Player(Index).Arrow(z).ArrowY - Arrows(Player(Index).Arrow(z).ArrowNum).Range + 2 Then ' Put:``` prev_x = -1 prev_y = -1```Under ' If Player(Index).Arrow(z).ArrowPosition = 2 Then ' just below ' If X > Player(Index).Arrow(z).ArrowX + Arrows(Player(Index).Arrow(z).ArrowNum).Range - 2 Then ' put:``` prev_x = -1 prev_y = -1```Under ' If Player(Index).Arrow(z).ArrowPosition = 3 Then ' just below ' If X < Player(Index).Arrow(z).ArrowX - Arrows(Player(Index).Arrow(z).ArrowNum).Range + 2 Then ' put:``` prev_x = -1 prev_y = -1```Under ' If map(GetPlayerMap(MyIndex)).Tile(X, y).Type = TILE_TYPE_BLOCKED Then ' Put:``` prev_x = -1 prev_y = -1```Under the block of code you just edited above that should read:``` If X >= 0 And X <= MAX_MAPX Then If y >= 0 And y <= MAX_MAPY Then If map(GetPlayerMap(MyIndex)).Tile(X, y).Type = TILE_TYPE_BLOCKED Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If End If End If```Put:``` If X >= 0 And X <= MAX_MAPX And prev_x <> -1 Then If y >= 0 And y <= MAX_MAPY And prev_y <> -1 Then If prev_x - X > 0 Then 'going left Dir = 1 ElseIf prev_x - X < 0 Then 'going right Dir = 2 ElseIf prev_y - y > 0 Then 'going up Dir = 3 ElseIf prev_y - y < 0 Then 'going down Dir = 4 End If Select Case Dir Case 1 If map(GetPlayerMap(MyIndex)).Tile(X + 1, y).block_left And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 2 If map(GetPlayerMap(MyIndex)).Tile(X - 1, y).block_right And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 3 If map(GetPlayerMap(MyIndex)).Tile(X, y + 1).block_up And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 4 If map(GetPlayerMap(MyIndex)).Tile(X, y - 1).block_down And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If End Select If prev_x <> -1 And prev_y <> -1 Then prev_x = X prev_y = y End If End If End If```Under:``` If Index = MyIndex Then Call SendData("arrowhit" & SEP_CHAR & 0 & SEP_CHAR & i & SEP_CHAR & X & SEP_CHAR & y & END_CHAR) End If```Change:``` If Index <> i Then Player(Index).Arrow(z).Arrow = 0 End If```To:``` If Index <> i Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If```Below the above inside ' For i = 1 To MAX_MAP_NPCS ' just under ' Player(Index).Arrow(z).Arrow = 0 ' Put:``` prev_x = -1 prev_y = -1```7.In ModClientTCP inside SendMap() under:``` packet = packet & (.GroundSet & SEP_CHAR & .MaskSet & SEP_CHAR & .AnimSet & SEP_CHAR & .Mask2Set & SEP_CHAR & .M2AnimSet & SEP_CHAR & .FringeSet & SEP_CHAR & .FAnimSet & SEP_CHAR & .Fringe2Set & SEP_CHAR & .F2AnimSet & SEP_CHAR)```Put:``` packet = packet & (CInt(.block_down) & SEP_CHAR & CInt(.block_left) & SEP_CHAR & CInt(.block_right) & SEP_CHAR & CInt(.block_up) & SEP_CHAR)```8\. In modConstants under:```Public Const TILE_TYPE_LOWER_STAT = 31```Add:```Public Const TILE_TYPE_ALLOW_ARROW = 32```9.In frmMapEditor inside cmdFill_Click() under first ' ElseIf MapEditorSelectedType = 2 Then ' Change:```If Me.optBlocked.Value Then 'somethingend if```To:``` If Me.optBlocked.Value Then If frmMapBlock.OldStyle Then .Type = TILE_TYPE_BLOCKED Else If frmMapBlock.block_arrow.Value = 0 Then .Type = TILE_TYPE_ALLOW_ARROW End If If frmMapBlock.block_up Then .block_up = True Else .block_up = False End If If frmMapBlock.block_down Then .block_down = True Else .block_down = False End If If frmMapBlock.block_left Then .block_left = True Else .block_left = False End If If frmMapBlock.block_right Then .block_right = True Else .block_right = False End If End If End If```On Form: Add 1 label with text "Hide in Editor" Add 1 check box called "HideAtt" Position like so: ![](http://sitebuilder.yola.com/sites/Debe/D1d9/D9cd/Dccf/U8a4986cb1e638eb8011efccdc99d1ebe/8a4986cb1f46964e011f5993442647e6/resources/FrmBttn.png?timestamp=1239584831822) -Double click on radio button "Blocked" add:```Private Sub optBlocked_Click() Call frmMapBlock.Show(vbModeless, frmMapEditor)End Sub``` -Double click on all other radio buttons add to all:``` frmMapBlock.Visible = False``` -in ' Private Sub cmdtype_Click ' at top Add:``` frmMapBlock.Visible = False```Under:``` ElseIf Index = 2 Then MapEditorSelectedType = 2 Me.shpSelected.Width = 32 Me.shpSelected.Height = 32 Me.fraLayers.Visible = False Me.frmtile.Visible = False Me.fraAttribs.Visible = True``` Add:``` If Me.optBlocked Then Call frmMapBlock.Show(vbModeless, Me) End If```10\. add frmMapBlock from [server_stuff.rar](http://www.touchofdeathforums.com/smf/index.php?action=dlattach;topic=42497.0;attach=7830)**SERVER**1.In modGameLogic inside CanAttackPlayer() under ' Check if at same coordinates Change:``` Case DIR_UP If (GetPlayerY(Victim) + 1 = GetPlayerY(Attacker)) And (GetPlayerX(Victim) = GetPlayerX(Attacker)) Then```To:``` Case DIR_UP If (GetPlayerY(Victim) + 1 = GetPlayerY(Attacker)) And (GetPlayerX(Victim) = GetPlayerX(Attacker)) And Not map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_up Then```Change:``` Case DIR_DOWN If (GetPlayerY(Victim) - 1 = GetPlayerY(Attacker)) And (GetPlayerX(Victim) = GetPlayerX(Attacker)) Then```To:``` Case DIR_DOWN If (GetPlayerY(Victim) - 1 = GetPlayerY(Attacker)) And (GetPlayerX(Victim) = GetPlayerX(Attacker)) And Not map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_down Then```Change:``` Case DIR_LEFT If (GetPlayerY(Victim) = GetPlayerY(Attacker)) And (GetPlayerX(Victim) + 1 = GetPlayerX(Attacker)) Then```To:``` Case DIR_LEFT If (GetPlayerY(Victim) = GetPlayerY(Attacker)) And (GetPlayerX(Victim) + 1 = GetPlayerX(Attacker)) And Not map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_left Then```Change:``` Case DIR_RIGHT If (GetPlayerY(Victim) = GetPlayerY(Attacker)) And (GetPlayerX(Victim) - 1 = GetPlayerX(Attacker)) Then```To:``` Case DIR_RIGHT If Not (GetPlayerY(Victim) = GetPlayerY(Attacker)) And (GetPlayerX(Victim) - 1 = GetPlayerX(Attacker)) And Not map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_right Then```In CanAttackNPC() under ' Checks to see if the player can attack inside ' Case DIR_UP ' Change:``` CanAttackNpc = True```To:``` If Not map(MapNum).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_up Then CanAttackNpc = True End If```Inside ' Case DIR_DOWN ' Change:``` CanAttackNpc = True```To:``` If Not map(MapNum).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_down Then 'block addition CanAttackNpc = True End If```Inside ' Case DIR_LEFT ' Change:``` CanAttackNpc = True```To:``` If Not map(MapNum).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_left Then 'block addition CanAttackNpc = True End If```Inside ' Case DIR_RIGHT ' Change:``` CanAttackNpc = True```To:``` If Not map(MapNum).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).block_right Then 'block addition CanAttackNpc = True End If```Inside CanNpcAttackPlayer() at bottom Change:``` If IsPlaying(index) Then 'Big If Statement block 'Some code End If```To:``` If IsPlaying(index) Then If NPCnum > 0 Then If (GetPlayerY(index) + 1 = MapNPC(MapNum, MapNpcNum).Y) And (GetPlayerX(index) = MapNPC(MapNum, MapNpcNum).X) Then If Not map(MapNum).Tile(MapNPC(MapNum, MapNpcNum).X, MapNPC(MapNum, MapNpcNum).Y).block_left Then CanNpcAttackPlayer = True End If Else If (GetPlayerY(index) - 1 = MapNPC(MapNum, MapNpcNum).Y) And (GetPlayerX(index) = MapNPC(MapNum, MapNpcNum).X) Then If Not map(MapNum).Tile(MapNPC(MapNum, MapNpcNum).X, MapNPC(MapNum, MapNpcNum).Y).block_right Then CanNpcAttackPlayer = True End If Else If (GetPlayerY(index) = MapNPC(MapNum, MapNpcNum).Y) And (GetPlayerX(index) + 1 = MapNPC(MapNum, MapNpcNum).X) Then If Not map(MapNum).Tile(MapNPC(MapNum, MapNpcNum).X, MapNPC(MapNum, MapNpcNum).Y).block_down Then CanNpcAttackPlayer = True End If Else If (GetPlayerY(index) = MapNPC(MapNum, MapNpcNum).Y) And (GetPlayerX(index) - 1 = MapNPC(MapNum, MapNpcNum).X) Then If Not map(MapNum).Tile(MapNPC(MapNum, MapNpcNum).X, MapNPC(MapNum, MapNpcNum).Y).block_up Then CanNpcAttackPlayer = True End If End If End If End If End If End If End If```In CanNPCMove() at top put:``` Dim blocked As Boolean```In 'Case DIR_UP' Change:``` ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Then CanNpcMove = False Exit Function End If```To:``` blocked = map(MapNum).Tile(X, Y).block_up ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Or blocked Then CanNpcMove = False Exit Function End If```In 'Case DIR_DOWN' Change:``` ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Then CanNpcMove = False Exit Function End If```To:``` blocked = map(MapNum).Tile(X, Y).block_down ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Or blocked Then CanNpcMove = False Exit Function End If```In 'Case DIR_LEFT' Change:``` ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Then CanNpcMove = False Exit Function End If```To:``` blocked = map(MapNum).Tile(X, Y).block_left ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Or blocked Then CanNpcMove = False Exit Function End If```In 'Case DIR_RIGHT' Change:``` ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Then CanNpcMove = False Exit Function End If```To:``` blocked = map(MapNum).Tile(X, Y).block_right ' Check to make sure that the tile is walkable. If TileType = TILE_TYPE_BLOCKED Or TileType = TILE_TYPE_NPCAVOID Or blocked Then CanNpcMove = False Exit Function End If```At bottom of modGameLogic Put:```Function GetTileBlocked(ByVal index As Long, ByVal dir As Long) as boolean Select Case dir Case DIR_UP GetTileBlocked = map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).block_up Case DIR_DOWN GetTileBlocked = map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).block_down Case DIR_LEFT GetTileBlocked = map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).block_left Case DIR_RIGHT GetTileBlocked = map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).block_right End SelectEnd Function```2.In modHandleData in Packet_MapData() under line ' .F2AnimSet = Val(MapData(MapIndex + 25)) ' Change:Everything in:``` For X = 0 To MAX_MAPX 'Code Next X```To:``` With map(MapNum).Tile(X, Y) .Ground = Val(MapData(MapIndex)) .Mask = Val(MapData(MapIndex + 1)) .Anim = Val(MapData(MapIndex + 2)) .Mask2 = Val(MapData(MapIndex + 3)) .M2Anim = Val(MapData(MapIndex + 4)) .Fringe = Val(MapData(MapIndex + 5)) .FAnim = Val(MapData(MapIndex + 6)) .Fringe2 = Val(MapData(MapIndex + 7)) .F2Anim = Val(MapData(MapIndex + 8)) .Type = Val(MapData(MapIndex + 9)) .Data1 = Val(MapData(MapIndex + 10)) .Data2 = Val(MapData(MapIndex + 11)) .Data3 = Val(MapData(MapIndex + 12)) .String1 = MapData(MapIndex + 13) .String2 = MapData(MapIndex + 14) .String3 = MapData(MapIndex + 15) .Light = Val(MapData(MapIndex + 16)) .GroundSet = Val(MapData(MapIndex + 17)) .MaskSet = Val(MapData(MapIndex + 18)) .AnimSet = Val(MapData(MapIndex + 19)) .Mask2Set = Val(MapData(MapIndex + 20)) .M2AnimSet = Val(MapData(MapIndex + 21)) .FringeSet = Val(MapData(MapIndex + 22)) .FAnimSet = Val(MapData(MapIndex + 23)) .Fringe2Set = Val(MapData(MapIndex + 24)) .F2AnimSet = Val(MapData(MapIndex + 25)) .block_down = MapData(MapIndex + 26) .block_left = MapData(MapIndex + 27) .block_right = MapData(MapIndex + 28) .block_up = MapData(MapIndex + 29) End With MapIndex = MapIndex + 30```3.In modTypes inside TileRec at BOTTOM put:``` blocked As Boolean block_up As Boolean block_down As Boolean block_right As Boolean block_left As Boolean```4.In modServerTCP inside MapCache_Create() under:``` MapData = MapData & (.GroundSet & SEP_CHAR & .MaskSet & SEP_CHAR & .AnimSet & SEP_CHAR & .Mask2Set & SEP_CHAR & .M2AnimSet & SEP_CHAR & .FringeSet & SEP_CHAR & .FAnimSet & SEP_CHAR & .Fringe2Set & SEP_CHAR & .F2AnimSet & SEP_CHAR)```Put:``` MapData = MapData & (CInt(.block_down) & SEP_CHAR & CInt(.block_left) & SEP_CHAR & CInt(.block_right) & SEP_CHAR & CInt(.block_up) & SEP_CHA```R)In GrappleHook() under ' If GetPlayerDir(index) = DIR_DOWN Then ' Change:``` If map(MapNum).Tile(X, Y).Type = TILE_TYPE_BLOCKED Then 'code end if```To:``` If Not map(MapNum).Tile(X, Y).Type = TILE_TYPE_ALLOW_ARROW Then If map(MapNum).Tile(X, Y).Type = TILE_TYPE_BLOCKED Or map(MapNum).Tile(X, Y).block_down Then 'code end if end if```Under ' If GetPlayerDir(index) = DIR_UP Then ' Change:``` If map(MapNum).Tile(X, Y).Type = TILE_T``` Link to comment Share on other sites More sharing options...
The Oracle Posted April 13, 2009 Share Posted April 13, 2009 dude, you are a fucking god. This is just the thing that we need to make bridges and stuff…no joke, you should be head dev for eclipse vb6. Link to comment Share on other sites More sharing options...
Akselj Posted April 13, 2009 Share Posted April 13, 2009 Holy shit. All I have to say, just as in the other code. Why do you do it? I don't understand. Most people make a friggen awesome code and never release it. But you…. Wow. There is so few people contributing to the community like you. We need more people like you. And I agree with Oracle, you should be lead coder for Eclipse. Holy shit. Link to comment Share on other sites More sharing options...
Nubzero Posted April 13, 2009 Share Posted April 13, 2009 Very nice. Link to comment Share on other sites More sharing options...
xeross Posted April 13, 2009 Share Posted April 13, 2009 You are truly a vb6 god. :PRegards, Xeross Link to comment Share on other sites More sharing options...
Tyr Posted April 13, 2009 Share Posted April 13, 2009 This is very.. very handy! sometimes its like, huh why can't i walk here? This will surely be added in Aura… and credited of course. Link to comment Share on other sites More sharing options...
Eviltyphoon Posted April 13, 2009 Share Posted April 13, 2009 Wow. This is great!!! You're a god man… Link to comment Share on other sites More sharing options...
xeross Posted April 13, 2009 Share Posted April 13, 2009 This should be implemented in EE3.0Regards, Xeross Link to comment Share on other sites More sharing options...
unnown Posted April 14, 2009 Share Posted April 14, 2009 way to much code, i made the exact same thing, waaaaay smaller Link to comment Share on other sites More sharing options...
dao Posted April 14, 2009 Share Posted April 14, 2009 niiice nice nice work dude this will help alot of people Link to comment Share on other sites More sharing options...
the_best_flash Posted April 15, 2009 Author Share Posted April 15, 2009 Thanks all. If you have any problems I will try to fix them.I'm not really that great of a VB coder; I can make things work, but they usually don't work in the most efficient way and have a lot of code.@UnknownHave you posted the source somewhere here? I would like to look at it. Most of the VB I learned was from looking at source code.I could have used some for loops and an array of booleans instead of 4 different variables. That would have decreased some of the code…Also if I would made the directional block a tile attribute and used the tile attribute info variables, it could have decreased the size a little more. But I wanted to be able to make a warp tile that was bocked from several directions...I'll have to try to write more efficient code. Link to comment Share on other sites More sharing options...
the_best_flash Posted April 15, 2009 Author Share Posted April 15, 2009 Bug fix. The new source_stuff.rar can be found [here](http://www.touchofdeathforums.com/smf/index.php?action=dlattach;topic=42497.0;attach=7830).In order to allow arrows or the grapple over some directionally blocked tiles you will need to change the code below. I have changed this code in the main post.This will allow you to set a tile attribute that will allow arrows and the grapple to ignore the directional blocks.CLINET1\. In modDirectX inside BltArrow change the```select case dir 'codeend select ```To:``` Select Case Dir Case 1 If map(GetPlayerMap(MyIndex)).Tile(X + 1, y).block_left And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 2 If map(GetPlayerMap(MyIndex)).Tile(X - 1, y).block_right And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 3 If map(GetPlayerMap(MyIndex)).Tile(X, y + 1).block_up And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If Case 4 If map(GetPlayerMap(MyIndex)).Tile(X, y - 1).block_down And Not map(GetPlayerMap(MyIndex)).Tile(X + 1, y).Type = TILE_TYPE_ALLOW_ARROW Then Player(Index).Arrow(z).Arrow = 0 prev_x = -1 prev_y = -1 End If End Select ```2\. in modGameEditor under EditorMouseDown() under the first ( ElseIf MapEditorSelectedType = 2 Then )Change:``` If .Type = 0 Then```To:``` If .Type = 0 Or .Type = TILE_TYPE_ALLOW_ARROW Then If .Type = TILE_TYPE_ALLOW_ARROW Then frmMapBlock.block_arrow = 0 End If```Under the first:``` If frmMapBlock.OldStyle Then .Type = TILE_TYPE_BLOCKED ElseIf frmMapBlock.hideblock.Value = 0 Then ```Add:``` If frmMapBlock.block_arrow.Value = 0 Then .Type = TILE_TYPE_ALLOW_ARROW End If```3\. In frmMapEditor in cmdFill_Click() under the first:``` If frmMapBlock.OldStyle Then .Type = TILE_TYPE_BLOCKED Else```Add:``` If frmMapBlock.block_arrow.Value = 0 Then .Type = TILE_TYPE_ALLOW_ARROW End If```4\. In modConstants under:```Public Const TILE_TYPE_LOWER_STAT = 31```Add:```Public Const TILE_TYPE_ALLOW_ARROW = 32```SERVER1\. In modServerTCP for each direction Change:(Note: The only code that should be changing is the addition of another 'If' statement the direction of the blocking should stay the same.)``` If map(MapNum).Tile(X, Y).Type = TILE_TYPE_BLOCKED Or map(MapNum).Tile(X, Y).block_up Then Call SendDataToMap(GetPlayerMap(index), "hookshot" & SEP_CHAR & index & SEP_CHAR & Item(GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))).Data3 & SEP_CHAR & GetPlayerDir(index) & SEP_CHAR & X & SEP_CHAR & Y & SEP_CHAR & 0 & END_CHAR) Player(index).HookShotX = X Player(index).HookShotY = Y Exit Sub End If```To:``` If Not map(MapNum).Tile(X, Y).Type = TILE_TYPE_ALLOW_ARROW Then If map(MapNum).Tile(X, Y).Type = TILE_TYPE_BLOCKED Or map(MapNum).Tile(X, Y).block_up Then Call SendDataToMap(GetPlayerMap(index), "hookshot" & SEP_CHAR & index & SEP_CHAR & Item(GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))).Data3 & SEP_CHAR & GetPlayerDir(index) & SEP_CHAR & X & SEP_CHAR & Y & SEP_CHAR & 0 & END_CHAR) Player(index).HookShotX = X Player(index).HookShotY = Y Exit Sub End If end if```2\. in modConstants Under:```Public Const TILE_TYPE_LOWER_STAT = 31```Add:```Public Const TILE_TYPE_ALLOW_ARROW = 32``` Link to comment Share on other sites More sharing options...
Alpha Posted April 16, 2009 Share Posted April 16, 2009 Oh my god. I've been looking everywhere for this, tried before, but it doesn't work.THANK YOU!!-Alpha Link to comment Share on other sites More sharing options...
tiggilyboo Posted April 18, 2009 Share Posted April 18, 2009 Very nice work TBF, I'm glad your back to working on source and helping the community :D Handy idea, and simplistic usage.Great work! Link to comment Share on other sites More sharing options...
the_best_flash Posted April 29, 2009 Author Share Posted April 29, 2009 Another bug fix. I was accidentally converting some strings to numbers.IN the client in HandleData()Change:``` .block_down = Val(parse(n + 26)) .block_left = Val(parse(n + 27)) .block_right = Val(parse(n + 28)) .block_up = Val(parse(n + 29))```To:``` .block_down = parse(n + 26) .block_left = parse(n + 27) .block_right = parse(n + 28) .block_up = parse(n + 29)```In the Server in modHandleData in HandleData()Change:``` .block_down = Val(MapData(MapIndex + 26)) .block_left = Val(MapData(MapIndex + 27)) .block_right = Val(MapData(MapIndex + 28)) .block_up = Val(MapData(MapIndex + 29))```To:``` .block_down = MapData(MapIndex + 26) .block_left = MapData(MapIndex + 27) .block_right = MapData(MapIndex + 28) .block_up = MapData(MapIndex + 29)```I have updated the code up above. Link to comment Share on other sites More sharing options...
westin444 Posted April 30, 2009 Share Posted April 30, 2009 I think I understand how about half of this works. I was able to install it easily enough into my current code. Link to comment Share on other sites More sharing options...
anasky Posted April 30, 2009 Share Posted April 30, 2009 Looks good, but I don't think it's handy.I mean, for couches it's OK, but I can't think of another situation it might be needed. Link to comment Share on other sites More sharing options...
westin444 Posted April 30, 2009 Share Posted April 30, 2009 like others have saidchairs ;)stairsectstill, it's a great block, might be especially good for side scrollers? Link to comment Share on other sites More sharing options...
LinuZ_ Posted May 3, 2009 Share Posted May 3, 2009 Hopefully I am not bumping this too badly.First I'd like to say that this is an awesome addition, you will be in the credits.However whilest installing it I didn't find GrappleHook or what it was called, I assumed this was another addition, right?Oh well, I have now installed it but I recieve a error:> –-------------------------> Microsoft Visual Basic> ---------------------------> Compile error:> > Function call on left-hand side of assignment must return Variant or Object> ---------------------------> OK Help > ---------------------------And it highlights _**Dir** = 1_ in BltArrows.Can you help me? Link to comment Share on other sites More sharing options...
Drummerpete Posted May 3, 2009 Share Posted May 3, 2009 Please compile this into a fresh client for us who don't have VB. =] Link to comment Share on other sites More sharing options...
LinuZ_ Posted May 3, 2009 Share Posted May 3, 2009 Fixed the error, lol. VB didn't just seem to like the name Dir as it is a function name too so I changed it to zDir and Dim'd it before. And now it works!Awesome man! <3 Link to comment Share on other sites More sharing options...
damian666 Posted May 19, 2009 Share Posted May 19, 2009 ugh, i have a allready edited client, which i took out a boatload of shit.and it seems it wont work on it anymore…does that mean i have to start over?or could ya lend me a hand?Damian666PS, my maps after editing the client show all pink :P Link to comment Share on other sites More sharing options...
the_best_flash Posted May 20, 2009 Author Share Posted May 20, 2009 What did you remove?I'll try to help. I'll only be on here intermittently due to the fact that I am somewhat busy right now.So, it wasn't pink before you added the code. Then after it was added your maps became pink?I didn't change any drawing code, except where I have it draw the text when your in the editor…Maybe you installed the section that draws the text wrong?Did you miss an end if? or somehow change it so that your map only renders when you click the 'hide in editor' check box in the editor?Or if you modified how the maps are stored the section that receives the map from the server might be wrong. Did you run the converter?Also make sure that you pasted the new tile variables at the BOTTOM of the tile typedef. Link to comment Share on other sites More sharing options...
Zawk Posted June 6, 2009 Share Posted June 6, 2009 Ok, so I added the client side correctly but when I go to compile I get the following error(see pic) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 6, 2009 Share Posted June 6, 2009 You have to open the vbp file, just the files in the Source folder (e.g. Server.vbp or Eclipse.vbp) 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