Issues setting Preference Settings

Alright, this is going to take a second to explain but I’m overhauling my stat screen and having an issue where preferences set there do not save. Is this just a quirk of choice script, or an issue with my code?

For example: If you turn on percentage stats, then close the stats screen and open it again, then it resets the detailedstats to be off.

This is exceptionally frustrating, because I can’t even see any issues with the code itself, can I get advice on what the heck I did wrong?

Edit: SHIT-- Don’t tell me its because I used a fake_choice? Do you need a normal *choice to get this to set properly? Nope, tried, that was not the issue.

I am not getting any traditional ‘error codes,’ it just resets the preferences when the reader closes and reopens the stats screen. I don’t really think giving the code directly would help here but here is the relevant snippet:

*fake_choice

#Stats Settings...

  *label stats_settings

  [i]Note: Playing however fits [b]you best[/b] is most important, these settings are meant to help with that![/i]

  Percentage stats: @{detailedstats On|Off}

  Relationship Counters: @{detailedrel On|Off}

  Portraits: @{detailedport On|Off}

  Visual Indicators: @{visualind On|Off}

  *fake_choice
    #Detailed Stats [Show Percentages]
      [i]While the story might feel more organic without directly seeing them, this is present so those who wish can visualize more directly what their stats are. Enable visible percentage stats.[/i]

      *choice
        #On
          *set detailedstats 1
          *goto stats_settings
        #Off
          *set detailedstats 2
          *goto stats_settings
        #Back to the Stat Screen...
          *goto statscreenstart
      *finish   

    #Relationship Counters [Show Detailed Relationship Stats]
      [i]Allow direct visuals of the relationships between the Immortal and those around them.[/i]



      *choice
        #On
          *set detailedrel 1
          *goto stats_settings
        #Off
          *set detailedrel 2
          *goto stats_settings
        #Back to the Stat Screen...
          *goto statscreenstart
      *finish
    
    #Portraits [Visibility in Stats]
      [i]Portraits will never be enforced upon the Immortal, ${mcthey} may forget the appearance of those around ${mcthem} the moment they leave ${mctheir} direct sights.[/i]

      *choice
        #On
          *set detailedport 1
          *goto stats_settings
        #Off
          *set detailedport 2
          *goto stats_settings
        #Back to the Stat Screen...
          *goto statscreenstart
      *finish

Hmm, try setting detailedstats to true and detailedstats to false instead of to 1/2? (and using the same for detailedrel and the other on/off vars)

Like this:

  *choice
    #On
      *set detailedstats true
      *goto stats_settings
    #Off
      *set detailedstats false
      *goto stats_settings

Correct me if I’m wrong, but if you only have two variants in your multireplace, the syntax will treat the variable as a boolean (true/false) rather than a numbered one (more than two possible variants).

I didn’t know multireplace could work with true and false-- that is a little embarrassing (it’s why I was insistent on using 1 & 2 lol). I don’t think that is the issue though because for the visual indicator setting I used 1 & 2 for the entire demo and had no issues of people not being able to see them or seeing them when they didn’t want to.

This is a stats menu specific issue, whatever it is.

The issue isn’t setting the variables, it’s that they revert back after the reader returns to game and opens the menu again.

Does the game go through the entire startup again and reset the variables after the player closes the stat screen? Shit I’m tired–

Edit: Made the changes, did not fix the issue, I am thoroughly stumped. Is the problem that the variables are created in the startup file? But that can’t be the issue the startup folder is the only folder you can use *create –

This is so annoying oh my gods.

Complicating things further is that the Visual Indicator setting works as intended, it’s just the rest of the damned things. I am going to try adding a *set # at the beginning of the prologue and see if that fixes it. That doesn’t fix it either, what the ever lovin–

ADD: I have found the specific issue, it’s strange. I think this is just a quirk of choice script, but if you set the variable in the menu then return to the game and back to the stat screen it doesn’t update until you move forward in the story. I am going to try adding a page_break at the end of the settings to ‘refresh’ them.

Yes, variables are sometimes wonky in choicescript_stats. You can read more about it here on *redirect_scene.

2 Likes

I don’t know why they have to make this so much more complicated than necessary. I’m going to need to make a second document and a series of variables just to allow for this to work properly. However, at least I now know the process by which I can do that. Thank you.

2 Likes

Wait, can you not use if statements? It’s telling me you can only use it in the stats screen but it is in the stats screen–

Bug:
choicescript_stats line 4: The *redirect_scene command can only be used from the stats screen.

Code:
*label statscreenstart

*if (detailedsettingsmenu = 1)
*redirect_scene stats_setting

*temp major_character 0

This whole thing is so annoying, just so it can auto update- grr

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.