Widget ChoiceLink going wrong - SugarCube 2

0 votes
asked Sep 12, 2017 by Randalthor (680 points)

I've added the ChoiceLink to my java and it was working well before, allowing up to multiple clickable choices that sets up the continuation of the story without having to leave the passage itself. However as I was adding to it, it began to only show choice #2's reaction despite clicking choice #1. I would love some help if someone could recognize what I'm missing here, for little ol' newbie right here :) Thanks!!

    <span id='option'> 
        <<choiceLink '#option' 'Get out of bed' 'you get out of bed.'>> or	
		<<choiceLink '#option' 'Another ten flippin minutes.' 'yeah screw the system!'>>

(Necessary for the above to function) 

<<widget 'choiceLink'>>\
        <<set _linkGroup to $args[0]>>
        <<set _linkText to $args[1]>>
        <<set _result to $args[2]>>
        <<link _linkText>>
            <<append _linkGroup>>
                <<- '\n\n' + _result>>
            <<run $(_linkGroup + ' a').off().addClass('no-link')>>


1 Answer

+1 vote
answered Sep 13, 2017 by greyelf (88,790 points)

When referencing code from another question it helps if you include a link to it, I am assuming you are using this ChoiceLink macro.

As I stated in that question, the widget contains as error and would of always showed the reaction of the last choice (choice #2 in the examples case).

commented Sep 13, 2017 by Chapel (46,530 points)
Whoops. Thanks for cleaning up my mess, greyelf.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.