Thread: Saving Settings

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Saving Settings 
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    How do I make settings such as run save on logout and load on login?

    For example, if you toggle run and sign out then back in, you're still running.
    Same for if you toggle run off and sign out then back in, you're not running.

    I've attempted adding it to the character file and it writes true/false but it's not working in-game.

    Rep to those who help, may also receive a :cookie:...
    Reply With Quote  
     

  2. #2  
    Registered Member minimike150's Avatar
    Join Date
    Aug 2009
    Age
    30
    Posts
    56
    Thanks given
    0
    Thanks received
    1
    Rep Power
    13
    Forgetting server-side for a minute; You can make the client not change the running boolean on login/logout, so the value will only be changed by the player in-game.

    This means if they are running and log out, logging back in again they will still be running.
    However, if the client is closed and opened again, this value is lost.

    You say you've added it to the character file, does that also include the loading of the character files?
    Reply With Quote  
     

  3. #3  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Quote Originally Posted by minimike150 View Post
    Forgetting server-side for a minute; You can make the client not change the running boolean on login/logout, so the value will only be changed by the player in-game.

    This means if they are running and log out, logging back in again they will still be running.
    However, if the client is closed and opened again, this value is lost.

    You say you've added it to the character file, does that also include the loading of the character files?
    Not sure, I've added this:

    Code:
    } else if (token.equals("character-running")) {
    						c.running = Boolean.parseBoolean(token2);
    And also this:

    Code:
    			characterfile.write("character-running = ", 0, 20);
    			characterfile.write(Boolean.toString(c.running), 0, Boolean.toString(c.running).length());
    			characterfile.newLine();
    Do I need to do something else to properly load it?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2009
    Posts
    608
    Thanks given
    1
    Thanks received
    17
    Rep Power
    6
    Yea, add it in your running method.
    Like:
    if (c.running == true) {
    c.isRunning = true;
    }
    If true doesn't work, replace with:
    c.isRunning = 1;
    Reply With Quote  
     

  5. #5  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Well I kinda just made my own little running method up.. lol

    Here it is:
    Code:
    public void running() {
    if (running = true) {
    isRunning = true;
    isRunning2 = true;
    } else {
    if (running = false) {
    isRunning = false;
    isRunning2 = false;
    		}
    	}
    }
    I've got a feeling something is wrong with it internally but I'm only worried about the saving at this point.
    Reply With Quote  
     

  6. #6  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Bump..
    Reply With Quote  
     

  7. #7  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Bump
    Reply With Quote  
     

  8. #8  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Or...

    How would I make the red highlighting on the run icon when clicked go back to non-highlighted on logout?
    Reply With Quote  
     

  9. #9  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Anyone?
    Reply With Quote  
     

  10. #10  
    Member fuglucky's Avatar
    Join Date
    Nov 2010
    Posts
    80
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    ya i remember having a problem with that as well. i could make it remember when he was running, but i couldn't set the red button to glow on or off.

    You will need to make a method to tell the client to make it on or off. (i have no idea how, I'm not familiar with streams just yet).

    but I do remember having problems with the whole boolean saving. if i were you. just make it an integer and 0 = false, 1 = true.

    thats what i did and it worked. =)

    also In your process find:

    Code:
    if(p.isRunning){
    or something pretty close and add your c.running next to it like this:

    Code:
    if(p.isRunning || p.running){
    the || is very important. if you put && you may never run ha ha.

    hope i helped =)
    Reply With Quote  
     

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. Replies: 22
    Last Post: 01-03-2014, 02:23 PM
  2. C# - Settings
    By Exploiter in forum Application Development
    Replies: 0
    Last Post: 07-03-2010, 01:31 AM
  3. Option Tab, Graphic Settings, Audio Settings
    By Infexis in forum Show-off
    Replies: 29
    Last Post: 06-14-2010, 05:47 PM
  4. MY gta Enb settings
    By Bobster in forum PC
    Replies: 11
    Last Post: 03-14-2009, 03:20 PM
  5. Saving / Loading different settings
    By Mike in forum Tutorials
    Replies: 3
    Last Post: 06-18-2008, 10:45 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
  •