| Mirage Source http://miragesource.net/forums/ |
|
| Door Attribute Tile http://miragesource.net/forums/viewtopic.php?f=210&t=54 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Thu Jun 01, 2006 9:29 pm ] |
| Post subject: | Door Attribute Tile |
Author: funkynut Difficulty: 1/5 This will make door tile that acts like a key tile surrounded by key open tiles. :: SERVER & CLIENT SIDE :: In modTypes, add: Code: Public Const TILE_TYPE_DOOR = 16 :: SERVER SIDE :: In modGameLogic, in sub PlayerMove, find: Code: Select Case Dir Case DIR_UP ' Check to make sure not outside of boundries If GetPlayerY(Index) > 0 Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) - 1) = YES) Then Call SetPlayerY(Index, GetPlayerY(Index) - 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Up > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY) Moved = YES End If End If {..DIR_LEFT and DIR_DOWN stuff were here.} Case DIR_RIGHT ' Check to make sure not outside of boundries If GetPlayerX(Index) < MAX_MAPX Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index)) = YES) Then Call SetPlayerX(Index, GetPlayerX(Index) + 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Right > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Right, 0, GetPlayerY(Index)) Moved = YES End If End If End Select Replace with: Code: Select Case Dir Case DIR_UP ' Check to make sure not outside of boundries If GetPlayerY(Index) > 0 Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) - 1) = YES) Then ' Check to see if the tile is a door and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type <> TILE_TYPE_DOOR Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index)) = YES) Then Call SetPlayerY(Index, GetPlayerY(Index) - 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Up > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY) Moved = YES End If End If Case DIR_DOWN ' Check to make sure not outside of boundries If GetPlayerY(Index) < MAX_MAPY Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) + 1) = YES) Then ' Check to see if the tile is a door and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type <> TILE_TYPE_DOOR Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index), GetPlayerY(Index) + 1) = YES) Then Call SetPlayerY(Index, GetPlayerY(Index) + 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Down > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0) Moved = YES End If End If Case DIR_LEFT ' Check to make sure not outside of boundries If GetPlayerX(Index) > 0 Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index)) = YES) Then ' Check to see if the tile is a door and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index - x), GetPlayerY(Index)).Type <> TILE_TYPE_DOOR Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1) = YES) Then Call SetPlayerX(Index, GetPlayerX(Index) - 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Left > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Left, MAX_MAPX, GetPlayerY(Index)) Moved = YES End If End If Case DIR_RIGHT ' Check to make sure not outside of boundries If GetPlayerX(Index) < MAX_MAPX Then ' Check to make sure that the tile is walkable If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_BLOCKED Then ' Check to see if the tile is a key and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_KEY Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index)) = YES) Then ' Check to see if the tile is a door and if it is check if its opened If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type <> TILE_TYPE_DOOR Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) + 1, GetPlayerY(Index)) = YES) Then Call SetPlayerX(Index, GetPlayerX(Index) + 1) packet = "PLAYERMOVE" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & Movement & SEP_CHAR & END_CHAR Call SendDataToMapBut(Index, GetPlayerMap(Index), packet) Moved = YES End If End If End If Else ' Check to see if we can move them to the another map If Map(GetPlayerMap(Index)).Right > 0 Then Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Right, 0, GetPlayerY(Index)) Moved = YES End If End If End Select At the bottom of Sub PlayerMove, after the key open stuff, add: Code: ' /////////////////////// ' //check for door tile// '/////////////////////// x = GetPlayerX(Index) y = GetPlayerY(Index) 'check if doors on players left If Map(GetPlayerMap(Index)).Tile(x - 1, y).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(x - 1, y) = NO Then TempTile(GetPlayerMap(Index)).DoorOpen(x - 1, y) = YES TempTile(GetPlayerMap(Index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(Index), "MAPKEY" & SEP_CHAR & x - 1 & SEP_CHAR & y & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(Index), "A door has been unlocked.", White) End If 'check if doors on players right If Map(GetPlayerMap(Index)).Tile(x + 1, y).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(x + 1, y) = NO Then TempTile(GetPlayerMap(Index)).DoorOpen(x + 1, y) = YES TempTile(GetPlayerMap(Index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(Index), "MAPKEY" & SEP_CHAR & x + 1 & SEP_CHAR & y & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(Index), "A door has been unlocked.", White) End If 'check if doors above player If Map(GetPlayerMap(Index)).Tile(x, y - 1).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(x, y - 1) = NO Then TempTile(GetPlayerMap(Index)).DoorOpen(x, y - 1) = YES TempTile(GetPlayerMap(Index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(Index), "MAPKEY" & SEP_CHAR & x & SEP_CHAR & y - 1 & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(Index), "A door has been unlocked.", White) End If 'check of doors below player If Map(GetPlayerMap(Index)).Tile(x, y + 1).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(x, y + 1) = NO Then TempTile(GetPlayerMap(Index)).DoorOpen(x, y + 1) = YES TempTile(GetPlayerMap(Index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(Index), "MAPKEY" & SEP_CHAR & x & SEP_CHAR & y + 1 & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(Index), "A door has been unlocked.", White) End If In modGeneral, in sub GameAI, find: Code: If Map(y).Tile(x1, y1).Type = TILE_TYPE_KEY Replace with: Code: If Map(y).Tile(x1, y1).Type = TILE_TYPE_KEY or tile_type_door :: CLIENT SIDE :: In modGameLogic, in Sub GameLoop, find: Code: If .Type = TILE_TYPE_MESSAGE Then Call DrawText(TexthDC, x * PIC_X + 8, y * PIC_Y + 8, "M", QBColor(Yellow)) Beneath it, add: Code: If .Type = TILE_TYPE_DOOR Then Call DrawText(TexthDC, x * PIC_X + 8, y * PIC_Y + 8, "D", QBColor(Pink)) Now, replace the entire CanMove function with: Code: Function CanMove() As Boolean Dim i As Long, d As Long CanMove = True ' Make sure they aren't trying to move when they are already moving If Player(MyIndex).Moving <> 0 Then CanMove = False Exit Function End If ' Make sure they haven't just casted a spell If Player(MyIndex).CastedSpell = YES Then If GetTickCount > Player(MyIndex).AttackTimer + 1000 Then Player(MyIndex).CastedSpell = NO Else CanMove = False Exit Function End If End If d = GetPlayerDir(MyIndex) If DirUp Then Call SetPlayerDir(MyIndex, DIR_UP) ' Check to see if they are trying to go out of bounds If GetPlayerY(MyIndex) > 0 Then ' Check to see if the map tile is blocked or not If Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) - 1).Type = TILE_TYPE_BLOCKED Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If Exit Function End If ' Check to see if the key door is open or not If Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) - 1).Type = TILE_TYPE_KEY Or Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) - 1).Type = TILE_TYPE_DOOR Then ' This actually checks if its open or not If TempTile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) - 1).DoorOpen = NO Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If Exit Function End If End If ' Check to see if a player is already on that tile For i = 1 To MAX_PLAYERS If IsPlaying(i) Then If GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If (GetPlayerX(i) = GetPlayerX(MyIndex)) And (GetPlayerY(i) = GetPlayerY(MyIndex) - 1) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If Exit Function End If End If End If Next i ' Check to see if a npc is already on that tile For i = 1 To MAX_MAP_NPCS If MapNpc(i).Num > 0 Then If (MapNpc(i).x = GetPlayerX(MyIndex)) And (MapNpc(i).y = GetPlayerY(MyIndex) - 1) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If Exit Function End If End If Next i Else ' Check if they can warp to a new map If Map.Up > 0 Then Call SendPlayerRequestNewMap GettingMap = True End If CanMove = False Exit Function End If End If If DirDown Then Call SetPlayerDir(MyIndex, DIR_DOWN) ' Check to see if they are trying to go out of bounds If GetPlayerY(MyIndex) < MAX_MAPY Then ' Check to see if the map tile is blocked or not If Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) + 1).Type = TILE_TYPE_BLOCKED Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_DOWN Then Call SendPlayerDir End If Exit Function End If ' Check to see if the key door is open or not If Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) + 1).Type = TILE_TYPE_KEY Or Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) + 1).Type = TILE_TYPE_DOOR Then ' This actually checks if its open or not If TempTile(GetPlayerX(MyIndex), GetPlayerY(MyIndex) + 1).DoorOpen = NO Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_DOWN Then Call SendPlayerDir End If Exit Function End If End If ' Check to see if a player is already on that tile For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If (GetPlayerX(i) = GetPlayerX(MyIndex)) And (GetPlayerY(i) = GetPlayerY(MyIndex) + 1) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_DOWN Then Call SendPlayerDir End If Exit Function End If End If Next i ' Check to see if a npc is already on that tile For i = 1 To MAX_MAP_NPCS If MapNpc(i).Num > 0 Then If (MapNpc(i).x = GetPlayerX(MyIndex)) And (MapNpc(i).y = GetPlayerY(MyIndex) + 1) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_DOWN Then Call SendPlayerDir End If Exit Function End If End If Next i Else ' Check if they can warp to a new map If Map.Down > 0 Then Call SendPlayerRequestNewMap GettingMap = True End If CanMove = False Exit Function End If End If If DirLeft Then Call SetPlayerDir(MyIndex, DIR_LEFT) ' Check to see if they are trying to go out of bounds If GetPlayerX(MyIndex) > 0 Then ' Check to see if the map tile is blocked or not If Map.Tile(GetPlayerX(MyIndex) - 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_BLOCKED Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_LEFT Then Call SendPlayerDir End If Exit Function End If ' Check to see if the key door is open or not If Map.Tile(GetPlayerX(MyIndex) - 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_KEY Or Map.Tile(GetPlayerX(MyIndex) - 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_DOOR Then ' This actually checks if its open or not If TempTile(GetPlayerX(MyIndex) - 1, GetPlayerY(MyIndex)).DoorOpen = NO Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_LEFT Then Call SendPlayerDir End If Exit Function End If End If ' Check to see if a player is already on that tile For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If (GetPlayerX(i) = GetPlayerX(MyIndex) - 1) And (GetPlayerY(i) = GetPlayerY(MyIndex)) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_LEFT Then Call SendPlayerDir End If Exit Function End If End If Next i ' Check to see if a npc is already on that tile For i = 1 To MAX_MAP_NPCS If MapNpc(i).Num > 0 Then If (MapNpc(i).x = GetPlayerX(MyIndex) - 1) And (MapNpc(i).y = GetPlayerY(MyIndex)) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_LEFT Then Call SendPlayerDir End If Exit Function End If End If Next i Else ' Check if they can warp to a new map If Map.Left > 0 Then Call SendPlayerRequestNewMap GettingMap = True End If CanMove = False Exit Function End If End If If DirRight Then Call SetPlayerDir(MyIndex, DIR_RIGHT) ' Check to see if they are trying to go out of bounds If GetPlayerX(MyIndex) < MAX_MAPX Then ' Check to see if the map tile is blocked or not If Map.Tile(GetPlayerX(MyIndex) + 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_BLOCKED Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_RIGHT Then Call SendPlayerDir End If Exit Function End If ' Check to see if the key door is open or not If Map.Tile(GetPlayerX(MyIndex) + 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_KEY Or Map.Tile(GetPlayerX(MyIndex) + 1, GetPlayerY(MyIndex)).Type = TILE_TYPE_DOOR Then ' This actually checks if its open or not If TempTile(GetPlayerX(MyIndex) + 1, GetPlayerY(MyIndex)).DoorOpen = NO Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_RIGHT Then Call SendPlayerDir End If Exit Function End If End If ' Check to see if a player is already on that tile For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If (GetPlayerX(i) = GetPlayerX(MyIndex) + 1) And (GetPlayerY(i) = GetPlayerY(MyIndex)) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_RIGHT Then Call SendPlayerDir End If Exit Function End If End If Next i ' Check to see if a npc is already on that tile For i = 1 To MAX_MAP_NPCS If MapNpc(i).Num > 0 Then If (MapNpc(i).x = GetPlayerX(MyIndex) + 1) And (MapNpc(i).y = GetPlayerY(MyIndex)) Then CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_RIGHT Then Call SendPlayerDir End If Exit Function End If End If Next i Else ' Check if they can warp to a new map If Map.Right > 0 Then Call SendPlayerRequestNewMap GettingMap = True End If CanMove = False Exit Function End If End If End Function Find: Code: If frmMirage.optKeyOpen.Value = True Then .Type = TILE_TYPE_KEYOPEN .Data1 = KeyOpenEditorX .Data2 = KeyOpenEditorY .Data3 = 0 End If Beneath it, add: Code: If frmMirage.Optdoor.Value = True Then .Type = TILE_TYPE_DOOR .Data1 = 0 .Data2 = 0 .Data3 = 0 End If Finally, in the map editor add an option button called optDoor and you're finished. |
|
| Author: | Rezeyu [ Sun Dec 16, 2007 8:34 pm ] |
| Post subject: | Re: Door Attribute Tile |
Holy shit, has anyone actually looked at this tutorial? Look at this line, for deciding whether you can walk into a door or not: Code: If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index - x), GetPlayerY(Index)).Type <> TILE_TYPE_DOOR Or (Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_DOOR And TempTile(GetPlayerMap(Index)).DoorOpen(GetPlayerX(Index) - 1, GetPlayerY(Index) + 1) = YES) Then GetPlayerX(Index - x)? It should be GetPlayerX(Index) - 1 The way he had it is checking an index lower than yours, to whatever the hell x was. then just after it.. Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type That's checking if you're standing ON a door. Tons of them are messed up, the direction up ones are checking the X variables instead of Y.. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|