Hmm... It totally depend on the context, and strictly speaking there isn't methods that I prefer, but more methods that aren't at all adapted to the said context.
By example, here the constraints where: Easy to reset and easy to know when all are raised.
Therefore, the "flags" needed to be grouped, in a way or another. I chose a list, but a dict would also have worked:
Python:
default freeroamingFlags = {}
screen whatever():
if "andrea" in freeroamingFlags:
[...]
if len( freeroamingFlags ) == 4:
[...]
action [ SetVariable( "freeroamingFlags", {} ), [...]
label whatever:
$ freeroamingFlags["andrea"] = True
[...]
But it's a less intuitive approach for the assignation.
If the game offer the possibility to talk more than once to the character, with the second scene being some kind of "but, we just talked together few minutes ago", a set could have been a better approach:
Python:
default freeroamingFlags = set( [] )
screen whatever():
[the hotspots]
if len( freeroamingFlags ) == 4:
[...]
action [ SetVariable( "freeroamingFlags", set( [] ) ), [...]
label whatever:
if not "andrea" in freeroamingFlags:
[the original scene]
else:
a "You again ?"
mc "Oops, sorry."
$ freeroamingFlags.add( "andrea" )
call screen whatever
[...]
A set is like a list, but entities can only be present once. So it's not a problem if you add "andrea" more than once, it will appear only one time.
Python:
label start:
$ myList = [ "abc" ]
$ mySet = set( [ "abc" ] )
$ myList.append( "abc" )
$ mySet.add( "abc" )
$ tmp = len( myList )
"Length of the list is [tmp]" # Will be 2
$ tmp = len( mySet )
"Length of the set is [tmp]" # Will be 1
But for a more global need, it's better to use directly a boolean variable:
[Don't take too much attention to the dialog, I stayed to long under the sun...]
Python:
default kiss = False
default phoneNumber = False
label whatever:
mc "Hey pretty girl, have you lost something ?"
girl "Oh yes, charming alpha male MC, it's my bag, can you help me to find it ?"
mc "Of course I can."
[...]
girl "Oh, thanks you, thanks you MC, you save my life."
mc "It's nothing beautiful girl."
menu:
"Ask for a kiss as reward":
$ kiss = True
girl "Oh MC... you're so manly, how could I resist ?"
"Be a loser":
pass
girl "I need to go now, my poor mother is ill, I can't stay absent of the house too long."
if kiss is True:
menu:
"Ask for her phone number":
$ phoneNumber = True
girl "Hihi, here it is, MC. Call me and I promise I'll loose something else."
mc "What ?"
girl "My virginity, hihi."
mc "Haha, you are not just pretty, you are also funny."
"You're more the one night kiss person":
pass
else:
mcThoughts "It's not with such player choosing for me that I'll fuck girls."
**The abuse of cheaply written stories is bad for your mental health.**
Alternatively, the dict approach also works here. Once again it's a bit more works, but everything is stored in one place:
[I'll spare you my bad dialogs]
Python:
default flags
label whatever:
[...]
menu:
"Ask for a kiss as reward":
$ flags["kiss"] = True
[...]
"Be a loser":
$ flags["kiss"] = False
[...]
if flags["kiss"] is True:
menu:
"Ask for her phone number":
$ flags["phoneNumber"] = True
[...]
"You're more the one night kiss person":
$ flags["phoneNumber"] = False
else:
[...]
There's other methods, but either they are not adapted for Python, or don't really add something to the ones presented here.