So in my preferences screen I added the option with the following code:
Code: Select all
vbox:
style_prefix "radio"
label _("Profanity")
textbutton _("Block") action SetVariable ("profanity", 0)
textbutton _("Allow") action SetVariable ("profanity", 1)
Code: Select all
init -2:
if profanity == 0:
$ shit = _("Crap")
elif profanity == 1:
$ shit = _("Shit")
label start:
Code: Select all
mcs "[shit!t], already?"
I modified my code to the following:
Code: Select all
init -2:
default profanity = 0
label start:
Code: Select all
if profanity == 0:
mcs "Crap, already?"
elif profanity == 1:
mcs "Shit, already?"
My problem is, that whenever I click "allow" in the preferences menu, it only stays "allowed", whilst browsing the menu's and playing the game. If a user returns to the main menu, or reaches the end of the script, thus also returning to the main menu, profanity = 1 reverts to profanity = 0 every time.
Am I doing it wrong, because I feel the option should stay the same, like the other options in preferences menu do.
Preferences when the game first starts (and every time you load it again) Preferences whilst in-game, having selected to allow profanity But as soon as you reach the end of the script or return to the main menu, it returns to it's default state.
Loading a game, previously saved with profanity allowed, stays allowed.
Edit: Game code removed as it was a massive WOT (Wall Of Text) and the issue has been resolved, so it is now unnecessary.
