| Mirage Source http://www.miragesource.net/forums/ |
|
| MS4 http://www.miragesource.net/forums/viewtopic.php?f=193&t=6148 |
Page 1 of 2 |
| Author: | Matt [ Tue Aug 18, 2009 1:48 pm ] |
| Post subject: | MS4 |
This is my version of MS4, with a lot of help from Jacob. What makes this one different from the current release? Dynamic maps. You can set the maps from the default max_mapx and max_mapy to 255. 255x255 is the biggest you can go and trust me, there's no need to go higher than that. With the byte array packets sending maps that large won't be a problem. Even that huge, they will send just as fast as a normal size map. Anyways, I've bored you enough. Here's the download: MS4 Dynamic Maps, Byte Arrays |
|
| Author: | Kousaten [ Tue Aug 18, 2009 2:37 pm ] |
| Post subject: | Re: MS4 |
I've got a pretty good feeling there's another step other than setting MAX_MAPX and MAX_MAPY...
|
|
| Author: | Matt [ Tue Aug 18, 2009 2:39 pm ] |
| Post subject: | Re: MS4 |
Haha. I didn't fully test it all. I just did the byte array packets over the pass 2 days or so. I'll get it fixed. Thanks. |
|
| Author: | Matt [ Tue Aug 18, 2009 2:42 pm ] |
| Post subject: | Re: MS4 |
Actually, after showing Jacob this, he told me what you did wrong. You don't change the map size in the code. When you edit a map, you change it in the properties for that map. |
|
| Author: | Kousaten [ Tue Aug 18, 2009 2:43 pm ] |
| Post subject: | Re: MS4 |
Thanks guys. |
|
| Author: | Matt [ Tue Aug 18, 2009 2:44 pm ] |
| Post subject: | Re: MS4 |
Kousaten wrote: :o Oh-hoh. So that's how to make it work. Thanks guys. Lol. After all the debugging we did with the byte arrays, I was going to kill you if you had found another bug. >.> |
|
| Author: | Kousaten [ Tue Aug 18, 2009 2:47 pm ] |
| Post subject: | Re: MS4 |
Nah. I was going to write in seamless for MS4, but this works a ton better since you don't have to make excess maps for filling in the black spots. |
|
| Author: | Matt [ Tue Aug 18, 2009 2:48 pm ] |
| Post subject: | Re: MS4 |
Kousaten wrote: Nah. I was going to write in seamless for MS4, but this works a ton better since you don't have to make excess maps for filling in the black spots. Yupp. |
|
| Author: | Jacob [ Tue Aug 18, 2009 2:51 pm ] |
| Post subject: | Re: MS4 |
You will need to think about dynamically changing NPC and Item limits for larger maps. |
|
| Author: | Kousaten [ Tue Aug 18, 2009 2:53 pm ] |
| Post subject: | Re: MS4 |
Otherwise you're going to end up with a few very sparse maps. :3 I hear ya~ |
|
| Author: | Matt [ Tue Aug 18, 2009 2:56 pm ] |
| Post subject: | Re: MS4 |
In my game source, I have it to where you can set 1 to 50 npcs per map and you choose how many go on each map. |
|
| Author: | Jacob [ Tue Aug 18, 2009 3:00 pm ] |
| Post subject: | Re: MS4 |
I got all crazy with my setup: viewtopic.php?f=8&t=5147&start=0&hilit=npc+spawn |
|
| Author: | Kousaten [ Tue Aug 18, 2009 6:01 pm ] |
| Post subject: | Re: MS4 |
One problem I did notice was that the map name doesn't draw properly--this causes it to just stay where it was on the original sized map. I fixed it by changing: Code: ' Draw map name Call DrawText(TexthDC, DrawMapNameX, DrawMapNameY, Map.Name, DrawMapNameColor) To: Code: ' Draw map name Call DrawText(TexthDC, Camera.Right - ((Len(Map.Name) \ 2) * 28), Camera.Top + 1, Map.Name, DrawMapNameColor) Unfortunately I am horrid at properly centering things. This draws the name starting at the left, as opposed to actually centering said text. |
|
| Author: | Ellesar [ Tue Aug 18, 2009 6:45 pm ] |
| Post subject: | Re: MS4 |
Quote: One problem I did notice was that the map name doesn't draw properly--this causes it to just stay where it was on the original sized map. I fixed it by changing: Code: Select all ' Draw map name Call DrawText(TexthDC, DrawMapNameX, DrawMapNameY, Map.Name, DrawMapNameColor) To: Code: Select all ' Draw map name Call DrawText(TexthDC, Camera.Right - ((Len(Map.Name) \ 2) * 28), Camera.Top + 1, Map.Name, DrawMapNameColor) Unfortunately I am horrid at properly centering things. This draws the name starting at the left, as opposed to actually centering said text. Anyways it's no a byg deal. In Rpg Maker program happens the same thing, at least those who i tried. But i'm going to ask one thing. I Just generated the .exe server and client, enter in the game and changed te map size from propietes of map editor, but the max tile that i could re-size the map was 30x30, it's that correct? or i'm forggoting something? |
|
| Author: | Matt [ Tue Aug 18, 2009 6:54 pm ] |
| Post subject: | Re: MS4 |
Max is 255x255. I know it works, as I have checked it. Jacob sent me the fix for the map name a long time ago, I'll look in my email and see if I still have it. |
|
| Author: | Kousaten [ Tue Aug 18, 2009 7:03 pm ] |
| Post subject: | Re: MS4 |
Thanks again. |
|
| Author: | Matt [ Tue Aug 18, 2009 7:08 pm ] |
| Post subject: | Re: MS4 |
I don't have it, but I'm sure Jacob wouldn't mind posting a fix for it. |
|
| Author: | Matt [ Wed Aug 19, 2009 12:19 am ] |
| Post subject: | Re: MS4 |
Server side find: Code: Sub HandleSaveNPC Replace the whole sub with: Code: Private Sub HandleSaveNpc(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim NpcNum As Long Dim Buffer As clsBuffer Dim NpcSize As Long Dim NpcData() As Byte ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If Set Buffer = New clsBuffer Buffer.WriteBytes Data() NpcNum = Buffer.ReadLong ' Prevent hacking If NpcNum < 0 Or NpcNum > MAX_NpcS Then Call HackingAttempt(Index, "Invalid Npc Index") Exit Sub End If NpcSize = LenB(Npc(NpcNum)) ReDim NpcData(NpcSize - 1) NpcData = Buffer.ReadBytes(NpcSize) CopyMemory ByVal VarPtr(Npc(NpcNum)), ByVal VarPtr(NpcData(0)), NpcSize ' Save it Call SendUpdateNpcToAll(NpcNum) Call SaveNpc(NpcNum) Call AddLog(GetPlayerName(Index) & " saved Npc #" & NpcNum & ".", ADMIN_LOG) End Sub I have also already updated the source download. |
|
| Author: | Matt [ Wed Aug 19, 2009 1:18 am ] |
| Post subject: | Re: MS4 |
Found a bug and can't seem to pinpoint it so if anyone wants to help figure it out, please do. When you put an npc on the map, it will spawn at first, but if you close the client and login again, it won't be there. However, if you edit the map properties, you will see that the npc is in fact saved and if you save the map again, it will spawn. I just don't understand it. >.< |
|
| Author: | Matt [ Wed Aug 19, 2009 2:35 am ] |
| Post subject: | Re: MS4 |
Fixed a lot of errors. I suggest you just redownload the source and go from there. |
|
| Author: | Xlithan [ Thu Sep 03, 2009 3:56 pm ] |
| Post subject: | Re: MS4 |
Well, I couldn't decide whether to use MS4 or Elysium 3.30. This is some good source. Basic MS4 with scrolling maps and HUGE map sizes is definately a winner for me. Thanks a hell of a lot Matt (And Jacob, you never fail to impress me) |
|
| Author: | Xlithan [ Mon Sep 07, 2009 12:03 pm ] |
| Post subject: | Re: MS4 |
Question: What other features have been added to the source, just the byte arrays and larger maps? I've also noticed a bug. Not sure if it's because of the larger maps in this source code or if the bug comes from the original MS4. But when you go to place down tiles, it places the tile on the tile to the left of the tile that you click on. Is there a way to adjust the target tile according to the coordinates of the cursor on the picScreen? |
|
| Author: | Matt [ Mon Sep 07, 2009 1:48 pm ] |
| Post subject: | Re: MS4 |
Xlithan wrote: Question: What other features have been added to the source, just the byte arrays and larger maps? I've also noticed a bug. Not sure if it's because of the larger maps in this source code or if the bug comes from the original MS4. But when you go to place down tiles, it places the tile on the tile to the left of the tile that you click on. Is there a way to adjust the target tile according to the coordinates of the cursor on the picScreen? I have been busy with the birth of my son but I should have some time today to open up the source and check. I think I know the problem, but I can't remember off hand what it was. Is this only when you resize the map or is it even on a base size? |
|
| Author: | Xlithan [ Mon Sep 07, 2009 2:01 pm ] |
| Post subject: | Re: MS4 |
I will double check that for you Matt Edit: It may well have been caused by increasing the width/height of picScreen |
|
| Author: | Matt [ Mon Sep 07, 2009 2:39 pm ] |
| Post subject: | Re: MS4 |
Xlithan wrote: I will double check that for you Matt Edit: It may well have been caused by increasing the width/height of picScreen Okay. I'll play with that when I get the chance. I'm sure it's a simple as a variable needing to be changed. Hopefully. Lol. |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|