Howdy, Stranger!

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

(Harlowe) Trying to add name and gender options

I'm trying to make the main character's name/title/style of address, etc. change based on choices at the beginning of the passage, but I'm running into the "X is not defined" error.

Examples:
I am a noble and refined lord.(set: $title to Lord)->What is your name?
Aldrovanda(set: $name to Aldrovanda)->Pleased to meet you.
<<textinput $name "Pleased to meet you.">>

Fairly certain I'm doing some kind of amateurish mistake, but I'd like it clarified.

Comments

  • edited October 2016
    Edit: sorry. just saw the title. You're mixing syntax.

    <<textinput>> looks like sugarcube (except it isn't - the sc version is textbox). but you're using harlowe.

    Also, I think you may need to (set: $name to "") before you call any of the other stuff.
  • The <<textinput>> macro is from the Twine 1.4 vanilla story formats. It will not work in Harlowe.

    In order of what you were trying:

    Via a link, using the (link:) macro, (set:) macro, & (goto:) macro:
    (link: "Aldrovanda")[(set: $name to "Aldrovanda")(goto: "Pleased to meet you.")]
    

    Via a input, using the (prompt:) macro. For example:
    (set: $name to (prompt: "What is your name?", "Aldrovanda"))
    

    WARNING:

    The following looks like it should work—note the corrected syntax within the (set:) macro—however, it does not:
    [[Aldrovanda(set: $name to "Aldrovanda")->Pleased to meet you.]]
    
    The reason is because the (set:) within the link markup is evaluated when the link is created, not when it's clicked on by the player. In other words, it's essentially the same as the following:
    [[Aldrovanda->Pleased to meet you.]]\
    (set: $name to "Aldrovanda")
    
    Which is not what you're looking to do.
  • Instead of having preset names, you could let the player make their own with the prompt macro:
    (link: "Continue")[(set: $name to (prompt: 'Please Create A Name:'))(goto: 'Pleased to meet you.')]
    
  • edited October 2016
    and you can give 2 links for the gender
    (link:"Male")[(set:$gender to "Male")(go-to: "next passage")]
    (link:"Female")[(set:$gender to "Female")(go-to: "next passage")]
    
    with "next passage" being the name of obviously the next passage, it's really easy when you're not trying to put sugarcube macros in harlowe
  • Khaloodxp wrote: »
    it's really easy when you're not trying to put sugarcube macros in harlowe
    As has been pointed out, twice within this thread already, <<textinput>> is not a SugarCube macro.
  • edited October 2016
    As has been pointed out, twice within this thread already, <<textinput>> is not a SugarCube macro.
    ooh my bad


Sign In or Register to comment.