| Mirage Source http://www.miragesource.net/forums/ |
|
| Byte Array: Map Problem http://www.miragesource.net/forums/viewtopic.php?f=201&t=1188 |
Page 1 of 20 |
| Author: | William [ Sat Jan 20, 2007 12:27 am ] |
| Post subject: | Byte Array: Map Problem |
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. |
|
| Author: | Robin [ Sat Jan 20, 2007 12:29 am ] |
| Post subject: | |
Maybe you messed up those little option boxes (I remember there being option boxes...)? |
|
| Author: | William [ Sat Jan 20, 2007 12:33 am ] |
| Post subject: | |
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. |
|
| Author: | Lea [ Sat Jan 20, 2007 5:24 am ] |
| Post subject: | |
I remember having a particularily hard time getting maps to send correctly. Look in the Valkoria source for something to help, maybe. |
|
| Author: | Spodi [ Sat Jan 20, 2007 6:25 am ] |
| Post subject: | |
Post exactly what you are sending, and what you are reading, from/to the packet buffer. |
|
| Author: | Gilgamesch [ Sat Jan 20, 2007 10:03 am ] |
| Post subject: | |
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 |
|
| Author: | William [ Sat Jan 20, 2007 11:18 am ] |
| Post subject: | |
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 |
|
| Author: | Robin [ Sat Jan 20, 2007 1:11 pm ] |
| Post subject: | |
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. |
|
| Author: | Spodi [ Sat Jan 20, 2007 1:15 pm ] |
| Post subject: | |
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)) |
|
| Author: | William [ Sat Jan 20, 2007 1:38 pm ] |
| Post subject: | |
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)) |
|
| Author: | Spodi [ Sat Jan 20, 2007 1:40 pm ] |
| Post subject: | |
Ah, I see how it works. Nevermind. |
|
| Author: | Lea [ Sat Jan 20, 2007 1:56 pm ] |
| Post subject: | |
Verrigan's system uses add and get functions. Adding it appends the new data to the byte array. Getting it has the option of take and delete, or just take. |
|
| Author: | Gilgamesch [ Sat Jan 20, 2007 3:50 pm ] |
| Post subject: | |
@ Dave i didnt find a valkoria version with byte array packets o.O |
|
| Author: | Lea [ Sat Jan 20, 2007 8:27 pm ] |
| Post subject: | |
It's not public. William has a copy of it. |
|
| Author: | William [ Fri Jan 26, 2007 8:15 pm ] |
| Post subject: | |
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 |
|
| Author: | lordgivemick [ Sat Jan 27, 2007 12:39 am ] |
| Post subject: | |
well i told you there was something that wasn't right. |
|
| Author: | wanai [ Thu May 12, 2022 7:09 am ] |
| Post subject: | Re: Byte Array: Map Problem |
Edga |
|
| Author: | wanai [ Thu May 12, 2022 7:10 am ] |
| Post subject: | Re: Byte Array: Map Problem |
257.4 |
|
| Author: | wanai [ Thu May 12, 2022 7:11 am ] |
| Post subject: | Re: Byte Array: Map Problem |
Spen |
|
| Author: | wanai [ Thu May 12, 2022 7:12 am ] |
| Post subject: | Re: Byte Array: Map Problem |
Repr |
|
| Author: | wanai [ Thu May 12, 2022 7:13 am ] |
| Post subject: | Re: Byte Array: Map Problem |
Andr |
|
| Author: | wanai [ Thu May 12, 2022 7:15 am ] |
| Post subject: | Re: Byte Array: Map Problem |
Arab |
|
| Page 1 of 20 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|