[Solved] Flagged choices/variables not working as intended/properly
Posted: Thu May 09, 2019 12:15 am
I've been at it for hours trying to figure out what had to be fixed but I feel like I'm not getting anywhere... So in my game, there is a recurring menu that happens where you pick between three choices (check the news, check a computer, or continue along). Two of the three choices will have a notification pop-up (as you will have unlocked a definition in a page similar to a tips page.) What I'm trying to do is have it so if you have selected a choice and received that specific notification before you won't see it again.
Here's code for the first menu thus far (as each one is similar but different and leads to different events), eventually they'll be changed to image maps (extra notation is in the ####):
Now my issue is that when coming across the second 3 way choice, it'll either show the incorrect notification, incorrect choice dialogue, or both depending on what you picked prior to.
If you check the infobard first:
Here's the code for the second time we run across the choices (again, extra notation is in the ####):
I've defined the the flags/variables prior to my script like so:
Such a long post, apologies. Any pointers are appreciated. If you have any other questions or need more info, feel free to ask.
Here's code for the first menu thus far (as each one is similar but different and leads to different events), eventually they'll be changed to image maps (extra notation is in the ####):
Code: Select all
## This is the first threewaychoice we come across.
## In here you'll have the option of checking the 'infoboard', 'terminal', or just continuing along with the story.
## It will be represented with an imagemap.
menu:
"Check Infoboard": #### You will check the news.
$ News_Junky += 1 #### This basically counts how many time you will have selected this choice.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_info_1
"Continue along": #### You will continue with the story.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_stay_1
"Check a terminal": #### You will check a computer
$ Terminal_Check += 1 #### This basically counts how many time you will have selected this choice.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_term_1
label TWC_info_1:
$ renpy.notify('{color=#ff0000}Keypoint unlocked{/color}: Infoboard') #### This is the notification that appears on screen.
## Unlock Keypoint 3: Infoboard
$ persistent.unlock_tip_3 = True #### This is what will unlock the tip.
$ Keypoint3_unlock = "yes" #### This is the flag that should remember we saw the notification.
"Along his way home, Scott saw one of the bigger {color=#ff0000}Infoboards{/color}."
#$ renpy.notify('{color=#ff0000}Keypoint unlocked{/color}: Chem Children') #### As soon as I figure out where in the tips list this'll be placed, it'll be unhashed.
## Unlock Keypoint 25: Chem Children
#$ persistent.unlock_tip_25 = True #### As soon as I figure out where in the tips list this'll be placed, it'll be unhashed.
#$ Keypoint25_unlock = "yes" #### As soon as I figure out where in the tips list this'll be placed, it'll be unhashed.
"It flashed to an advertisement for \'{color=#ff0000}Chem Children{/color}\'"
## An image showing the Infoboard will show here.
## A caption might follow it.
jump section1_cont
label TWC_term_1:
$ renpy.notify('{color=#ff0000}Keypoint unlocked{/color}: Terminals') #### This is the notification that appears on screen.
## Unlock Keypoint 6: Terminal
$ persistent.unlock_tip_6 = True #### This is what will unlock the tip.
$ Keypoint6_unlock = "yes" #### This is the flag that should remember we saw the notification.
"Along his way home, Scott stopped to check a nearby {color=#ff0000}terminal{/color}."
"He pulled out a card from his wallet and scanned it."
"He inputted any necessary credentials it asked for."
sc "Okay... Let's see here..."
"He pressed a few things on the screen to see how much money was sitting in his account."
sc "I've gotten paid recently..."
## An image showing the terminal will show here
## It will go through Scott signing in and seeing his paycheck.
jump section1_cont
label TWC_stay_1:
"Scott decided it was best for him to go home, so that's where he went."If you check the infobard first:
- Infoboard 2nd time will be correct and follow through correctly.
- Continuing along will follow correctly.
- Checking the terminal will show the notification but will go through with the "continue along" choice.
- Choosing the infoboard will show the right notification but will go through with the "check terminal" choice.
- Continuing along will follow through properly.
- Checking the terminal a second time will be correct and follow through also.
- Choosing the infoboard next will show the notification for terminals and go through with the "continue along" choice.
- Continuing without checking anything again will be fine.
- Choosing terminal will show the proper notification but will also go through with the continue along choice.
Here's the code for the second time we run across the choices (again, extra notation is in the ####):
Code: Select all
## Here is the second threewaychoice.
## Again, represented with an imagemap.
menu:
"Check Infoboard": #### You will check the news.
$ News_Junky += 1 #### This basically counts how many time you will have selected this choice.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_info_2
"Continue along": #### You will continue with the story.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_stay_2
"Check a terminal": #### You will check a computer.
$ Terminal_Check += 1 #### This basically counts how many time you will have selected this choice.
$ ThreeWayChoice += 1 #### This counts overall how many of the 3 way choices we come across.
jump TWC_term_2
label TWC_info_2:
if Keypoint3_unlock == "no": #### If we didn't choose this option before this should play out so that we will see the notification.
$ renpy.notify('{color=#ff0000}Keypoint unlocked{/color}: Infoboard') #### This is the notification that appears on screen.
## Unlock Keypoint 3: Infoboard
$ persistent.unlock_tip_3 = True #### This is what will unlock the tip.
$ Keypoint3_unlock = "yes" #### This is the flag that should remember we saw the notification.
else: #### If we did choose this option before, it should skip showing the notification and continue with the choice made.
"Scott found a nearby {color=#ff0000}Infobaord{/color} to brief the news."
"It stated that a few terminals well be closed for maintenance."
## An image showing the Infoboard will show here.
## A caption might follow it.
jump section2_cont
label TWC_term_2:
if Keypoint6_unlock == "no": #### If we didn't choose this option before this should play out so that we will see the notification.
$ renpy.notify('{color=#ff0000}Keypoint unlocked{/color}: Terminals') #### This is the notification that appears on screen.
## Unlock Keypoint 6: Terminal
$ persistent.unlock_tip_6 = True #### This is what will unlock the tip.
$ Keypoint6_unlock = "yes" #### This is the flag that should remember we saw the notification.
else: #### If we did choose this option before, it should skip showing the notification and continue with the choice made.
"Scott found a {color=#ff0000}terminal{/color} so he could check his account."
"He pulled out a card from his wallet and scanned it."
"He inputted any necessary credentials it asked for."
sc "Okay... Let's see here..."
"He pressed a few things on the screen and transferred some of his money into another one of his accounts."
jump section2_cont
label TWC_stay_2:
"Scott contemplated on the idea of going to Erotica."Code: Select all
## Defaulted In Game Variables ##
default Scott_Moral_Negative = 0
default ThreeWayChoice = 0
default News_Junky = 0
default Terminal_Check = 0
## Defined Variables ##
define Keypoint3_unlock = "no"
define Keypoint6_unlock = "no"
define Scott_responce_1 = "calm"
###########################
## The game starts here. ##
###########################
label start: