| Mirage Source http://miragesource.net/forums/ |
|
| Spoon's Huge Flying Tutorial http://miragesource.net/forums/viewtopic.php?f=210&t=1176 |
Page 1 of 1 |
| Author: | James [ Wed Jan 17, 2007 5:40 am ] |
| Post subject: | Spoon's Huge Flying Tutorial |
Originally posted by Spoon, not tested with MSE! I'm lazy so if a mod wants to "code" the code stuff, go ahead. +-----------------------------------------------------------------+ | Flight Tutorial Written By Spoon with fixes! | +-----------------------------------------------------------------+ Okay here is the power of flight as coded by me including mapeditor attribute and /fly <username optional> ----------------------------------- --------- SERVER SIDE ------------- ----------------------------------- Open: Server.modTypes Code: Find: Guild As Byte Add: Fly As Byte Code: Find: Player(index).Char(i).Guild = 0 Add: Player(Index).Char(i).Fly = 0 Code: Find: Player(index).Char(CharNum).Guild = 0 Add: Player(Index).Char(CharNum).Fly = 0 Add: the following to the end of Server.modTypes Code: Function GetPlayerFly(ByVal index As Long) As Long GetPlayerFly = Player(index).Char(Player(index).CharNum).Fly End Function Sub SetPlayerFly(ByVal index As Long, ByVal x As Long) Player(index).Char(Player(index).CharNum).Fly = x End Sub Open: Server.modDatabase Code: Find: Call PutVar(FileName, "CHAR" & i, "Guild", STR(Player(index).Char(i).Guild)) Add: Call PutVar(FileName, "CHAR" & i, "Fly", STR(Player(index).Char(i).Fly)) Code: Find: Player(index).Char(i).Guild = Val(GetVar(FileName, "CHAR" & i, "Guild")) Add: Player(index).Char(i).Fly = Val(GetVar(FileName, "CHAR" & i, "Fly")) Code: Find: Player(index).Char(CharNum).MAGI = Class(ClassNum).MAGI Add: Player(index).Char(CharNum).Fly = 0 Open: Server.modGameLogic Code: Find: Sub PlayerMove Do: replace this part: 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 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 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)).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 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)).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 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 ' Check to see if the tile is a warp tile, and if so warp them If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_WARP Then MapNum = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data1 x = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2 y = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data3 Call PlayerWarp(index, MapNum, x, y) Moved = YES End If ' Check for key trigger open If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_KEYOPEN Then x = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data1 y = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2 If Map(GetPlayerMap(index)).Tile(x, y).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(index)).DoorOpen(x, y) = NO Then TempTile(GetPlayerMap(index)).DoorOpen(x, y) = YES TempTile(GetPlayerMap(index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(index), "MAPKEY" & SEP_CHAR & x & SEP_CHAR & y & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(index), "A door has been unlocked.", White) End If End If with this: 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 GetPlayerFly(index) = 1 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 Else 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 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 GetPlayerFly(index) = 1 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 Else 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 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 GetPlayerFly(index) = 1 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 Else 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 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 GetPlayerFly(index) = 1 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 Else 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 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 If GetPlayerFly(index) = 1 Then Exit Sub ' Check to see if the tile is a warp tile, and if so warp them If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_WARP Then MapNum = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data1 x = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2 y = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data3 Call PlayerWarp(index, MapNum, x, y) Moved = YES End If ' Check for key trigger open If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_KEYOPEN Then x = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data1 y = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2 If Map(GetPlayerMap(index)).Tile(x, y).Type = TILE_TYPE_KEY And TempTile(GetPlayerMap(index)).DoorOpen(x, y) = NO Then TempTile(GetPlayerMap(index)).DoorOpen(x, y) = YES TempTile(GetPlayerMap(index)).DoorTimer = GetTickCount Call SendDataToMap(GetPlayerMap(index), "MAPKEY" & SEP_CHAR & x & SEP_CHAR & y & SEP_CHAR & 1 & SEP_CHAR & END_CHAR) Call MapMsg(GetPlayerMap(index), "A door has been unlocked.", White) End If End If Open: Server.modServerTCP Code: Find: Sub Handledata Add: this code in there someplace Outside of all the other packets Code: ' ::::::::::::::::::::::::::: ' :: characters Fly packet :: ' ::::::::::::::::::::::::::: If LCase(Parse(0)) = "setfly" Then n = FindPlayer(Parse(2)) Call SetPlayerFly(n, Val(Parse(1))) End If Add: end of the modSeverTCP add this Code: Sub SendCharFly(ByVal index As Long) Dim Packet As String Packet = "CHARFLY" & SEP_CHAR & Player(index).Char(i).Fly & SEP_CHAR & END_CHAR Call SendDataTo(index, Packet) End Sub END SERVER SIDE! ----------------------------------- ----------- CLIENT SIDE ----------- ----------------------------------- Open: Client.modClientTCP Find: Sub HandleData Add: this code to the end of it some place safe Code: ' :::::::::::::::::::::::::: ' :: Character Fly Status :: ' :::::::::::::::::::::::::: If LCase(Parse(0)) = "charfly" Then If Parse(1) = 0 Then Call SetPlayerFly(MyIndex, 0) Else Call SetPlayerFly(MyIndex, 1) End If Exit Sub End If Add: this code to the end of the modClientTCP Code: Sub SendSetFly(Index, ByVal FlyNum As Integer) Dim Packet As String Packet = "SETFLY" & SEP_CHAR & FlyNum & SEP_CHAR & Index & SEP_CHAR & END_CHAR Call SendData(Packet) End Sub Open: Client.modGameLogic Find: ' Lock the backbuffer so we can draw text and names Add: this code right before it Code: ' Blit out flying players If GetPlayerFly(MyIndex) = 1 Then For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call BltPlayer(i) End If Next i End If Find: Sub CanMove Do: a bit of rearangeing in here for each of the four directions you are going to need to rearange code 4 times.. from this: Code: CanMove = False ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If Exit Function to make it look like this: Code: ' Set the new direction if they weren't facing that direction If d <> DIR_UP Then Call SendPlayerDir End If If GetPlayerFly(MyIndex) = 1 Then Exit Function CanMove = False Exit Function that is the first DIR_UP section there are three more spots in the DIR_UP section that will need to be edited toa smilar apperance if you search for--> ' Set the new direction if they weren't facing that direction then you will be able to find them all Open: Client.modTypes Code: Find: Guild As Byte Add: Fly As Byte Code: Find: Player(Index).PK = NO Add: Player(Index).Fly = 0 Find: end of the modTypes.bas Add: these two sets of code Code: Function GetPlayerFly(ByVal Index As Long) As Long GetPlayerFly = Player(Index).Fly End Function Sub SetPlayerFly(ByVal Index As Long, ByVal X As Long) Player(Index).Fly = X End Sub Open: Client.modGameLogic Find: Sub HandleKeypresses Add: this code Code: 'Flying command If LCase(Mid(MyText, 1, 4)) = "/fly" Then If LCase(Mid(MyText, 5, 12)) <> "" Then MyText = LCase(Mid(MyText, 5, 12)) n = FindPlayer(MyText) If GetPlayerFly(n) = 0 Then Call SetPlayerFly(n, 1) Call SendSetFly(MyText, 1) Else Call SetPlayerFly(n, 0) Call SendSetFly(MyText, 0) End If MyText = "" Exit Sub Else If GetPlayerFly(MyIndex) = 0 Then Call SetPlayerFly(MyIndex, 1) Call SendSetFly(MyIndex, 1) Else Call SetPlayerFly(MyIndex, 0) Call SendSetFly(MyIndex, 0) End If MyText = "" Exit Sub End If End If Explanation of this code: SYNTAX= /fly <username> this code checks to see if teh commadn /fly was entered it also checks to see who is going to be flying if no user name is specified the user of the command is the target that should be about it for the fly command the other subs and what not were put in already unless you didn't do the first part of this tutorial ----------------------------------- Finished Fly command ----------------------------------- FINALLY the mapeditor attribute for the fly option to add a mapeditor attribute you will need to add a radio button to your mapeditor attributes frame name it optFly now to add the code so it actualy does something.. Open: Client.modGameLogic Find: ' Gotta check :) Add: this code right after find Code: If Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex)).Type = TILE_TYPE_FLY Then If GetPlayerFly(MyIndex) = 1 Then Call SetPlayerFly(MyIndex, 0) Else Call SetPlayerFly(MyIndex, 1) End If End If Open: Client.modTypes Code: Find: Public Const TILE_TYPE_KEYOPEN = 6 Add: Public Const TILE_TYPE_FLY = 7 Do Also: the same on the server modTypes Tutorial Provided by Dr. Spoon "may the power of the source be on your side"-Dr. Spoon ok, found a slight problem... but here is the fix. Code: Sub SendCharFly(ByVal index As Long) Dim Packet As String Dim i As Long Packet = "CHARFLY" & SEP_CHAR & Player(index).Char(i).Fly & SEP_CHAR & END_CHAR Call SendDataTo(index, Packet) End Sub all that was missing was then dim i as long... Okay my bad i forgot one line of code.. here it is.. [/code] If .Type = TILE_TYPE_KEYOPEN Then Call DrawText(TexthDC, X * PIC_X + 8, Y * PIC_Y +8, "O", QBColor(White)) If .Type = TILE_TYPE_FLY Then Call DrawText(TexthDC, X * PIC_X + 8, Y * PIC_Y + 8, "F", QBColor(BrightGreen)) [/code] sorry about that.. youjust need the second line the first one is to show youwhere it goes.. in modGameLogic --> Sub GameLoop here be a fix for those minor problems.. teh one phsycoboy pointed out can be fixed by replacing this: Code: ' Blit out flying players If GetPlayerFly(MyIndex) = 1 Then For i = 1 To MAX_PLAYERS If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call BltPlayer(i) End If Next i End If With this: Code: ' Blit out flying players For i = 1 To MAX_PLAYERS If GetPlayerFly(i) = 1 Then If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call BltPlayer(i) End If End If Next i next little bug..(beign ableto wlk over other flying players if you want to keep this possible then disreguard this fix inside the CanMove sub find this line Code: ' Check to see if a player is already on that tile then find and replace this: Code: If GetPlayerFly(MyIndex) = 1 Then Exit Function with this: Code: If GetPlayerFly(MyIndex) = 1 Then If GetPlayerFly(i) = 1 Then CanMove = False Exit Function End If the second bug fix posted above doesn't work still in testing on a few other optoins.. Add this line of code in modDatabase--saveplayer Sub Code: Call PutVar(FileName, "CHAR" & i, "FLY", STR(Player(Index).Char(i).Fly)) I put it under the comment "Position" because thats what has the most to do with it... Then find the Openplayer Sub. Code: Player(Index).Char(i).Fly = Val(GetVar(FileName, "CHAR" & i, "Fly"))
Add that in the corrisponding spot. I think you will need to delete all your accounts... or go add the value yourself... |
|
| Author: | TheRealDamien [ Fri Jan 19, 2007 9:49 am ] |
| Post subject: | |
For such a simple thing whhy the hell is it so long? |
|
| Author: | Robin [ Fri Jan 19, 2007 10:35 am ] |
| Post subject: | |
Because he decided to save to .ini and also he was nice, and showed you where you needed to add it, rather than simply saying 'search for '""' and add to it underneath all of them' or 'go add it where it needs to go, kkthxbai |
|
| Author: | TheRealDamien [ Fri Jan 19, 2007 12:17 pm ] |
| Post subject: | |
Hmm I can see its in .ini and I am greatful he decided to show us EXACLY how to add it through but should it really be this big? I mean its just a tut to walk through objects and such. |
|
| Author: | William [ Fri Jan 19, 2007 2:14 pm ] |
| Post subject: | |
TheRealDamien wrote: Hmm I can see its in .ini and I am greatful he decided to show us EXACLY how to add it through but should it really be this big? I mean its just a tut to walk through objects and such.
Make a smaller one, or appreciate this one. |
|
| Author: | Matt [ Fri Jan 19, 2007 2:52 pm ] |
| Post subject: | |
Not all of this is code you need to add, some of it is code that's there, before what you need to add, or after. Geeze. |
|
| Author: | grimsk8ter11 [ Fri Jan 19, 2007 7:36 pm ] |
| Post subject: | |
To simplify Advocate's words, he has the code to replace as well as the code to replace with in there, giving it the allusion that its very long and drawn out, really, its rather short just a lot of code segments. ill go through it and add code blocks |
|
| Author: | Robin [ Fri Jan 19, 2007 7:46 pm ] |
| Post subject: | |
grimsk8ter11 wrote: To simplify Advocate's words, he has the code to replace as well as the code to replace with in there, giving it the illusion that its very long and drawn out, really, its rather short just a lot of code segments.
ill go through it and add code blocks That's what I was meant to say, but I said it wrong <3 Grim. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|