Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Im having trouble with my map. It seems like the layers are all messed up. When I try to put out a mask, it goes into animation2 etc..
So for those I know programming I could send the parts of code in PM.
Hope you can help me out.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Maybe you messed up those little option boxes (I remember there being option boxes...)?
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Kite Wrote:Maybe you messed up those little option boxes (I remember there being option boxes...)? Yes, but they worked fine before adding byte arrays. But either way, I'll recheck that.
Post exactly what you are sending, and what you are reading, from/to the packet buffer.
Dave Wrote:I remember having a particularily hard time getting maps to send correctly. Look in the Valkoria source for something to help, maybe.
the version of valkoria i have doesnt have byte arrays o.O, its the normal one downloaded from your site callled valkoria_src
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Client:
Code: Public Sub SendMap()
Erase Buffer
Buffer = AddLongToBuffer(Buffer, GetPlayerMap(MyIndex))
Buffer = AddToBuffer(Buffer, VarPtr(Map), LenB(Map))
Call SendData(Buffer, SMsgMapData)
End Sub
Server:
Code: Private Sub HandleSMsgMapData(ByVal index As Long, ByVal StartAddr As Long, ByVal ByteLen As Long, ByVal ExtraVar As Long)
Dim i As Long, MapNum As Long
Dim Buffer() As Byte
If HasAccess(index, ADMIN_MAPPER) = NO Then Exit Sub
Buffer = FillBuffer(StartAddr, ByteLen)
MapNum = GetLongFromBuffer(Buffer, True)
Call CopyMemory(ByVal VarPtr(Map(MapNum)), Buffer(0), LenB(Map(MapNum)))
Call SendMapNpcsToMap(MapNum)
Call SpawnMapNpcs(MapNum)
'Save the map
Call SaveMap(MapNum)
' Refresh map for everyone online
For i = 1 To HighIndex
If IsPlaying(i) And GetPlayerMap(i) = MapNum Then
Call PlayerWarp(i, MapNum, GetPlayerX(i), GetPlayerY(i))
End If
Next i
End Sub
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Actually, now I think of it I had trouble sending everything but maps when I tried it out.
I tried out Ver's source and spent a while fixing all the Development packets.
I think maps were the only Dev packet which worked for me.
I don't exactly know how Verrigan's style works, but, wouldn't you want this:
Code: Buffer = AddLongToBuffer(Buffer, GetPlayerMap(MyIndex))
Buffer = AddToBuffer(Buffer, VarPtr(Map), LenB(Map))
To be this?
Code: Buffer = AddLongToBuffer(Buffer, GetPlayerMap(MyIndex))
Buffer = Buffer & AddToBuffer(Buffer, VarPtr(Map), LenB(Map))
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Nope, it cant be like that. They are supposed to look like this:
Code: Buffer = AddLongToBuffer(Buffer, GetPlayerMap(MyIndex))
Buffer = AddToBuffer(Buffer, VarPtr(Map), LenB(Map))
Ah, I see how it works. Nevermind. :wink:
@ Dave
i didnt find a valkoria version with byte array packets o.O
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Shot me! The problem was that the Type didnt match on both sides, so i just replaced them both with:
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
Mask2 As Integer
M2Anim As Integer
FAnim As Integer
Fringe2 As Integer
F2Anim As Integer
End Type
Never thought that could matter
|