Howdy, Stranger!

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

Dialogue signifying Character class.

Hey there! I'm less than a week into Twine and have a question, and I apologize in advance if it is a simple one. I think my main issue is that this is my first foray into coding, and despite watching quite a few tutorials and reading this forum there's probably something I can't wrap my head around just yet.

So my question is this. I write my choices or links textlocation as interior or exterior dialogue. Like a Bioware game. But I would like it so that my player, if they click a piece of dialogue, it helps create their character for the game.

Example: My sword was stained and in the end, nearly broken <If they click this, I would like to have $class as "Swordsman"

My staff was lightning, strong enough to cook the most frozen of hot pockets <If they click this, then their $class would be "Mage"

And later on, when they pick their gender, or race, I'm hoping to write in code:

"So, $race $class, what brings you to this roller derby?"

Any help in the right direction would be greatly appreciated. Thanks again for your time.

Comments

  • edited July 2015
    You need to state which story format you are using, as answers can be different for each one. I am going to assume you are using Harlowe. (documentation)

    You can use a named-hook and the (click:) macro to show a link which when clicked does something other than send the Reader to a new passage, you can also us a (link:) macro to do the same thing:
    [My sword was stained and in the end, nearly broken]<sword|
    (click: ?sword)[(set: $class to "Swordsman")]
    
    (link: "My staff was lightning, strong enough to cook the most frozen of hot pockets")[(set: $class to "Mage")]
    
    ... if you want to send the Reader to a new passage as well you can add a (goto:) macro to your (click:) / (link:) macros:
    [My sword was stained and in the end, nearly broken]<sword|
    (click: ?sword)[(set: $class to "Swordsman")(goto: "Next Passage")]
    
    (link: "My staff was lightning, strong enough to cook the most frozen of hot pockets")[(set: $class to "Mage")(goto: "Next Passage")]
    
  • Thank you for your help! I apologize for not citing documentation. Much obliged!
  • "hot pockets" !!!! haha

    love it
Sign In or Register to comment.