Thread: [Help] String index out of range: 16.

Results 1 to 10 of 10
  1. #1 [Help] String index out of range: 16. 
    Uhm Kyle
    Guest


    Ok, it's Delta base.
    What i've done, i recently took out all the quests from the Delta base, and renamed some that i kept.
    I used the CTRL+H method to rename some "Q1", "Q2" etc..

    Could i have changed something important? i done this in Client class, Player class, NpcHandler class & Potions class.

    I get the error when my character files try to save, i can't see anything wrong with my case 2.

    Example:

    Code:
    if (token.equals("character-height")) {
    heightLevel = Integer.parseInt(token2);
    Nor can i see anything wrong with my public void savegame(boolean logout){

    Anyway, thanks for reading.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Hunter's Avatar
    Join Date
    Jun 2009
    Age
    28
    Posts
    857
    Thanks given
    3
    Thanks received
    21
    Rep Power
    216
    What's line 21224 in client.java
    Reply With Quote  
     

  3. #3  
    Uhm Kyle
    Guest
    I've looked but couldn't find anything, you take a look.

    And line 21224 is

    Code:
    			characterfile.newLine();
    Reply With Quote  
     

  4. #4  
    Registered Member
    Sanity's Avatar
    Join Date
    Dec 2008
    Posts
    2,063
    Thanks given
    22
    Thanks received
    362
    Rep Power
    762
    Post line 21224 of client.java

    Edit: late reply lol
    Reply With Quote  
     

  5. #5  
    Uhm Kyle
    Guest
    Any ideas?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Hunter's Avatar
    Join Date
    Jun 2009
    Age
    28
    Posts
    857
    Thanks given
    3
    Thanks received
    21
    Rep Power
    216
    It's probably the line above that one when that line is being generated for saving..take a look at it.
    Reply With Quote  
     

  7. #7  
    Uhm Kyle
    Guest
    It's probably the line above that one when that line is being generated for saving..take a look at it.
    I've just had another look, i can't see nothing wrong with it. I haven't even changed any of that.

    Code:
    			characterfile.write("character-energy = ", 0, 19);
    			characterfile.write(Integer.toString(playerEnergy), 0, Integer.toString(playerEnergy).length());
    			characterfile.newLine(); //Line 21224
    			characterfile.write("character-taskID = ", 0, 19);
    			characterfile.write(Integer.toString(taskID), 0, Integer.toString(taskID).length());
    			characterfile.newLine();
    This is what i changed, but theres nothing wrong with that either. I'm sure its when i used CTRL&H to do some stuff.

    Code:
    			characterfile.write("character-q1 = ", 0, 15);
    			characterfile.write(Integer.toString(q1), 0, Integer.toString(q1).length());
    			characterfile.newLine();
    			characterfile.write("character-q2 = ", 0, 15);
    			characterfile.write(Integer.toString(q2), 0, Integer.toString(q2).length());
    			characterfile.newLine();
    			characterfile.write("character-q3 = ", 0, 15);
    			characterfile.write(Integer.toString(q3), 0, Integer.toString(q3).length());
    			characterfile.newLine();
    			characterfile.write("character-q4 = ", 0, 15);
    			characterfile.write(Integer.toString(q4), 0, Integer.toString(q4).length());
    			characterfile.newLine();
    			characterfile.write("character-q5 = ", 0, 15);
    			characterfile.write(Integer.toString(q5), 0, Integer.toString(q5).length());
    			characterfile.newLine();
    			characterfile.write("character-q6 = ", 0, 16);
    			characterfile.write(Integer.toString(q6), 0, Integer.toString(q6).length());
    			characterfile.newLine();
                            characterfile.write("character-q7 = ", 0, 16);
                            characterfile.write(Integer.toString(q7), 0, Integer.toString(q7).length());
    			characterfile.newLine();
                            characterfile.write("character-q8 = ", 0, 16);
                            characterfile.write(Integer.toString(q8), 0, Integer.toString(q8).length());
    			characterfile.newLine();
    Reply With Quote  
     

  8. #8  
    Registered Member
    Hunter's Avatar
    Join Date
    Jun 2009
    Age
    28
    Posts
    857
    Thanks given
    3
    Thanks received
    21
    Rep Power
    216
    Only one other thing I can think of and it has to do with loading the character file ..search through all the saving/loading lines and find lines that use 16...for instance:

    Code:
    characterfile.write("character-q7 = ", 0, 16);
    Make sure the numbers actually match their lines.
    Reply With Quote  
     

  9. #9  
    Qaotic
    Guest
    Code:
    			characterfile.write("character-q1 = ", 0, 15);
    			characterfile.write(Integer.toString(q1), 0, Integer.toString(q1).length());
    			characterfile.newLine();
    			characterfile.write("character-q2 = ", 0, 15);
    			characterfile.write(Integer.toString(q2), 0, Integer.toString(q2).length());
    			characterfile.newLine();
    			characterfile.write("character-q3 = ", 0, 15);
    			characterfile.write(Integer.toString(q3), 0, Integer.toString(q3).length());
    			characterfile.newLine();
    			characterfile.write("character-q4 = ", 0, 15);
    			characterfile.write(Integer.toString(q4), 0, Integer.toString(q4).length());
    			characterfile.newLine();
    			characterfile.write("character-q5 = ", 0, 15);
    			characterfile.write(Integer.toString(q5), 0, Integer.toString(q5).length());
    			characterfile.newLine();
    			characterfile.write("character-q6 = ", 0, 15);
    			characterfile.write(Integer.toString(q6), 0, Integer.toString(q6).length());
    			characterfile.newLine();
                            		characterfile.write("character-q7 = ", 0, 15);
                            		characterfile.write(Integer.toString(q7), 0, Integer.toString(q7).length());
    			characterfile.newLine();
                            		characterfile.write("character-q8 = ", 0, 15);
                            		characterfile.write(Integer.toString(q8), 0, Integer.toString(q8).length());
    			characterfile.newLine();
    Reply With Quote  
     

  10. #10  
    Uhm Kyle
    Guest
    Oh, i see.
    How silly of me.

    Thanks for all the help.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •