DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 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 More sharing options...
TorenRenne Posted June 24, 2013 Share Posted June 24, 2013 Replace all:Player(index).Skills(iWith:Player(index).Char(TempPlayer(index).CurChar).Skills(i)(Although not 100% sure the Player "index" and TempPlayer "index" will always match… depends on the rest of your code. Link to comment Share on other sites More sharing options...
DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 Don't work D: when i add .Char(TempPlayer(Index).CurChar) have a "**The subscript is out of range**". in this subSub 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 More sharing options...
abhi2011 Posted June 24, 2013 Share Posted June 24, 2013 You got the brains of a potato. lolCheck whether CurChar has an actual value before using it. Link to comment Share on other sites More sharing options...
DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 Sorry, I'm a noob programmer D:. How to check whether this? I put this in TempPlayerRec:CurChar As Byte Link to comment Share on other sites More sharing options...
Stein Posted June 24, 2013 Share Posted June 24, 2013 You need to make sure that the value is set once the player picks a character. Link to comment Share on other sites More sharing options...
DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 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 More sharing options...
Zeno Posted June 24, 2013 Share Posted June 24, 2013 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 More sharing options...
DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 In what module can i see the load character? i found in all code of my source.PD: No tutorials, this system from D: escfoe2 EFF. Link to comment Share on other sites More sharing options...
Zeno Posted June 24, 2013 Share Posted June 24, 2013 PD? D? :SActually, 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 More sharing options...
DarkDino Posted June 24, 2013 Author Share Posted June 24, 2013 Sorry PS * :( Mee to i don't understand the error. I check all Use,Request,Data subs and no errors. Link to comment Share on other sites More sharing options...
Zeno Posted June 26, 2013 Share Posted June 26, 2013 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 More sharing options...
DarkDino Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks soo much Zeno :), this work!!. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now