To be perfectly honest, i didn't understand what you meant [...]
Your main problem is that all the variables that would keep track of how the player is doing are not available at the point the main main is shown. (There are two similar menus "main_menu" and "game_menu"... game menu is the one you see when you're in the middle of a game, the main menu is the one you see before you start).
There is something called
You must be registered to see the links
variables. They exist outside of the main game-play loop. They are not part of the save game files... they are entirely separate. Think of them as "per game" group of variables rather than a "per play through" group of variables. They "persist" through pretty much anything the player does.
So imagine you have a two variables "var_a" (normal) and "var_b" (persistent). When you start a game for the first time, let's say they both start as 0. The player plays for a bit and both
var_a
and
var_b
end up being 6.
The player (for whatever reason) starts a new game. While
var_a
is reset back to 0,
var_b
is still 6.
This behavior is great for certain things. The game's volume for one example.
And it might work for what you have planned. Have the values stored in persistent variables and use those persistent variables on the main menu to change the pictures you wish to show.
One solution is to reset the persistent variables you want to use for the main menu each time you start a new game too. But...
The problem Anne wants to highlight is when a player is playing two (or more) routes through the game simultaneously.
The player starts the game for the first time with a character called "Bob".
"Bob" plays for a while and
var_b
ends up being 4.
The player then restarts the game with a new character "Bob2".
Because you've coded it that way...
var_b
is reset to zero for BOTH "Bob2" and "Bob". Probably not what you had planned.
Now let's imagine
var_b
is tracking something common like "lust".
The player continues to alternate playing between "Bob" and "Bob2". Bob gains 10 lust points and Bob2 gain 12.
var_b
is now 22. Also, probably not what you had in mind.
If your game is focused on lifestyle, perhaps you have "Dominant" and "Submissive" variables...
v_dom
and
v_sub
. Imagine if your game stored these as persistent variables and game does "+1 dom and -1 sub" for a specific choice and "-1 dom and +1 sub" for the opposite choice. If a player were playing BOTH routes, alternating between saved games with each route... the values could all end up cancelling each other out and the values all being zero, because a choice made on one path reverses the choice made on the other path.
I think persistent is still the way to solve this. Though you need to plan ahead for crap like this.
One solution is to keep all the variable "normal" and each time you alter these variables... copy the value to a persistent variable of a similar name. Then use the persistent variable on the main menu.
It will mean that the menu will show pictures based on the value of the latest playthrough - and for a lot of players, who only play a game once, this would be fine.
You'll also need to update "all" the persistent variables, even if you only change 1.. because otherwise you might end up with a really odd mix of values if the player is switching between two very different play-throughs.
Maybe something like:
Python:
default mc_love = 0
default mc_lust = 0
default e_love = 0
default e_lust = 0
default persistent.mc_love = 0
default persistent.mc_lust = 0
default persistent.e_love = 0
default persistent.e_lust = 0
init python:
def update_persistent_variables():
persistent.mc_love = store.mc_love
persistent.mc_lust = store.mc_lust
persistent.e_love = store.e_love
persistent.e_lust = store.e_lust
# etc, etc.
label start:
"*** START ***"
# later during the game...
$ mc_lust += 1
$ update_persistent_variables()
# later....
$ e_love += 1
$ update_persistent_variables()
# maybe even...
$ mc_lust += 1
$ e_love += 1
$ update_persistent_variables()
# and so on....
"*** THE END ***"
return
Then you just check the persistent variables when doing anything with main menu images.
btw. The
store
is just me being extra careful. "Normal" variables are kept in a
store
namespace.