Open full view…

Character Selection

Tue, 13 Mar 2018 13:20:58 GMT

Posted this originally in General, didn't realise I'd done that! I'm looking to create a choice between 2 characters, male and female, near the beginning of my game. How would I go about doing that? So that the chosen character is the player one for the rest of the game, and the other character is then just used as a normal non player character? Cheers

Tue, 13 Mar 2018 17:49:55 GMT

This is actually a bit more complex than it maybe should be, if you're planning on also having unique portraits. Names you can change by always referring to the player with a {$playerName}-style variable (pronouns are a bother, but also possible, by using something like $xe, $xim, $xer etc), but the portrait is more complex. Using a stage might be okay though, as you can then always in the stage-setting...uh..stage, do a if/else to see which gender your character is - but then you'll have to do that every time! Another option is of course to literally make two separate flowcharts or story threads for each character; dialog they have in common might be picked from e.g. a stringtable to make sure it matches. But that's a lot of work!

Thu, 15 Mar 2018 12:15:37 GMT

Ah ok, was hoping to try and avoid the 2 different flow charts, as that will only double the amount of work, thanks for the reply

Thu, 02 May 2019 18:01:47 GMT

Hey there! I implemented gender choice in my game, and figured I would share the code with folks. Hope it helps!

Sun, 12 May 2019 23:37:43 GMT

There are much more elegant ways to do this, but there is a simple way to accomplish this depending on how you want the story to proceed. If the story is the same regardless of character (I'm assuming choice 1 will not interact with choice 2) you can create a small intro flow (Maybe 5 blocks?) and a second, core story flow that you opt into from the first flow. If the story is different for each character choice, then multiple flows is probably the easiest way to not go insane with managing who is who in a single flow. I've done this with 2 characters and about 10 different flows that are all event based and Char choice 1 will interact with Char choice 2. So if there is something character specific, you use one flow (e.g. Char 1 does these things on Monday), if it is not character specific, each character story line calls that flow when appropriate (e.g. All characters will experience the same haunted mansion). It sounds crazy, but it actually much easier to keep organized for each individual character. Also, it makes it a lot easier to add a 3rd or 4th character o ption if you feel like getting super crazy with it. The brute force way is to have a intro flow (Flow 1 - choose your character), do your story (Flow 2 - Char 1) and call it from char choice 1 in Flow 1, then copy the entire story flow (Flow 3 - Char 2) and call it from Char choice 2 in Flow 1. Then you edit flow 3 accordingly. There are better ways, but if you are not good with code and you just want to get it done, sometimes hamfisting it is the way to go ;)