Giter Club home page Giter Club logo

tads-cookbook's People

Contributors

jimbonator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tads-cookbook's Issues

IF is for everyone: Make menus accessible to screen reader users at startup

Problem

The TADS 3 menu system on native interpreters (both text only and HTML TADS variants) are not accessible for players using screen readers.
This is due to the way the banner API works, and how they're usually displayed by interpreters.

Solution

Create an InitObject that asks the player if they're using a screen reader, and adjust the statusLine.statusDispMode to StatusModeText if so.
The reason we need to change the statusLine.statusDispMode variable is because the menu system displays menus in whichevermode the status line is displayed in.

screenReaderInit: InitObject
execute()
{
"\bAre you using a screen reader to play this story? (Yes or no.)";
if(yesOrNo())
{
statusLine.statusDispMode = StatusModeText;
}
}
;

You can use the exact same code for both adv3 and adv3lite, so there's no need to change the code depending on what library you use.

"Background detail": Explain the game in a help menu

Problem

It can useful to tell new or returning players what the background for the game is: where the game is set or who the player character is. While this might be obvious from an EXAMINE ME, you might want to elaborate some more.

It'd be nice to have some initial hints to guide them in the right direction.

Solution

Add a few game hints with permanently open goals so the hints on the backstory are always available:

TopHintMenu 'Hints';

+ HintMenu 'The Basics';

++ Goal 'Where am I?'
    ['You are in the TADS Cookbook kitchen.']
    openWhen = true
;

++ Goal 'Who am I?'
    ['You are the AFGNCAAP: the ageless, faceless, gender-neutral, culturally-ambiguous adventure person.']
    openWhen = true
;

To get to this menu, a player needs to type HINT (and then again after the warning). To disable the warning, you can do so at game initialization:

InitObject
    execute() {
        sessionHintStatus.hintWarning = true;
        gameHintStatus.hintWarning = true;
    }

To remap HELP to HINT:

DefineIAction(Help)
    execAction() {
        if (gHintManager != nil)
            gHintManager.showHints();
        else
            mainReport(gLibMessages.hintsNotPresent);
    }
;

VerbRule(Help)
    'help'
    : HelpAction
    verbPhrase = 'show/showing help'
;

Prime Multiple Verbs to Conjugate for gActor

Problem Statement

When using tokens in strings to automatically conjugate verbs, there is a case where a verb will "reset" the context of the sentence, causing following verbs to conjugate according to a default "it" noun.

The following demonstrates this behavior:

"{I} {hold} onto the ledge, drop{s/?ed},
and land{s/ed} on the floor below.";

creates:

I hold onto the ledge, drops, and lands on the floor below.

Solution

To fix this, the following code provides a new conjugation token (written as {aac}). Simply add or include this code before the rest of your project to make use of it:

/*
 * Actor Action Continuer (AAC)
 * Joseph Cramsey
 */
actorActionContinuer_: dummy_ {
    person = (gActor == nil ? 3 : gActor.person)
    plural = (gActor == nil ? nil : gActor.plural)
}

// A modified englishMessageParams will have our new token.
modify englishMessageParams {
    construct() {
        // Add the simplified message token
        params = params.append(['aac', { ctx, params:
            cmdInfo(ctx, actorActionContinuer_, &dummyName, vSubject)
        }]);

        inherited();
    }
}

With this, we now have the following behavior for all strings:

"{I} {hold} onto the ledge,{aac} drop{s/?ed},{aac}
and land{s/ed} on the floor below.";

creates:

I hold onto the ledge, drop, and land on the floor below.

As long as the {aac} token precedes a verb, the verb will be conjugated according to the gActor of the current action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.