Asking the player for follow-up info (adv3lite)

Less of an issue and more of a question on how to ‘quiz’ the player, I seem to be unable to find how.

Imagine this scenario. You have a glass booth, if the player attacks the booth they shatter the glass, say for whatever reason we wanted the player to be able to crawl into the booth without using the door, or to use the door. (Open it normally, or crawling through the glass, basically.)

We could define a new ‘crawl into’ action or something, but say we really didn’t wish to. Is there a way to basically ask the player:

“You want to go in this way or that way?”

if the door is open we’ll just assume the player takes the door, no question needed.

This is relatively arbitrary as an example, but it gets across what I’m looking for.

Any help is appreciated, if you know multiple approaches I’d also love to hear them. Thank you everyone!

1 Like

You are using adv3 or a3Lite ?

The latter has recently added (in the ßeta version) a nifty new class which render easy adding a non-directional travel (as CRAWL) and from the docs, should be possible adding a call to yesorNo in the non-directional travel.

Best regards from Italy,
dott. Piergiorgio.

2 Likes

Ah, adv3lite, I forgot to clarify that!

Is that what you use?

1 Like

yes.

Best regards from Italy,
dott. Piergiorgio.

1 Like

I haven’t tested this, but I think you could do something like this:

glassBooth: Booth 'glass booth'
   dobjFor(Enter)
   {
      action()
      {
        if(isOpen)
          inherited();
        else
        {
          "How do you want to enter the booth? You could either BREAK THE GLASS
           or CRAWL INSIDE THE BOOTH. ";
           exit' // don't make this count as a turn.
        } 
      }
    }
    dobjFor(SpecialAction)
    {
       preCond = [touchObj]
       verify()
       {
          if(gActor.isIn(glassBooth))
            illogicalAlready('{I} {am} already in the glass booth. ');
       }
       action()
       {
           gActor.actionMoveInto(glassBooth);
           "{I} crawl(s/ed} into {the dobj}. ";
       }     
    }

SpecialVerb 'crawl into' 'sp#act' @glassBooth;
3 Likes

Eric is dobjFor(Enter) missing a verify or action method, or is there new syntax in Lite that I’ve missed?

1 Like

Typo on my part. Good catch. I’ll go back and correct it.

3 Likes

I suppose to be more specific my question more has to do with quizzing the player for follow up than the travel part itself, that’s the less important part and merely the (relatively bad) scenario I thought of in the moment.

Though this isn’t a bad suggestion by any means to accomplish this specific task!

Basically what if you need to ask the player more than a yes or no question, what if you need to directly prompt the player to choose between two, or even three actions, ect.

Or as another example what if you want typing out an action to prompt for more specifics, for example a simple Jump action that prompts the player. ‘Do you want to Jump LONG or Jump HIGH?’ Then the player can enter LONG or HIGH, or simply go back and type Jump Long or Jump High

Things like that!

1 Like

Thank you! This does solve the task quite handily, and reminded me of SpecialVerbs, that said my question, really, is concern on options for ‘quizzing’ the player, so to speak. How advanced can you go with this, what are your options?

See my reply to Piergiorgio for a bit more clarification on what I’m asking. But the gist of it is player choice, asking the player questions, and reacting to player input that might fall outside the standard action system.

Sorry, I know this is a lot!

1 Like

I implemented such a thing in adv3 here, in a function called promptList. adv3lite conversion left as an exercise for the student…

(EDIT: should have mentioned there is an implicit 9-option maximum in this implementation)

3 Likes

Not your implementation, but that of MacGuire, but is already implemented & tested (in my main messing arena, so perhaps one should take in account the dangling linkage to said arena)
oh, sorry for the commentage in strict Italian:

// a little "question and answer CYOA test"

/* esperimento (scientifico nel senso LETTERALE...) sul modo McGuire di implementare una scena CYOA */

cyoatest: Scene//, EventList
startsWhen = (gPlayerChar.isIn (pad) && done==nil)
endsWhen = (done == true)
recurring = true // def is nil, unneeded 4 one-off scenes.
pts = 0
done = nil
whenStarting() {
  pts = 0;
  "let's answer some questions...";
  letscyoa();
}
whenEnding() {"that's all, folks !";}
//eachTurn() {}
//preAction(lst) {}
//eventList = []
finishOff(howEnded) {}

letscyoa() {
  "This is my first question. What is your answer?\b
1). a1\n
2). a2\n
3). a3\n";

local input = input('please choose>');
if (input == '1')
{
  "Correct answer!\n";
 pts++;
}
else
{
  "Incorrect answer!\n";
}

  "This is my second question. What is your answer?\b
1). a1\n
2). a2\n
3). a3\n";

local input2 = input('please choose>');
if (input2 == '2')
{
  "Correct answer!\n";
 pts++;
}
else
{
  "Incorrect answer!\n";
}
  "This is my third and last question. What is your answer?\b
1). a1\n
2). a2\n
3). a3\n";

local input3 = input('please choose>');
if (input3 == '3')
{
  "Correct answer!\n";
 pts++;
}
else
{
  "Incorrect answer!\n";
}

"Thanks for your answers.\n For the record, you have given <<pts>> correct 
answers.\n";
done = true;

} //letscyoa
; //cyoatest

Perhaps later I’ll do your exercise… :wink:

Best regards from Italy,
dott. Piergiorgio.

1 Like