damian666 Posted November 25, 2009 Author Share Posted November 25, 2009 ok, so im trying to get a extra entry in my maprec, so i can add a background sound in the map files.```Type MapRec name As String * 40 Revision As Integer Moral As Byte Up As Integer Down As Integer Left As Integer Right As Integer Music As String BootMap As Integer BootX As Byte BootY As Byte Shop As Integer Indoors As Byte Tile() As TileRec Npc(1 To 15) As Integer SpawnX(1 To 15) As Byte SpawnY(1 To 15) As Byte Owner As String Scrolling As Byte Weather As Integer Sound as stringEnd Type```that should work right?then in the mapdata packet in client, i add this:```Public Sub Packet_MapData(ByRef Parse() As String) Dim n As Long, Y As Long, X As Long n = 1 Map(Val(Parse(1))).name = Parse(n + 1) Map(Val(Parse(1))).Revision = Val(Parse(n + 2)) Map(Val(Parse(1))).Moral = Val(Parse(n + 3)) Map(Val(Parse(1))).Up = Val(Parse(n + 4)) Map(Val(Parse(1))).Down = Val(Parse(n + 5)) Map(Val(Parse(1))).Left = Val(Parse(n + 6)) Map(Val(Parse(1))).Right = Val(Parse(n + 7)) Map(Val(Parse(1))).Music = Parse(n + 8) Map(Val(Parse(1))).BootMap = Val(Parse(n + 9)) Map(Val(Parse(1))).BootX = Val(Parse(n + 10)) Map(Val(Parse(1))).BootY = Val(Parse(n + 11)) Map(Val(Parse(1))).Indoors = Val(Parse(n + 12)) Map(Val(Parse(1))).Weather = Val(Parse(n + 13)) Map(Val(Parse(1))).Sound = Val(Parse(n + 14)) n = n + 15 For Y = 0 To MAX_MAPY For X = 0 To MAX_MAPX Map(Val(Parse(1))).Tile(X, Y).Ground = Val(Parse(n)) Map(Val(Parse(1))).Tile(X, Y).mask = Val(Parse(n + 1)) Map(Val(Parse(1))).Tile(X, Y).Anim = Val(Parse(n + 2)) Map(Val(Parse(1))).Tile(X, Y).Mask2 = Val(Parse(n + 3)) Map(Val(Parse(1))).Tile(X, Y).M2Anim = Val(Parse(n + 4)) Map(Val(Parse(1))).Tile(X, Y).Fringe = Val(Parse(n + 5)) Map(Val(Parse(1))).Tile(X, Y).FAnim = Val(Parse(n + 6)) Map(Val(Parse(1))).Tile(X, Y).Fringe2 = Val(Parse(n + 7)) Map(Val(Parse(1))).Tile(X, Y).F2Anim = Val(Parse(n + 8)) Map(Val(Parse(1))).Tile(X, Y).Type = Val(Parse(n + 9)) Map(Val(Parse(1))).Tile(X, Y).Data1 = Val(Parse(n + 10)) Map(Val(Parse(1))).Tile(X, Y).Data2 = Val(Parse(n + 11)) Map(Val(Parse(1))).Tile(X, Y).Data3 = Val(Parse(n + 12)) Map(Val(Parse(1))).Tile(X, Y).String1 = Parse(n + 13) Map(Val(Parse(1))).Tile(X, Y).String2 = Parse(n + 14) Map(Val(Parse(1))).Tile(X, Y).String3 = Parse(n + 15) Map(Val(Parse(1))).Tile(X, Y).Light = Val(Parse(n + 16)) Map(Val(Parse(1))).Tile(X, Y).GroundSet = Val(Parse(n + 17)) Map(Val(Parse(1))).Tile(X, Y).MaskSet = Val(Parse(n + 18)) Map(Val(Parse(1))).Tile(X, Y).AnimSet = Val(Parse(n + 19)) Map(Val(Parse(1))).Tile(X, Y).Mask2Set = Val(Parse(n + 20)) Map(Val(Parse(1))).Tile(X, Y).M2AnimSet = Val(Parse(n + 21)) Map(Val(Parse(1))).Tile(X, Y).FringeSet = Val(Parse(n + 22)) Map(Val(Parse(1))).Tile(X, Y).FAnimSet = Val(Parse(n + 23)) Map(Val(Parse(1))).Tile(X, Y).Fringe2Set = Val(Parse(n + 24)) Map(Val(Parse(1))).Tile(X, Y).F2AnimSet = Val(Parse(n + 25)) n = n + 26 Next Next For X = 1 To 15 Map(Val(Parse(1))).Npc(X) = Val(Parse(n)) Map(Val(Parse(1))).SpawnX(X) = Val(Parse(n + 1)) Map(Val(Parse(1))).SpawnY(X) = Val(Parse(n + 2)) n = n + 3 Next ' Save the map Call SaveLocalMap(Val(Parse(1))) ' Check if we get a map from someone else and if we were editing a map cancel it out If InEditor Or InHouseEditor Then InEditor = False InHouseEditor = False frmMapEditor.Visible = False frmHouseEditor.Visible = False frmDestiny.Show If frmMapWarp.Visible Then Unload frmMapWarp End If If frmMapProperties.Visible Then Unload frmMapProperties End If End IfEnd Sub```that should load it, as far as i know.But it errors with a overflow on the last line:```Map(Val(Parse(1))).Tile(X, Y).F2AnimSet = Val(Parse(n + 25))```and yes, ofcourse i have converted my maps, and my server is using the new maprec too.any help is appriciated, and im willing to share it if we can get it fixed XDDamian666 Link to comment Share on other sites More sharing options...
Robin Posted November 25, 2009 Share Posted November 25, 2009 You're trying to receive data you're not sending. Edit the packets sending to send the new data. Link to comment Share on other sites More sharing options...
damian666 Posted November 25, 2009 Author Share Posted November 25, 2009 i see what ya mean… XDok, now it loads them just fine, but when im saving the map, it fucks up still, and i did check the packet -.-oh well, 1 step closer...Thanx Robin, i hoped you or Joe would post ^^Damian666 Link to comment Share on other sites More sharing options...
Robin Posted November 26, 2009 Share Posted November 26, 2009 There's a handful of packets which send/receive the map data, hence why you should finalise your UDT structure before fucking around with the packets.Or just do the clever thing and send the entire thing as a copymemory dump. :P Link to comment Share on other sites More sharing options...
damian666 Posted November 26, 2009 Author Share Posted November 26, 2009 hehehe, i wish i was that good robin ^^ill just walk tru all packets, and get it sorted :)and i did get my packets sorted btw, it uses the same system as server.Damian666 Link to comment Share on other sites More sharing options...
damian666 Posted November 27, 2009 Author Share Posted November 27, 2009 ok, found it, it was indeed a forgotten place to update XDthanx robin, now my maps have music, AND background sound ^^Damian666 Link to comment Share on other sites More sharing options...
blackkat9666 Posted December 5, 2009 Share Posted December 5, 2009 sorry for being an "anoying fly" but that would be useful for a lot of ppl, just i suck at scripting and sourcing… Link to comment Share on other sites More sharing options...
damian666 Posted December 6, 2009 Author Share Posted December 6, 2009 yeah, but its a rather large edit…so even if i make a tut, most would fuck up on it anyway XDDamian666 Link to comment Share on other sites More sharing options...
Robin Posted December 6, 2009 Share Posted December 6, 2009 It's not hard to do at all, it's just fairly time consuming.If you know what you're doing, it shouldn't take longer than 5 minutes, but reading how to do every part will take a while. Link to comment Share on other sites More sharing options...
evilbunnie Posted December 6, 2009 Share Posted December 6, 2009 Make a tut please :cheesy:, Well, I just use playerrec and it just load it randomly when the server/client starts but i have never used it for a map. And i need it :D Link to comment Share on other sites More sharing options...
damian666 Posted December 6, 2009 Author Share Posted December 6, 2009 i agree with robin, its not hard, IF you know what your doing, which is my main concern here on eclipse XDbut ok, ill see when i get some time to get a tut going ^^Damian666 Link to comment Share on other sites More sharing options...
blackkat9666 Posted December 6, 2009 Share Posted December 6, 2009 i'll make sure to take my time for that so i don't mess up lol, i'll wait patiently for a tut :D 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