Tes3Mod:Choice

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search


Choice

                Choice, 'Button1', ...['Button5']

       Where:   'Button1'...    = Text for the various choices. At least one choice is required and
                                  up to five are allowed.

        Type:   Dialogue

     Returns:   none

     Example:   Choice, "Continue..."           (force the player to one option)
                Choice, "Yes" 1, "No" 2, "I'm not sure" 3

     Scripts:   Used only in dialogue results.

Used only in dialog for presenting 1 to 5 choices to the user. The choice results can be retrieved by using the choice function in the function/variable lists in the dialogue speaker conditions area. Use values following the choice strings to specify the exact return value if the user chooses that option (I'm unsure what values are returned if you do no specify values, though I assume they start at 1).

Important Note: If you specify the numbers after each choice you must include a space between the ending quote and the number.

Choice and Goodbye can be used in scripts. Choice can also be used multiple times in a row to create as many choices as desired. I'm not sure what happens when they're used if dialogue is not open, but I suspect it would crash Morrowind. However, when dialogue *is* open, they can be used for some very clever dialogue choices.

For example:

[in the dialogue topic]
        Okay, so here's the plan.  At the stroke of midnight, you
        post a watch on the northern tower.  Meanwhile, I'll enter
        the compound, and when you hear a loud whistle, you open
        the front gates and let me out.  Then we'll meet later and
        I'll give you your share.  Understand?
[in the dialogue Results box]
        Choice "No." 1
        StartScript "_spzHeistResponseIntelScript"
[in the script]
        begin _spzHeistResponseIntelScript

        if ( ( Player->GetIntelligence ) > 20 )
          Choice "Mostly." 2
        endif
        if ( ( Player->GetIntelligence ) > 40 )
          Choice "Yes, perfectly!" 3
        endif
        if ( ( Player->GetIntelligence ) > 60 )
          Choice "I have a better strategy." 4
        endif

        StopScript "_spzHeistResponseIntelScript" ;mandatory!
        end _spzHeistResponseIntelScript

In simple terms, the smarter the player is, the more options the player gets for responses.

Important note: in Morrowind-only engine up to v1.2.0722, the length of text line is limited by 100 letters. The CS allows you to type and compile longer lines (supposedly the limit is 512 letters, like with messageboxes and normal dialogue lines), but in game extra letters will be trimmed. With Tribunal and/or Bloodmoon installed, the limit is raised to 200 letters, but the truncation effect is still in place.

See Also: GoodBye, MessageBox