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

Multiple Characters Bug


DarkDino
 Share

Recommended Posts

Hello. I rip the Multiple Character System from the Eclipse Dawn in my EclipseFF. Have a error "Not found the method or data member" in .Skills.

When i declare this .Char(TempPlayer(index).CurChar)
in Player(index). <-, have a error "The subscript is out of range".

```
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''~~~~~~~~~~~~~~~~~~~~SUBS~~~~~~~~~~~~~~~~~~~~~~''~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'Sub CheckSkills(ByVal index As Long, Optional ByVal SaveIfNeeded As Boolean = True) Dim i As Integer Dim Save As Boolean If index < 1 Or index > MAX_PLAYERS Then Exit Sub Save = False For i = 1 To MAX_SKILLS If Player(index).Skills(i).Level = 0 Then Player(index).Skills(i).Level = 1 Save = True End If If Player(index).Skills(i).EXP_Needed = 0 Then Player(index).Skills(i).EXP_Needed = GetPlayerNextSkillLevel(index, i) Save = True End If Next i If Save And SaveIfNeeded Then Call SavePlayer(index)End Sub
```
Waiting for anwers :3.
Link to comment
Share on other sites

Don't work D: when i add .Char(TempPlayer(Index).CurChar) have a  "**The subscript is out of range**". in this sub

Sub CheckSkills(ByVal index As Long, Optional ByVal SaveIfNeeded As Boolean = True)
    Dim i As Integer
    Dim Save As Boolean

    If index < 1 Or index > MAX_PLAYERS Then Exit Sub
    Save = False
    For i = 1 To MAX_SKILLS
        If Player(index).Char(TempPlayer(index).CurChar).Skills(i).Level = 0 Then
            Player(index).Char(TempPlayer(index).CurChar).Skills(i).Level = 1
            Save = True
        End If

        If Player(index).Char(TempPlayer(index).CurChar).Skills(i).EXP_Needed = 0 Then
            Player(index).Char(TempPlayer(index).CurChar).Skills(i).EXP_Needed = GetPlayerNextSkillLevel(index, i)
            Save = True
       End If
    Next i
    If Save And SaveIfNeeded Then Call SavePlayer(index)
End Sub
Link to comment
Share on other sites

In HandleRequestUseChar?

In PlayerData have this

```
CheckSkills index

buffer.WriteLong SPlayerData
buffer.WriteLong index
buffer.WriteString GetPlayerName(index)
buffer.WriteLong GetPlayerLevel(index)
buffer.WriteLong GetPlayerHair(index)
buffer.WriteLong GetPlayerHairTint(index)
buffer.WriteLong GetPlayerPOINTS(index)
buffer.WriteLong GetPlayerSprite(index)
buffer.WriteLong GetPlayerMap(index)
buffer.WriteLong GetPlayerX(index)
buffer.WriteLong GetPlayerY(index)
buffer.WriteLong GetPlayerDir(index)
buffer.WriteLong GetPlayerAccess(index)
buffer.WriteLong GetPlayerPK(index)
buffer.WriteLong GetPlayerClass(index)
buffer.WriteLong GetPlayerDailyValue(index)
buffer.WriteLong GetPlayerVisible(index)
buffer.WriteLong Abs(Player(index).Char(TempPlayer(index).CurChar).WalkThrough)
buffer.WriteLong Player(index).Char(TempPlayer(index).CurChar).Follower
buffer.WriteLong MAX_SKILLS

```
And this

```
For i = 1 To MAX_SKILLS
buffer.WriteString Skill(i).Name
buffer.WriteLong Skill(i).MaxLvl
buffer.WriteLong Player(index).Char(TempPlayer(index).CurChar).Skills(i).Level
buffer.WriteLong Player(index).Char(TempPlayer(index).CurChar).Skills(i).EXP
buffer.WriteLong Player(index).Char(TempPlayer(index).CurChar).Skills(i).EXP_Needed
Next i

```
Link to comment
Share on other sites

That just copies the value of the variables into a buffer - this also needs a value to be set.

What you need is the buffer _reading_ chunk for skills when a character is loading (which was probably included in the tutorial). There should be values set for the array on character creation as well.
Link to comment
Share on other sites

PD? D? :S

Actually, having taken a closer look, I don't think that's your issue. Saving and loading in EFF copies arrays, so there shouldn't be any mistakes there. Sorry about that.

It's very hard to say with little information. This error could happen in your player(index).char was declared from 1 to 3 and tempplayer(index).curchar returns a value of 0 (or >3).

I don't see any line where you have something like this:

```
TempPlayer(index).CurChar = Buffer.ReadByte

```
Without something like that, the value would be 0, which would give you this error.
Link to comment
Share on other sites

I'm looking at your source right now. I'd say your problem is in the way you've handled logins.

modHandleData sub HandleLogin is triggered when a player first logs into their accounts. This happens before a character has been selected. Remove the banking and skills procedures. You'll also have to move your daily reward. Since no player has been chosen yet, at this point nothing can happen that involves a chosen player.

A good place to put those procedures is HandleRequestUseChar in modHandleData. The banking procedures are already there, you just have to add Call CheckSkills(index) and your daily reward system.
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...