I am in the very early stages of writing / developing a sci fiction drama / thriller.
I would like my game to focus around multiple payable characters in which each decision they make affects the story.
I haven’t attempted to code anything yet but the main problem I see with this idea is being able to code switching scenes from character 1 to character 2 and still having the unique stats saved for character 1 when you come back to play as them.
Is this possible? is this even worth the time if it is possible? Would players even be interested in playing as multiple different set characters? Should I just stick to the normal one customizable character?
Divided We Fall had multiple characters and I loved that game. It it is entirely possible to have multiple characters played in a game.
You can keep the stats for both of the characters or however many you have. You just need to *create different stats for each of them and then *create a new stat to track which character the player is, so you can display those stats.
There’s a number of ways to do it, depending on how you plan to do the switching. Do you plan for at any point in the game you could be playing either character? Or do you plan to only allow for each character to be played in specific sections?
If you’re allowing for the switch between characters, and you have two characters, I’d have three sets of variables, one for each of the characters and one to just hold the current stat value.
So well if my characters were Alex and Ben
*create strength 0
*create alex_strength 5
*create ben_strength 10
Which character do you wish to select?
*choice
#Alex
*set current_character Alex
*set strength=alex_strength
#Ben
*set current_character Ben
*set strength=ben_strength
That will let you do stuff like
*if strength > 5
You break down the door
*set strength +5
Then when you switch characters back you’ll want to do the following, so any changes are saved to the character’s stats before you switch.
*if current_char = alex
*set alex_strength = strength
*if current_char = ben
*set ben_strength = strength
I have thought about making games that changes characters. If done right, I’m sure people would like it. I guess you would just want to make sure there is a reason for the changing of characters instead of thrown in which also might confuse people but I think’s a cool idea.
if you want to have multiple playable character that jumps back and forth, you can use “soft save” to store the character stats for later, things like:
@FairyGodfeather’s suggestion is probably the best, but I can’t envision a more perfect use of the “setref” function.
Like so:
*create strength 0
*create alex_strength 5
*create ben_strength 10
Which Character do you wish to select?
*choice
#Alex
*setref strength "alex_strength"
#Ben
*setref strength "ben_strength"
from the code above, “strength” is now linked to either (“alex” or “ben”)_strength.
So any mention of
*set strength
will directly affect the chosen character’s strength. Meaning there is no longer any need for this code:
Having multiple characters using for a game like that actually reminded me of This War of Mine…
Anyway this is cool, is there a limit on how many characters we can have at once?
Also is there a way to switch characters on and off, like a certain scene to have the character switch entirely?