Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Coding a character creation sequence

Hi,

I want to start my story with the option for players to decide what their character looks like. At the end of this, I want to have a passage that says something like "You look in the mirror and see a woman with brown hair and hazel eyes.", with the options filled in for what they chose.

How can I code this? I'll need to assign multiple options to variables for gender, eye color, and hair color and then have the game remember what the player chose. using (print: ) just made everyone a nonbinary person with blonde hair and blue eyes.

I have never coded anything before, so simple explanations are appreciated!

Comments

  • You'll have to tell us the full version number of both Twine and the Stroy format you're working with before anybody can help you.
    Maybe you can find an answer to your question here.
  • If you use Twine 2, SugarCube 2.18.0:

    I like to use cycling links to set a variable for this, although if you want to give many options, there are probably better methods. I found the code for this here:
    https://www.glorioustrainwrecks.com/node/5020
    And further down on that page is also a link for CSS options for the effect you want.
    A basic example for the code I have would be (Will not work without the JavaScript, will work without any CSS):
    <<cyclinglink "$haircolor" "brown" "blonde" "red" "black">>
    
  • @ayyylin
    Deviate wrote: »
    If you use Twine 2, SugarCube 2.18.0:

    I found the code for this here:
    https://www.glorioustrainwrecks.com/node/5020

    WARNING: The code on the glorious trainwrecks website was written for the story formats that came pre-installed with Twine 1, do not use them with SugarCube.

    The SugarCube specific version of the <<cyclinglink>> macro add-on can be found in the Downloads - Add-ons section of either the SugarCube 1.x website or the SugarCube 2.x website.
Sign In or Register to comment.