Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

RTE 9 Crashing server


MCADAMS
 Share

Recommended Posts

Logging into the server on any account, old or fresh, yields RTE 9\. I debugged and got this line of code:
```
If MapNpc(mapnum).NPC(x).SpellTimer(i) + (Spell(NPC(npcNum).Spell(i)).CastTime * 1000) < GetTickCount Then
```
..but I'm not sure what exactly it's depicting. Could I get some help?
Link to comment
Share on other sites

When you run the server and it crashes, mouse over each individual variable in that statement. It will tell you the value. Then see which value is wrong (that is, cannot exist). Backtrack until the place where the variable is set and fix appropriately.

Hint: I guess you're using NPC Spells v.2.0.0 (since that's the only place that line appears on this forum ever and the line seems to have something to do with spells). Check that i is more than or equal to 1 and less than or equal to MAX_NPC_SPELLS. Check that npcNum and x is more than or equal to 1 and less than or equal to MAX_MAP_NPCS. Check that mapnum is more than or equal to 1 and less than or equal to MAX_MAPS. That should cover the most likely errors.
Link to comment
Share on other sites

That all seems right on my end…I could be wrong though. I probably am.
```
  For i = 1 To MAX_NPC_SPELLS
                    If NPC(npcNum).Spell(i) > 0 Then
                        If MapNpc(mapnum).NPC(x).SpellTimer(i) + (Spell(NPC(npcNum).Spell(i)).CastTime * 1000) < GetTickCount Then
                            NpcSpellPlayer x, target, i

```
Link to comment
Share on other sites

Try and get the values of every variable by using the immediate window (run it through VB6 and at the bottom of the window there's a small window [press CTRL + G if you don't have it]). Type in ?(whatever variable). So to get the value of Spell(NPC(npcNum).Spell(i)).CastTime just do:
```
?(Spell(NPC(npcNum).Spell(i)).CastTime)

```
If it brings up the error, narrow it down (like to Spell(NPC(npcNum).spell(i)) instead) until you pinpoint the error.

etc. etc.

Edit: changed Debug.Print to ?, which does the same thing.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...