Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[FIXED] Big bug MS3.0.3
#1
When I change : (client and server)
Code:
Public Const MAX_NPCS = 255
to
Code:
Public Const MAX_NPCS = 500

It's work, but in the client, when I add a npc in the map properties (after 255), I have a runtime error 6 out of memory.
Quote:For I = 1 To MAX_MAP_NPCS
Map.Npc(I) = cmbNpc(I - 1).ListIndex
Next I

I use a MS3.0.3 very modified, but i have the bug on a clean mirage source.

Can I help me please ?

Thanks you in advance. (sorry for my bad english)
Reply
#2
Just wanted to put this out there, I just tried this with MS4 also (just messing around) and I changed max NPCS to 500 also, changed it so its dimmed as byte, and it popped up with RTE 6 on this line

Code:
.Npc(i) = cmbNpc(i).ListIndex
Reply
#3
is npcs a byte
cause like doesnt that mean 256 is highest number
also i may not know what im talking about
Reply
#4
I looked at the topic starter's user name and saw "El_Dinosaur".. XD
Reply
#5
MAX_NPCS needs to be stored as an integer if you want the value to be more than 255.
Reply
#6
Sorry, thats what I meant. I changed it so it ISN'T dimmed as a byte. I did change it to integer when I tested it. I think something else in the statement is being dimmed as a byte, I just can't tell where.
Reply
#7
Rian Wrote:MAX_NPCS needs to be stored as an integer if you want the value to be more than 255.
woot that means i was right
and just
search
NPCS
and see if you see anything you missed
Reply
#8
How to fix this bug please ? Sad

(thanks you for your help)
Reply
#9
You have to define npcs as an integer instead of a byte..

Pay attention, that was already stated. -_-
Reply
#10
In a blank mirage source MS3.0.3.

SERVER
I change :
Code:
Public Const MAX_NPCS = 255
to
Code:
Public Const MAX_NPCS = 500

I change :
Code:
Type MapRec
    Name As String * NAME_LENGTH
    Revision As Long
    Moral As Byte
    Up As Integer
    Down As Integer
    Left As Integer
    Right As Integer
    Music As Byte
    BootMap As Integer
    BootX As Byte
    BootY As Byte
    Shop As Byte
    Indoors As Byte
    Tile(0 To MAX_MAPX, 0 To MAX_MAPY) As TileRec
    Npc(1 To MAX_MAP_NPCS) As Byte
End Type
to
Code:
Type MapRec
    Name As String * NAME_LENGTH
    Revision As Long
    Moral As Byte
    Up As Integer
    Down As Integer
    Left As Integer
    Right As Integer
    Music As Byte
    BootMap As Integer
    BootX As Byte
    BootY As Byte
    Shop As Byte
    Indoors As Byte
    Tile(0 To MAX_MAPX, 0 To MAX_MAPY) As TileRec
    Npc(1 To MAX_MAP_NPCS) As Integer
End Type


CLIENT
I change :
Code:
Public Const MAX_NPCS = 255
to
Code:
Public Const MAX_NPCS = 500

I change :
Code:
Type MapRec
    Name As String * NAME_LENGTH
    Revision As Long
    Moral As Byte
    Up As Integer
    Down As Integer
    Left As Integer
    Right As Integer
    Music As Byte
    BootMap As Integer
    BootX As Byte
    BootY As Byte
    Shop As Byte
    Indoors As Byte
    Tile(0 To MAX_MAPX, 0 To MAX_MAPY) As TileRec
    Npc(1 To MAX_MAP_NPCS) As Byte
End Type
to
Code:
Type MapRec
    Name As String * NAME_LENGTH
    Revision As Long
    Moral As Byte
    Up As Integer
    Down As Integer
    Left As Integer
    Right As Integer
    Music As Byte
    BootMap As Integer
    BootX As Byte
    BootY As Byte
    Shop As Byte
    Indoors As Byte
    Tile(0 To MAX_MAPX, 0 To MAX_MAPY) As TileRec
    Npc(1 To MAX_MAP_NPCS) As Integer
End Type

I launch the server. (it's OK)
I create a account and a character. (acces 5)
I login, I am in the game.
/mapeditor and I clic property.
I choice the 256 NPC, I clic OK.
I save the map and :

Runtime error 6 overflow :
Quote: ' ::::::::::::::::::::::
' :: Npc spawn packet ::
' ::::::::::::::::::::::
If LCase(Parse(0)) = "spawnnpc" Then
n = Val(Parse(1))

MapNpc(n).Num = Val(Parse(2)) 'runtime error 6 : overflow
MapNpc(n).x = Val(Parse(3))
MapNpc(n).y = Val(Parse(4))
MapNpc(n).Dir = Val(Parse(5))

' Client use only
MapNpc(n).XOffset = 0
MapNpc(n).YOffset = 0
MapNpc(n).Moving = 0
Exit Sub
End If

Why ?

help me please.
(sorry for my bad english)
Reply
#11
It would appear that you need to change the num variable to an integer in the mapnpc rec.
Reply
#12
Matt Wrote:It would appear that you need to change the num variable to an integer in the mapnpc rec.
It's work ! :mrgreen:

Thanks you for your help :wink:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)