Multiple Characters


#1

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?

Input would be great :blush:


#2

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.


#3

That shouldn’t be too tricky.

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

There are other ways to do this.


#4

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.


#5

I’m actually working on a game that does that on the side… probably why progress is slow with Man Alive


#6

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:

player_strength = saved_strength
player_intel = saved_intel

then when the reader switch to the old character again, just reverse it:

saved_strength = player_strength
saved_intel = player_intel

this would be the method to always have “Show Stat” display the correct stat for the character in play. =)


#7

A slightly different version of your method -
*create floral_arranging 0

At the beginning of the scene starring Ben:
*set character=“Ben”
*gosub_scene stat_assign

In the stat_assign scene:

*if character="Ben"
   *set floral_arranging = (ben_floral_score)
   *set pronoun "him"
   *etc.

p.s.: @Zoe I think it’s worth the effort. Good luck with your game!


#8

@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:

*if current_char = alex
    *set alex_strength = strength
*if current_char = ...

Going a bit further with this idea, you could even let the player type their own names for each character if you so wished.


#9

I didn’t even know about the setref command. Does that actually work, if so it’s a very clever way to deal with things.

Even reading through http://choicescriptdev.wikia.com/wiki/Ref_Commands it’s still not quite clicking for me.


#10

And to advance on that even further…

*set strength {current_char_fname&"_strength"}
*set dexterity {current_char_fname&"_dexterity"}
etc...

Then not only do you not need *ifs, but you only need one big block of set statements too.

@FairyGodfeather
Where are you stuck?


#11

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?