Thread: [PI] Character Saving Question

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [PI] Character Saving Question 
    Exiles Developer


    Join Date
    May 2009
    Age
    28
    Posts
    316
    Thanks given
    55
    Thanks received
    25
    Rep Power
    86
    Error:
    loadGame:


    WriteData:


    player.java




    A different boolean type from loadGame:


    Any help would be great. Will thank and rep.. Thanks
    Quote Originally Posted by Eazy View Post
    Quote Originally Posted by lostlegend View Post
    its not os-legacy its switched to Project-Insanity.
    And Very Much i ReCoded MEself. Check it out and u wil see ur self.
    People allways bothering with saying OS-LEGACY.. U NEVER CHECKED SERVERDONT COMPLAIN CHECK IT OUT B4 COMPLAINING
    So you switched Project-Insanity to Project-Insanity? gj
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Read the error: "Cannot convert from boolean to int", = Boolean.parseBoolean(values[3]);

    What is wrong there?
    Reply With Quote  
     

  3. #3  
    Development Services √

    Oogle's Avatar
    Join Date
    Apr 2012
    Age
    25
    Posts
    3,976
    Thanks given
    650
    Thanks received
    516
    Rep Power
    483
    Quote Originally Posted by _Patrick_ View Post
    Read the error: "Cannot convert from boolean to int", = Boolean.parseBoolean(values[3]);

    What is wrong there?
    casting - Convert boolean to int in Java - Stack Overflow

    He wont understand it, just let him read and learn to google up on java.


    Attached image

    Attached image
    Reply With Quote  
     

  4. #4  
    Busy or something
    Genuinely's Avatar
    Join Date
    Feb 2016
    Posts
    78
    Thanks given
    2
    Thanks received
    13
    Rep Power
    11
    Quote Originally Posted by Stoked View Post
    casting - Convert boolean to int in Java - Stack Overflow

    He wont understand it, just let him read and learn to google up on java.
    The purpose of the help section is to get help, not telling them they need to google it.
    Reply With Quote  
     

  5. Thankful users:


  6. #5  
    Development Services √

    Oogle's Avatar
    Join Date
    Apr 2012
    Age
    25
    Posts
    3,976
    Thanks given
    650
    Thanks received
    516
    Rep Power
    483
    Quote Originally Posted by StraightKillin View Post
    The purpose of the help section is to get help, not telling them they need to google it.
    They need to learn, you can't exactly spoonfeed everyone, this is why the community is wrecked. No one wants to learn, they want it all been given to them.

    There are many resources out there for people to learn, thats why they are there...

    I may not be the best programmer but atleast i try..


    Attached image

    Attached image
    Reply With Quote  
     

  7. Thankful users:


  8. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    You are trying to write a boolean where a int is required.
    Change
    Code:
    p.skillLock[Boolean.parseBoolean(values[0])]
    into
    Code:
    p.skillLock[Integer.parseInt(values[0])]


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  9. Thankful user:


  10. #7  
    Busy or something
    Genuinely's Avatar
    Join Date
    Feb 2016
    Posts
    78
    Thanks given
    2
    Thanks received
    13
    Rep Power
    11
    Quote Originally Posted by Stoked View Post
    They need to learn, you can't exactly spoonfeed everyone, this is why the community is wrecked. No one wants to learn, they want it all been given to them.

    There are many resources out there for people to learn, thats why they are there...

    I may not be the best programmer but atleast i try..
    For me at least, I would love to learn but everyone charges 30$ to change your server name, like everyone is money hungry. If I need help I come to the help section but I at least give it some effort before I post here.
    Reply With Quote  
     

  11. #8  
    Exiles Developer


    Join Date
    May 2009
    Age
    28
    Posts
    316
    Thanks given
    55
    Thanks received
    25
    Rep Power
    86
    Quote Originally Posted by Stoked View Post
    They need to learn, you can't exactly spoonfeed everyone, this is why the community is wrecked. No one wants to learn, they want it all been given to them.

    There are many resources out there for people to learn, thats why they are there...

    I may not be the best programmer but atleast i try..
    I don't expect a spoonfeed, I expect an explanation that will actually help me understand the concept. I didn't know I was suppose to be converting a boolean to an int, I thought it was suppose to be just a boolean throughout the whole loading process. I tried googling it and didn't come up with much that applied to my scenario. Especially because I don't understand what parseint or parseboolean is and why I am setting one equal to the other. The language I am actually learning in college is C++, and I am only in my second class for it. So most of the things I run into in rsps (java) I have never even seen before.

    Quote Originally Posted by arch337 View Post
    You are trying to write a boolean where a int is required.
    Change
    Code:
    p.skillLock[Boolean.parseBoolean(values[0])]
    into
    Code:
    p.skillLock[Integer.parseInt(values[0])]
    Thanks it worked, but does that make it so the code sets the true or false boolean into an integer for the server to be able to read when loading the game?

    Quote Originally Posted by _Patrick_ View Post
    Read the error: "Cannot convert from boolean to int", = Boolean.parseBoolean(values[3]);

    What is wrong there?
    It didn't seem like anything was wrong with the second part. Am I doing it wrong?
    Quote Originally Posted by Eazy View Post
    Quote Originally Posted by lostlegend View Post
    its not os-legacy its switched to Project-Insanity.
    And Very Much i ReCoded MEself. Check it out and u wil see ur self.
    People allways bothering with saying OS-LEGACY.. U NEVER CHECKED SERVERDONT COMPLAIN CHECK IT OUT B4 COMPLAINING
    So you switched Project-Insanity to Project-Insanity? gj
    Reply With Quote  
     

  12. #9  
    Registered Member
    Join Date
    Jan 2011
    Posts
    189
    Thanks given
    6
    Thanks received
    29
    Rep Power
    52
    Quote Originally Posted by imTyler7 View Post
    I don't expect a spoonfeed, I expect an explanation that will actually help me understand the concept. I tried googling it and didn't come up with much that applied to my scenario. Especially because I don't understand what parseint or parseboolean is and why I am setting one equal to the other. The language I am actually learning in college is C++, and I am only in my second class for it. So most of the things I run into in rsps (java) I have never even seen before.


    So does that make it so the code sets the true or false boolean into an integer for the computer to be able to read?
    What you're getting is a String value (value[0]). Parsing in this case is turning a String object into a primitive type (int, long, boolean, ect). So you're reading in the array index which should be an int and using that to assign the correct boolean value to that index in the array.

    Code:
    p.skillLock[Integer.parseInt(values[0])] = Boolean.parseBoolean(values[3])
    In this case the array index is the skill's ID and the boolean assigned to that index tells the server whether the skill is locked or not.
    Reply With Quote  
     

  13. Thankful user:


  14. #10  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by imTyler7 View Post
    Thanks it worked, but does that make it so the code sets the true or false boolean into an integer for the server to be able to read when loading the game?
    Well this one were when you load the game. The other one (which already works) was for saving the game. If done correctly should work but! You will have to set each value for blocking individual skill from a source. So right now all is default false.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  15. Thankful user:


Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [pi] character files dont save properly
    By IcEbLiTzMeHh in forum Help
    Replies: 7
    Last Post: 11-18-2012, 10:32 PM
  2. [pi] RuneLimited Character Saving Problem
    By IcEbLiTzMeHh in forum Help
    Replies: 5
    Last Post: 02-20-2012, 07:10 PM
  3. [pi] RuneLimited Character Saving Problem
    By IcEbLiTzMeHh in forum Help
    Replies: 0
    Last Post: 02-20-2012, 06:12 PM
  4. [PI] character right not saving
    By Syndicate in forum Help
    Replies: 2
    Last Post: 07-02-2011, 07:34 PM
  5. [PI] IP saving in character files
    By Harambe_ in forum Snippets
    Replies: 4
    Last Post: 12-24-2010, 12:23 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •