Can't find the 'no selectable options' error

I’m having trouble finding the error the ChoiceScript randomtest is flagging. I have tried changing the order of the options, checking all my tabs are right, turning a temp variable into a permanent one. Nothing has helped.

The error I’m getting is: “Randomtest failed: RANDOMTEST FAILED: Error: chapter_1 line 662: No selectable options”

Code below. Sorry it’s so long - I can’t work out how to collapse it and just copy-paste the relevant bits. The error is apparently on the line: #Lieutenant Davies, the bard.

My code looks like this:

*fake_choice
    #Lieutenant Ahmet, the Navigator.
        *set choose_chat_c1 "ahmet"
        *temp ahmet_chat_no_sailor false
        *set rferhan %+rmidi
        *label ahmet_chat_2
        *if ahmet_chat_no_sailor
            What do you want to talk about with Ahmet next?
            *goto ahmet_chat_3
        *else
            "Lieutenant Ahmet", you say, raising your drink in ${fer} direction, "a glass with you, sir." Ahmet grins, raises ${fer} glass in response, and knocks back a sizeable proportion of ${fer} wine. What do you want to talk about?
            *goto ahmet_chat_3
        *label ahmet_chat_3
        *fake_choice
            *hide_reuse #Shiphandling - that's ${fer} area of expertise.
                "So, you're our expert shiphandler," you say.

                *if pcspecial = "shiphandler"
                    "Well, I doubt I'd have much to teach you," Ahmet replies with a quirk of ${fer} lips.
                    *goto ahmet_chat_1
                *else
                    "So they tell me," ${fe} @{fsing replies|reply} with a smile.
                    *goto ahmet_chat_1
                *label ahmet_chat_1
                "Not that the Meredith requires much expertise," ${fe} @{fsing adds|add}. "You won't find a sweeter sailor in a fresh breeze, or a more responsive ship in a tardy one." 
                *fake_choice
                    *hide_reuse #I attempt to present an educated opinion about the ship's sailing qualities.
                        *if (pcspecial = "shiphandler") or (sailor >skill_hard_pass)
                            "Oh, she's a marvellous sailor," you say, "though I wonder if she might be even happier a trifle more to stern."

                            Ahmet looks at you with renewed respect. 

                            "I had exactly the same thought," ${fe} @{fsing says|say}, then @{fsing grins|grin} as another thought occurs to ${fem}. "After dinner, you must come and help me persuade the bosun to let us try it. That lubber absolutely insists on an entirely symmetrical weight distribution in the hold."

                            After that, the conversation flows smoothly between you as you enthusiastically discuss different possible rigs the Meredith might enjoy.
                            *set rferhan %+rmaxi
                            *goto how_did_that_go
                        *elseif (sailor >skill_medium_pass)
                            "Yes," you say, "I imagine she is at her happiest on a bowline."

                            Ahmet nods. "She is," ${fe} @{fsing agrees|agree}. After that, your conversation continues  pleasantly as you discuss technicalities of the ship's sailing. Ahmet even goes over some of the Meredith's particular idiosyncracies with you.
                            *set rferhan %+rmidi
                            *goto how_did_that_go
                        *else
                            "She's a lovely ship," you say. "I was surprised not to see her square rigged though."

                            Ahmet looks at you oddly. You realise too late that the Meredith actually [i]is[/i] square rigged, and ${fe} @{fsing is|are} now in the unenviable position of not wanting to directly contradict a superior officer, but being unable to agree with you. Silence blooms between you until, after a decent pause, Ahmet engages Morgan in conversation instead.
                            *set rferhan %-rmini
                            *set chat_went_well false
                            *goto how_did_that_go
                    #I explain that I am not much of a sailor, and ask for an explanation.
                        *if pcspecial = "shiphandler"
                            Ahmet looks at you quizzically. Clearly you are an excellent sailor, and ${fe} @{fsing seems|seem} to find your false modesty unbecoming. Silence blooms between you until, after a decent pause, Ahmet engages Morgan in conversation instead.
                            *set rferhan %-rmini
                            *set chat_went_well false
                            *goto how_did_that_go
                        *elseif (sailor >skill_medium_pass)
                            Ahmet smiles. "From what I've seen, you're perfectly competent," ${fe} @{fsing says|say}. "Should it please you for me to go over the finer points of the Meredith's sailing capabilities?"

                            You agree wholeheartedly to this plan, and ${fe} @{fsing takes|take} you over some of the most significant idiosyncracies of the ship.
                            *set rferhan %+rmidi
                            *goto how_did_that_go
                        *else 
                            "Well," Ahmet says, "there is nothing so becoming as a person who freely admits their faults." $!{fe} @{fsing proceeds|proceed} to give you an account of some of the most useful - but not widely known - aspects of sailing.
                            *set rferhan %+rmaxi
                            *goto how_did_that_go
                    #I explain that I am not much of a sailor, and move the conversation onto something else.
                        *set ahmet_chat_no_sailor true
                        *goto ahmet_chat_2
                    #The Meredith's secret mission - it's the big news.
                        *gosub secret_mission_chat   
                        *goto how_did_that_go
                    #$!{fer} personal history. I want to build a rapport.
                        "So," you say, "where do you call home?"

                        "Well," Ahmet replies, "My parents were Kızkuşlı, and I'm from Siluria but honestly-" ${fe} @{fsing gestures|gesture} expansively, taking in the ship, and the wide sea beyond it - "this is my home. I came to sea when I was 12, felt like I'd finally found my place." $!{fe} @{fsing pauses|pause}, @{fsing thinks|think} for a moment. "No," ${fe} @{fsing adds|add}, "it's more than that. I felt like I'd found myself."

                Looking at Ahmet, so utterly at home in ${fer} environment, so confidently present, you can believe it. You ask if ${fe} ever @{fsing goes|go} home to ${fer} family.
                *if charming >=skill_hard_pass
                    *set ferhans_health %+mini
                    *set ferhans_health_progress +1
                    *set rferhan %+rmidi
                    "There isn't much to go home to," ${fe} @{fsing replies|reply}. "My family are a sickly bunch." There's a wry smile on ${fer} face, but you can see it masks real sadness. "My parents barely saw me out of short trousers," ${fe} @{fsing explains|explain}, "and we weren't a large family to begin with."

                    Overhearing this last comment, Evans leans over and touches Ahmet's arm. "Only your blood family," ${ee} @{esing says|say} earnestly. "Your new family isn't going anywhere." Ahmet looks as if ${fe} @{fsing doesn't|don't} know whether to be touched or embarrassed by Ellis's open affection, so far from ${fer} own armoured wit, and opts for both at the same time.
                    *goto how_did_that_go
                *elseif charming >=skill_medium_pass
                    *set rferhan %+rmidi
                    "Not often, no," ${fe} @{fsing responds|respond} swiftly. $!{fe} @{fsing grins|grin}. "I should have been born a mer."
                    *goto how_did_that_go
                *else
                    *set rferhan %-rmini
                    *set chat_went_well false
                    $!{fe} @{fsing looks|look} at you sardonically. "I [i]am[/i] home," ${fe} @{fsing says|say}, a little coldly. As soon as ${fe} politely can, ${fe} @{fsing turns|turn} to talk to Davies instead.
    #Lieutenant Davies, the Bard.
        *set choose_chat_c1 "davies"
        *set rcelyn %+rmidi
        *label davies_chat_2
        *if davies_chat_no_philosopher = false
            "Lieutenant Davies", you say, raising your glass in ${cer} direction, "a glass with you, sir." Davies smiles warmly, raises ${cer} glass of punch enthusiastically towards yours, then takes a few sips. What do you want to talk about?
            *goto davies_chat_3
        *else
            What do you want to talk about with Davies next?
            *goto davies_chat_3
        *label davies_chat_3
        *fake_choice
            #The Meredith's secret mission - it's the big news.
                *gosub secret_mission_chat
                *goto how_did_that_go
            *hide_reuse #Natural philosophy - that's ${cer} area of expertise.
                "So," you say, "you're our resident expert in natural philosophy."

                Davies smiles the smile of someone who has never learned how to respond to flattery.

                "I'm an amateur really," ${ce} @{csing says|say}.
                *if pcspecial = "scientist"
                    "And besides," ${ce} @{csing adds|add}, "I hear you're the real expert."
                    *goto davies_chat_1
                *else 
                    "But I absolutely love it," ${ce} @{csing says|say}.
                    *goto davies_chat_1
                *label davies_chat_1
                *fake_choice
                    #Attempt to say something clever about natural philosophy.
                        *if (pcspecial = "scientist") or (perceptive >skill_hard_pass)
                            *set rcelyn %+rmaxi
                            You tell ${cem} how happy you are to have a fellow enthusiast on board, and mention your desire to test your theory that areas of magical density result in more twin births in local dolphin communities. Davies is absolutely fascinated by this idea, and instantly loses ${cer} slight awkwardness in ${cer} enthusiasm for it. The two of you chat merrily all the way to dessert.
                            *goto how_did_that_go
                        *elseif perceptive >skill_medium_pass
                            *set rcelyn %+rmidi
                            You mention an article you read in a friend's copy of the Proceedings of the Society for Natural Philosophy, expressing the theory that the magic which protects cohesive communities is drawn [i]from[/i] those communities, rather than the magic being drawn [i]to[/i] them. From Davies's expression, it seems this idea is less modern and exciting than you had hoped, but nonetheless, the two of you have a pleasant conversation discussing the merits of the idea, and you gain a more nuanced understanding of the subject from Davies.
                            *goto how_did_that_go
                        *else
                            *set rcelyn %-rmini
                            You rake your memory for anything even loosely connected to natural philosophy, and eventually come up with something a friend told you in a tavern once. You repeat to Davies your tidbit that magic responds to the feelings of powerful leaders. As ${ce} @{csing looks|look} at you, clearly trying to suppress a smile at how unbelievably wrong you are, you remember that you've got your fact backwards - in fact, it was that magic [i]doesn't[/i] respond to the feelings of any individuals, even powerful leaders. Davies buries ${cem}self in ${cer} wine until ${ce} @{csing has|have} ${cem}self back under control. It's safe to say the conversation is over.
                           *goto how_did_that_go
                    #I express interest in hearing more about the subject, as I know little about it.
                        *if pcspecial = "scientist"
                            Davies looks confused.

                            "But I thought you were selected for this mission because you're good at natural philosophy," ${ce} @{csing says|say}.
                            *goto false_modesty
                        *elseif perceptive >=skill_hard_pass
                            Davies looks confused.

                            "Oh," ${ce} says. "I had the impression from Captain Malik that you were a fellow enthusiast."
                            *label false_modesty

                            You realise that Davies has genuinely never encountered false modesty before. You are obliged to awkwardly backtrack, leaving Davies with the confused impression that you have lied in some way ${ce} @{csing doesn't|don't} understand.
                            *set rcelyn %-rmini
                            *set chat_went_well false
                            *goto how_did_that_go
                        *elseif (perceptive >skill_medium_pass)
                            *set rcelyn %+rmidi
                            Davies looks pleased, and proceeds to give you a mini-summary of some of ${cer} favourite recent discoveries. It's very interesting, and you learn several things about magical variation in crustacians.
                            *goto how_did_that_go
                        *else
                            *set rcelyn %+rmaxi
                            Davies looks delighted. "Oh, nothing could give me greater pleasure," ${ce} @{csing says|say}, with unfeigned enthusiasm, and you swiftly discover that Davies is as enthusiastic a teacher as ${ce} @{csing is|are} a natural philosopher. $!{ce} @{csing races|race} through some of the basic principles, and you enjoy learning a few useful tidbits.
                           *goto how_did_that_go
                    #Change the subject. 
                        You tell Davies you're glad ${ce} @{csing is|are} the expert, so you don't have to be, then change the subject.
                        *set davies_chat_no_philosopher true
                        *goto davies_chat_2
            #$!{cer} personal history. I want to build rapport.
                "So," you say, "where are you from?"
                *if (rcelyn >skill_medium_pass) or (perceptive >skill_medium_pass)
                    For a moment, you think you see a shadow pass across ${cer} usually sunny countenance. A moment later, it's gone, and ${ce}
                    *goto davies_chat_4
                *else
                    $!{ce}
                    *goto davies_chat_4
                *label davies_chat_4
                @{csing answers|answer} composedly that ${ce} @{csing is|are} from Dyfed. You've been to Dyfed once or twice.
                *if charming >=skill_hard_pass
                    *set rcelyn %+rmidi
                    "I once went camping in the forests on Dyfed," you say. "I've rarely seen such rich greens or such dense woodland."

                    Davies looks momentarily taken aback, though pleased, that you have mentioned the beauty of the [i]inland[/i] parts of the island, but recovers ${cem}self quickly and proceeds to enthusiastically tell you all about the diverse range of trees in the forests of ${cer} home.
                    *label where_are_you_from
                    "And what about you?" Davies asks finally. "Where are you from?"
                    *fake_choice
                        #Cailleann, an island of forests and winds in northern Measarra.
                            "Caillean," you say.
                            *set pchome_island "Caillean"
                        #Dumnonia, an island of fertile soil and level fields in southern Measarra.
                            "Dumnonia," you say.
                            *set pchome_island "Dumnonia"
                        #Airgíalla, an island of rich flora and fauna in western Measarra.
                            "Airgíalla," you say.
                            *set pchome_island "Airgíalla"
                        #Siluria, an island of tall mountains and fertile valleys in central Measarra.
                            "Siluria," you say.
                            *set pchome_island "Siluria"
                    Davies beams, and starts enthusiastically listing all the brilliant things ${ce} @{csing remembers|remember} about the particular flora and fauna of ${pchome_island}.

                    You ask Davies what brought ${cem} to a life on the ocean. $!{ce} @{csing replies|reply} without hesitation.

                    "Oh, the magic," ${ce} @{csing says|say}. "Without a doubt. I was always fascinated by it. I'm very interested in the way magic influences human communities."

                    You comment that this is usually described as magical justice. Davies looks thoughtful.

                    "Yes," ${ce} @{csing says|say}, "but I've never been wholly convinced by that idea. After all, the magic isn't any more likely to protect a hospital ship than a ship of war."

                    You ask ${cem} for ${cer} own theory. $!{ce} @{csing pauses|pause}, considering. "I suppose this will sound horribly anthropocentric," ${ce} @{csing says|say}, "but it's always seemed to me that the most important factor is how the community feels. You know, not that the magic has any native sense of justice, but that it sort of… mirrors what the people feel. I can't wait to study the effects more closely on this voyage. After all, a ship is essentially a completely isolated community."
                    *fake_choice
                        #Intellectual curiosity is all very well, but Davies should be focusing on ${cer} duties as a naval officer.
                            *if dutiful >=peasy_pass
                                *label naval_celyn
                                *set passionate_celyn %-pmini
                                *set passionate_celyn_progress +1
                                Davies looks a little crestfallen, and it's clear ${ce} @{csing has|have} taken your words seriously. After all, you are technically ${cer} superior officer. You suspect ${ce} will place more focus on ${cer} naval duties from now on.
                                *goto how_did_that_go
                            *else
                                *set passionate_celyn %+pmini
                                *set passionate_celyn_progress +1
                                Davies eyebrows raise, just a little. It's clear that from what ${ce}@{csing 's|they've} seen of your attitude so far, ${ce}@{csing 's|'re} not willing to take advice on duty from you.
                                *set chat_went_well false 
                                *goto how_did_that_go 
                        #I can handle the magic. $!{ce} should focus on sailing.
                            *if educated >= skill_easy_pass
                                *goto naval_celyn
                            *else
                                *set passionate_celyn %+pmini
                                *set passionate_celyn_progress +1
                                *set chat_went_well false
                                For a moment, you think Davies might actually laugh at you. It's obvious ${ce} @{csing thinks|think} your understanding of natural philosophy is vastly inadequate to the task. You're sure she will now spend even more energy on improving her understanding of magic.
                                *goto how_did_that_go
                        #Davies was recruited to know about this stuff. The rest of us can pick up the slack with the naval side of things.
                            *if sailor >=skill_easy_pass
                                *label magic_celyn
                                *set passionate_celyn %+pmini
                                *set passionate_celyn_progress +1
                                Davies beams at you, and expands on ${cer} topic with enthusiasm. It's clear ${ce} @{csing has|have} taken your blessing seriously. After all, you are technically ${cer} superior officer. You suspect ${ce} will place even more focus on ${cer} passion for natural philosophy from now on.
                                *goto how_did_that_go
                            *else
                                *set passionate_celyn %-pmini
                                *set passionate_celyn_progress +1
                                Davies looks at you doubtfully. You suspect ${ce} @{csing hasn't|haven't} been all that impressed with the little they've seen of your sailing prowess so far, and @{csing isn't|aren't} sure you'll be able to pick up that kind of slack. ${ce}'ll probably focus on ${cer} naval abilities even more now.
                                *set chat_went_well false
                                *goto how_did_that_go
                        #We all benefit when people play to their strengths. In Davies' case, that's natural philosophy.
                            *if dutiful >=peasy_pass
                                *goto magic_celyn
                            *else 
                                Davies looks at you doubtfully. To you, this argument sounded pragmatic and sensible, but it seems like Davies is not convinced by it. You suspect ${ce} will put more energy into being a more competent naval officer now.
                                *set passionate_celyn %-pmini
                                *set passionate_celyn_progress +1
                                *set chat_went_well false
                                *goto how_did_that_go
                *elseif charming >=skill_medium_pass
                    *set rcelyn %+rmini
                    "I've stopped at Dyfed Harbour twice to take on water," you say. "I had a little liberty, so I took a walk along the cliff path. It's a ruggedly beautiful coastline."
                    
                    You are rewarded with a touchingly sincere response from Davies.
                        
                    "Oh, yes!" ${ce} @{csing says|say}. "I've spent so many hours on those paths, gazing out at the sea. And the rock formations of the cliffs themselves are fascinating."
                    *goto where_are_you_from
                *else
                    *set rcelyn %-rmini
                    You cast your mind back to the little time you've spent on the island, and repeat the only thing you really remember about it. 

                    "Lots of inlanders on Dyfed," you say. "I remember my captain warning us that it was a lawless place."

                    Davies responds neutrally that, due to the largely cliff-edge coastline, Dyfed is unusual in having an inland population that outnumbers its coastal population. You detect a stiffness in ${cer} manner after that though. Something about your remark seems to have offended ${cem}.
                    *set chat_went_well false
                    *goto how_did_that_go

    #Lieutenant Evans, the Surgeon.
Example
*commend
    Indent

Looks to me like the problem is that you’ve only got one potential convo topic with Ahmet after * label ahmet_chat_3, Shiphandling. If you pick that, and then pick that you’re not much of a sailor and move the conversation onto something else… there’s no selectable option, because Shiphandling is behind a hide_reuse, and (unless I’m overlooking something) there are no other options at that indent level in Ahmet’s conversation.

The reason the error triggers on the Lieutenant Davies line is because that’s where it “falls out” of the Ahmet block – but the error is in the Ahmet block, not the Davies line specifically.

3 Likes

I think perhaps the largest issue I can find isn’t the specific error but the structure of your code: nests within nests within nests. To better diagnose these kinds of issues you’re probably going to need to reconsider how you structure these conversations.

If you use my structure below, you’ll rarely go beyond two indentations and you’ll be able to understand your conversation code much more easily at a glance. That’ll help you diagnose issues like these.

*label ahmet_davies_evans

*fake_choice
  *disable_reuse # Lieutenant Ahmet, the Navigator.
    *set ahmet_variables true
    *gosub ahmet_chat
  *disable_reuse # Lieutenant Davies, the Bard.
    *set davies_variables true
    *gosub davies_chat
  *disable_reuse # Lieutenant Evans, the Surgeon.
    *set evans_variables true
    *gosub evans_chat
  # I'm done talking to these people.
    *goto next_section

*goto ahmet_davies_evans

*label ahmet_chat

Ahmet says, "Don't talk to me until I've had my coffee!"

*return

*label davies_chat

Davies says, "Don't talk to me until I've had my coffee!"

*return

*label evans_chat

Evans says, "Don't talk to me until I've had my coffee!"

*return

*label next_section

bleh bleh bleh
2 Likes

Oh my god I didn’t even check the Ahmet section because I assumed the randomtest would tell me when it got stuck, rather than the next thing after the point it got stuck. Yep, I had accidentally indented two of the original conversation options into a later set of options. Thank you so much! I spent like an hour looking for that error yesterday!

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.