Error 9 when warping :s

Hi everybody,

Well i have a bug since yesterday. When i warp on other map i have Error 9 and the client shut down. It’s pretty ennoying for my players :s

Can someone help me to fix this please?

Thanks!


Sub ProcessNpcMovement(ByVal MapNpcNum As Long)

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

' Check if NPC is walking, and if so process moving them over

If TempMapNpc(MapNpcNum).Moving = MOVING_WALKING Then

	 Select Case MapNpc(MapNpcNum).Dir

		 Case DIR_UP

[color]			 TempMapNpc(MapNpcNum).yOffset = TempMapNpc(MapNpcNum).yOffset - ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))[/color]

			 If TempMapNpc(MapNpcNum).yOffset < 0 Then TempMapNpc(MapNpcNum).yOffset = 0

		 Case DIR_DOWN

			 TempMapNpc(MapNpcNum).yOffset = TempMapNpc(MapNpcNum).yOffset + ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))

			 If TempMapNpc(MapNpcNum).yOffset > 0 Then TempMapNpc(MapNpcNum).yOffset = 0

		 Case DIR_LEFT

			 TempMapNpc(MapNpcNum).xOffset = TempMapNpc(MapNpcNum).xOffset - ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))

			 If TempMapNpc(MapNpcNum).xOffset < 0 Then TempMapNpc(MapNpcNum).xOffset = 0

		 Case DIR_RIGHT

			 TempMapNpc(MapNpcNum).xOffset = TempMapNpc(MapNpcNum).xOffset + ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))

			 If TempMapNpc(MapNpcNum).xOffset > 0 Then TempMapNpc(MapNpcNum).xOffset = 0

	 End Select

	 ' Check if completed walking over to the next tile

	 If TempMapNpc(MapNpcNum).Moving > 0 Then

		 If MapNpc(MapNpcNum).Dir = DIR_RIGHT Or MapNpc(MapNpcNum).Dir = DIR_DOWN Then

			 If (TempMapNpc(MapNpcNum).xOffset >= 0) And (TempMapNpc(MapNpcNum).yOffset >= 0) Then

				 TempMapNpc(MapNpcNum).Moving = 0

				 If VXFRAME = False Then

					 If TempMapNpc(MapNpcNum).Step = 1 Then

						 TempMapNpc(MapNpcNum).Step = 3

					 Else

						 TempMapNpc(MapNpcNum).Step = 1

					 End If

				 Else

					 If TempMapNpc(MapNpcNum).Step = 0 Then

						 TempMapNpc(MapNpcNum).Step = 1

					 Else

						 TempMapNpc(MapNpcNum).Step = 0

					 End If

				 End If

			 End If

		 Else

			 If (TempMapNpc(MapNpcNum).xOffset <= 0) And (TempMapNpc(MapNpcNum).yOffset <= 0) Then

				 TempMapNpc(MapNpcNum).Moving = 0

				 If VXFRAME = False Then

					 If TempMapNpc(MapNpcNum).Step = 1 Then

						 TempMapNpc(MapNpcNum).Step = 3

					 Else

						 TempMapNpc(MapNpcNum).Step = 1

					 End If

				 Else

					 If TempMapNpc(MapNpcNum).Step = 0 Then

						 TempMapNpc(MapNpcNum).Step = 1

					 Else

						 TempMapNpc(MapNpcNum).Step = 0

					 End If

				 End If

			 End If

		 End If

	 End If

End If

' Error handler

Exit Sub

errorhandler:

HandleError "ProcessNpcMovement", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

[co[size=4]ae][background=rgb(248, 248, 248)]TempMapNpc(MapNpcNum).yOffset = TempMapNpc(MapNpcNum).yOffset - ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))[/background]

This is the line of code that errored right? Hover over each variable and it will show which variable is out of range.


Case DIR_LEFT

[color]			    TempMapNpc(MapNpcNum).xOffset = TempMapNpc(MapNpcNum).xOffset - ((ElapsedTime / 1000) * (Npc(MapNpc(MapNpcNum).num).speed * SIZE_X))[/color]

			    If TempMapNpc(MapNpcNum).xOffset < 0 Then TempMapNpc(MapNpcNum).xOffset = 0

In this case, this line is wrong :s but it changes differents times with Up,Down,Left and Right. So i really don’t know what i have to change :s

I hope you understand me

Never told to change. When the error has occurred, hover over each variable until. It will give a tooltip and where it is out of range it will show (variable) = subscript out of range. Paste the part that is out of range. And also

I’m sorry i didn’t understand what you wanna mean :s my english is poor can you try to be more spceific? Thanks!

The line that is causing the error will be hightlighted. Within the line hover over (put ur mouse over) each variable (Keyword) a tooltip(a small yellow box showing some info) will be shown. In one of the variables the tooltip will be subscript out of range. Just type/paste that variable.

Ok i get it, so i run it and that’s what it says. My mouse was over the first NPC above the out of range description. I hope i was clear and you could help me :)

Thanks!

I think the NPC is corrupted. Try deleting the NPC from the ID. (Hover over MapNpc(NpcNum).num)) After getting the ID go to sever side \data\NPc and find the npc data file adn delete it. Also keep a back up of the file incase this doesn’t work.

OR

If you know VB then u can try programming an App that opens up the NPC data file and changes the speed back to 1.

I think the NPC is corrupted. Try deleting the NPC from the ID. (Hover over MapNpc(NpcNum).num)) After getting the ID go to sever side \data\NPc and find the npc data file adn delete it. Also keep a back up of the file incase this doesn’t work.

OR

If you know VB then u can try programming an App that opens up the NPC data file and changes the speed back to 1.

Before this line of code, simply put there something like


for i = 1 to MAX_NPCS

npc(i).speed = 1

next

Then after it runs, remove that line of code.

Before this line of code, simply put there something like


for i = 1 to MAX_NPCS

npc(i).speed = 1

next

Then after it runs, remove that line of code.

It doesnt work or i do something wrong, it tells me : variable is not defined :s

I think the NPC is corrupted. Try deleting the NPC from the ID. (Hover over MapNpc(NpcNum).num)) After getting the ID go to sever side \data\NPc and find the npc data file adn delete it. Also keep a back up of the file incase this doesn’t work.

OR

If you know VB then u can try programming an App that opens up the NPC data file and changes the speed back to 1.

Well i think i found the ID,deleted it but it didn’t change the bug. And i don’t know VB to do an App for this :s

Another ideas?

Up! Well guys i just clicked on “Debug Bouton” and the bug is fixed xD Maybe i shall tell you i was using Eclipse Advanced first :)

Well i don’t know how but it works for me now!

Thanks for you help anyway!

Before this line of code, simply put there something like


for i = 1 to MAX_NPCS

npc(i).speed = 1

next

Then after it runs, remove that line of code.

Or u can do something like that. Never thought of that.

Also EA is shitty engine. (Or thats what I heard)

It doesnt work or i do something wrong, it tells me : variable is not defined :s

I assumed you knew basic VB6. Its resolved now, so no matter.

Log in to reply