Subscript out of range error

Just recently started to get into eclipse again.
Im using the Seb engine (EBO)
Map Size is 100x 100
I have 30 npcs on the map
Everything was running fine, all npcs are there spawned on the map running about everywhere.
I tried adding a quest npc to test out the quest system as my 30th npc.
After I hit send on the mapeditor to complete my changes I get Runtime error 9 subscript out of range.
It kicks me off game of course but Im able to login fine and the quest npc is working no more errors.
But if i go to mapeditor and try to save new changes it throws the same error everytime.

In debug it points to this

Select Case NPC(MapNpc(MapNpcNum).Num).NPCSpeed = <Subscript out of range>

So this is where I am stuck, if anyone doesnt mind lending a hand I could sure use it 🙂

Hover over MapNpcNum, Num, and NPCSpeed

What are the values of those?

MapNpcNum = 8
Num = 0
NPCSpeed = <Subscript out of range>

NpcSpeed is the trouble maker then? hmm
Npcs 1-29 are all the same npc “Hen”
In the npc editor their NpcSpeed is set to 4.

https://imgur.com/a/ld9yfIV

The issue is that .Num = 0 . 0 isn’t a valid NPC number, so something went awry with the 8th NPC

Try changing it to a different NPC, saving, then changing it back to see if that fixes the problem

It just keeps giving me the same error them until I remove all npcs 1 by 1 hmm. Same run time error 9. Each npc I remove it points to the next one (9,4,14,15,26,17,18) Ive deleted the maps both server/client and tried again am having the same problem even when making a new npc to replace the old Hen. Im going to try deleting all the npcs server side and try again.

Edit*

Deleted all npc files and maps and remade new npcs and it still giving me the same error

Select Case NPC(MapNpc(MapNpcNum).Num).NPCSpeed = <Subscript out of range>
Just points to a random MapNpcNum

Figured it out, Ive been running the game through visual basic and getting that error. I compiled the .exe and it runs fine without any errors, very weird. Guess no more trying to map via visual basic haha.

Thanks Mahenjo for the support

Log in to reply