Grouped Messages As Dialogue

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 11 - The New Before Printing a Library Message (I6) - written by David Fisher - unindexed

    Cull inform default messages is a number that varies. [USED AS THE I6 RETURN VALUE] Cull inform default messages is 0.
    Message-game-error is a library-message-value that varies. [ USED AS ANOTHER I6 RETURN VALUE ]

    This is the I6 returns rule:
        if using grouped messages as dialogue debugging option, say "// in 'I6 returns' rule";
        set game error to message-game-error;
        now cull inform default messages is 1;
        consider the current errorbook;
        if the rule failed, now cull inform default messages is 0;
        set game error to LibMsg <no error>.

    This is the print library message rule:
        if using grouped messages as dialogue debugging option, say "// in 'print library message' rule";
        now cull inform default messages is 1;
        consider the current errorbook;
        if the rule failed, now cull inform default messages is 0;
        set game error to LibMsg <no error>.

    I7_LibraryMessages is a thing.
    Include (-
    with before LibraryMessagesBefore,
    -) when defining I7_LibraryMessages.

    Include (-
    [ LibraryMessagesBefore id isImplicitAction;
    id = -1;
    (+main object+) = lm_o;
    -)

    [1]

    Include (-
    Miscellany:
    switch (lm_n) {
    1: id = (+LibMsg <first N objects>+);
    2: id = (+LibMsg <zero multiple objects>+);
    3: id = (+LibMsg <you have died>+);
    4: id = (+LibMsg <you have won>+);
    ! 5 is "Would you like to restart ...", handled specially by Inform 7
    6: id = (+LibMsg <undo not provided>+);
    7: id = (+LibMsg <undo failed>+);
    8: id = (+LibMsg <restrict answer>+);
    9: id = (+LibMsg <entering darkness>+);
    10: id = (+LibMsg <empty line>+);
    11: id = (+LibMsg <cannot undo nothing>+);
    12: id = (+LibMsg <cannot undo twice in a row>+);
    13: id = (+LibMsg <undo succeeded>+);
    14: id = (+LibMsg <oops failed>+);
    15: id = (+LibMsg <oops no arguments>+);
    16: id = (+LibMsg <oops too many arguments>+);
    17: id = (+LibMsg <dark description>+);
    18: id = (+LibMsg <player self description>+);
    ! 19 was LibMsg <player description>
         ! - use "The description of the player is ..." instead
    20: id = (+LibMsg <again usage>+);
    21: id = (+LibMsg <cannot do again>+);
    22: id = (+LibMsg <cannot begin at comma>+);
    23: id = (+LibMsg <cannot talk to absent person>+);
    24: id = (+LibMsg <cannot talk to inanimate object>+);
    25: id = (+LibMsg <extra words before comma>+);
    26: (+main object+) = not_holding;
    id = (+LibMsg <report implicit take>+);
    27: id = (+LibMsg <command not understood>+);
    28: id = (+LibMsg <command partly understood>+);
    29: id = (+LibMsg <number not understood>+);
    30: id = (+LibMsg <unknown object>+);
    -)

    Include (-
    31: id = (+LibMsg <command incomplete>+);
    32: id = (+LibMsg <object not held>+);
    33: id = (+LibMsg <verb cannot have multiple objects>+);
    34: id = (+LibMsg <too many multiple objects>+);
    35: id = (+LibMsg <pronoun not set>+);
    36: id = (+LibMsg <excepted object not included anyway>+);
    37: id = (+LibMsg <verb cannot have inanimate object>+);
    38: id = (+LibMsg <unknown verb>+);
    39: id = (+LibMsg <unimportant object>+);
    40: !print (address) pronoun word; ! (address)
            (+main object+) = pronoun_obj;
         id = (+LibMsg <pronoun absent>+);
    41: id = (+LibMsg <command badly ended>+);
    42: (+the number understood+) = multi_had;
            id = (+LibMsg <not that many available>+);
    43: id = (+LibMsg <zero multiple objects>+); ! same as Miscellany #2 (?)
    44: id = (+LibMsg <no objects available>+);
    45: id = (+LibMsg <who disambiguation>+);
    46: id = (+LibMsg <which disambiguation>+);
    47: id = (+LibMsg <single object disambiguation>+);
    48: (+main object+) = actor;
         id = (+LibMsg <whom disambiguation>+);
    49: (+main object+) = actor;
         id = (+LibMsg <what disambiguation>+);
    50: id = (+LibMsg <score changed>+);
    51: id = (+LibMsg <command cut short>+);
    52: id = (+LibMsg <menu prompt>+);
    53: id = (+LibMsg <page prompt>+);
    54: id = (+LibMsg <comment recorded>+);
    55: id = (+LibMsg <comment unrecorded>+);
    }
    jump end_part;
    -)

    [ The ListMiscellany rules ("providing light", etc) can be handled OK by Inform 7 ]

    [2]

    Include (-
    Quit:
    switch (lm_n) {
    1: id = (+LibMsg <yes-no prompt>+);
    2: id = (+LibMsg <confirm Quit>+);
    }
    jump end_part;

    Restart:
    switch (lm_n) {
    1: id = (+LibMsg <confirm Restart>+);
    2: id = (+LibMsg <Restart failed>+);
    }
    jump end_part;
    -)

    [3]

    Include (-

    Restore:
    switch (lm_n) {
    1: id = (+LibMsg <Restore failed>+);
    2: id = (+LibMsg <Restore succeeded>+);
    }
    jump end_part;

    Save:
    switch (lm_n) {
    1: id = (+LibMsg <Save failed>+);
    2: id = (+LibMsg <Save succeeded>+);
    }
    jump end_part;

    Verify:
    switch (lm_n) {
    1: id = (+LibMsg <Verify succeeded>+);
    2: id = (+LibMsg <Verify failed>+);
    }
    jump end_part;
    -)

    [4]

    Include (-
    ScriptOn:
    switch (lm_n) {
    1: id = (+LibMsg <transcript already on>+);
    2: id = (+LibMsg <start of transcript>+);
    3: id = (+LibMsg <transcript failed>+);
    }
    jump end_part;

    ScriptOff:
    switch (lm_n) {
    1: id = (+LibMsg <transcript already off>+);
    2: id = (+LibMsg <end of transcript>+);
    3: id = (+LibMsg <end transcript failed>+);
    }
    jump end_part;
    -)

    [5]

    Include (-
    NotifyOn:
    id = (+LibMsg <score notification turned on>+);
    jump end_part;

    NotifyOff:
    id = (+LibMsg <score notification turned off>+);
    jump end_part;

    Score:
    id = (+LibMsg <Score command>+);
    jump end_part;

    FullScore:
    switch (lm_n) {
    1: id = (+LibMsg <Full Score initial text>+);
    2: id = (+LibMsg <Full Score items>+);
    3: id = (+LibMsg <Full Score places>+);
    4: id = (+LibMsg <Full Score total>+);
    }
    jump end_part;
    -)

    [6]

    Include (-
    Order:
    id = (+LibMsg <person ignores command>+);
    jump end_part;
    -)

    [7]

    Include (-
    Pronouns:
    switch (lm_n) {
    1: id = (+LibMsg <Pronouns initial text>+);
    2: id = (+LibMsg <Pronouns -means- text>+);
    3: id = (+LibMsg <Pronouns -unset- text>+);
    4: id = (+LibMsg <no pronouns known>+);
    }
    jump end_part;

    Places:
    id = (+LibMsg <Places initial text>+);
    jump end_part;

    Objects:
    if (lm_n == 1) { id = (+LibMsg <Objects initial text>+); }
    ! 2: "None.";
    ! 3: print " (worn)";
    ! 4: print " (held)";
    ! 5: print " (given away)";
    ! 6: print " (in ", (name) x1, ")";
    ! 7: print " (in ", (the) x1, ")";
    ! 8: print " (inside ", (the) x1, ")";
    ! 9: print " (on ", (the) x1, ")";
    ! 10: print " (lost)";
    ! (there are others as well)
    jump end_part;

    Inv:
    switch (lm_n) {
    1: id = (+LibMsg <Inventory no possessions>+);
    2: id = (+LibMsg <Inventory initial text>+);
    }
    jump end_part;
    -)

    [8]

    Include (-
    Take:
    switch (lm_n) {
    ! 1 is for the report taken rule, which will be called instead
    2: id = (+LibMsg <cannot take yourself>+);
    3: id = (+LibMsg <cannot take other people>+);
    4: id = (+LibMsg <cannot take something you are within>+);
    5: id = (+LibMsg <cannot take something already taken>+);
    6: id = (+LibMsg <cannot take possessions of others>+);
    7: id = (+LibMsg <cannot take component parts>+);
    8: id = (+LibMsg <cannot take hidden parts>+);
    9: id = (+LibMsg <cannot reach within closed containers>+);
    10: id = (+LibMsg <cannot take scenery>+);
    11: id = (+LibMsg <cannot take something fixed>+);
    12: id = (+LibMsg <cannot exceed carrying capacity>+);
    13: id = (+LibMsg <use holdall to avoid exceeding carrying capacity>+);
    isImplicitAction = 1;
    14: id = (+LibMsg <cannot reach within other places>+);
    }
    jump end_part;

    Remove:
    switch (lm_n)
    { 1: id = (+LibMsg <cannot remove from closed containers>+);
    2: id = (+LibMsg <cannot remove something not within>+);
    ! 3 is for the report removing rule, which will be called instead
    }
    jump end_part;
    -)

    [9]

    Include (-
    Drop:
    switch (lm_n) {
    1: id = (+LibMsg <cannot drop something already dropped>+);
    2: id = (+LibMsg <cannot drop not holding>+);
    3: id = (+LibMsg <cannot drop clothes being worn>+);
    isImplicitAction = 1;
    ! 4 is for the report dropping rule, which will be called instead
    }
    jump end_part;

    Insert:
    switch (lm_n) {
    1: id = (+LibMsg <cannot insert something not held>+);
    2: id = (+LibMsg <cannot insert into something not a container>+);
    3: id = (+LibMsg <cannot insert into closed containers>+);
    4: id = (+LibMsg <need to take off before inserting>+); ! (unused ?)
    5: id = (+LibMsg <cannot insert something into itself>+);
    6: id = (+LibMsg <cannot insert clothes being worn>+);
    isImplicitAction = 1;
    7: id = (+LibMsg <cannot insert if this exceeds carrying capacity>+);
    ! 8-9 are for the custom report inserting rule, which will be called instead
    }
    jump end_part;

    PutOn:
    switch (lm_n) {
    1: id = (+LibMsg <cannot put something not held>+);
    2: id = (+LibMsg <cannot put something on itself>+);
    3: id = (+LibMsg <cannot put onto something not a supporter>+);
    4: id = (+LibMsg <cannot put onto something being carried>+);
    5: id = (+LibMsg <cannot put clothes being worn>+);
    isImplicitAction = 1;
    6: id = (+LibMsg <cannot put if this exceeds carrying capacity>+);
    ! 7-8 are for the custom report putting on rule, which will be called instead
    }
    jump end_part;
    -)

    [10]

    Include (-
    EmptyT:
    switch (lm_n) {
    1: id = (+LibMsg <need to empty into a container>+);
    2: id = (+LibMsg <need to empty into something open>+);
    3: id = (+LibMsg <already empty>+);
    4: id = (+LibMsg <empty something into itself>+);
    }
    jump end_part;
    -)

    [11]

    Include (-
    Give:
    switch (lm_n) {
    1: id = (+LibMsg <cannot give what you have not got>+);
    2: id = (+LibMsg <cannot give to yourself>+);
    3: id = (+LibMsg <block giving>+);
    4: id = (+LibMsg <unable to receive things>+);
    }
    jump end_part;

    Show:
    switch (lm_n) {
    1: id = (+LibMsg <cannot show what you have not got>+);
    2: id = (+LibMsg <block showing>+);
    }
    jump end_part;
    -)

    [12]

    Include (-
    Enter:
    switch (lm_n) {
    1: id = (+LibMsg <cannot enter something already entered>+);
    2: id = (+LibMsg <cannot enter something not enterable>+);
    3: id = (+LibMsg <cannot enter closed containers>+);
    4: id = (+LibMsg <cannot enter something carried>+);
    ! 5 is for the report entering rule, which will be called instead
    6: id = (+LibMsg <implicitly pass outwards through other barriers>+);
    isImplicitAction = 1;
    7: id = (+LibMsg <implicitly pass inwards through other barriers>+);
    isImplicitAction = 1;
    }
    jump end_part;

    Exit:
    switch (lm_n) {
    1: id = (+LibMsg <cannot exit when not within anything>+);
    2: id = (+LibMsg <cannot exit closed containers>+);
    ! 3 is for the report exiting rule, which will be called instead
    }
    jump end_part;

    GetOff:
    id = (+LibMsg <cannot get off things>+);
    jump end_part;
    -)

    [13]

    Include (-
    Go:
    switch (lm_n) {
    1: id = (+LibMsg <cannot travel in something not a vehicle>+);
    2: id = (+LibMsg <cannot go that way>+);
    (+main object+) = noun; ! the direction
    3: id = (+LibMsg <cannot go up through closed doors>+);
    4: id = (+LibMsg <cannot go down through closed doors>+);
    5: id = (+LibMsg <cannot go through closed doors>+);
    6: id = (+LibMsg <nothing through door>+);
    }
    jump end_part;

    ! VagueGo: (the block vaguely going rule will be called instead)
    -)

    [14]

    Include (-
    LMode1:
    id = (+LibMsg <brief look mode>+);
    jump end_part;

    LMode2:
    id = (+LibMsg <verbose look mode>+);
    jump end_part;

    LMode3:
    id = (+LibMsg <superbrief look mode>+);
    jump end_part;
    -)

    [15]

    Include (-
    Look:
    switch (lm_n) {
    1: id = (+LibMsg <top line what on>+);
    2: id = (+LibMsg <top line what in>+);
    3: id = (+LibMsg <top line what as>+);
    4: id = (+LibMsg <say things on>+);
    5: id = (+LibMsg <say things also within>+);
    6: id = (+LibMsg <say things within>+);
    8: if (lm_o has supporter) id = (+LibMsg <top line what on>+);
    else id = (+LibMsg <top line what in>+);
    }
    jump end_part;
    -)

    [16]

    Include (-
    Examine:
    switch (lm_n) {
    1: id = (+LibMsg <examine while dark>+);
    2: id = (+LibMsg <examine undescribed things>+);
    3: id = (+LibMsg <examine devices>+);
    }
    jump end_part;

    Search:
    switch (lm_n) {
    1: id = (+LibMsg <search while dark>+);
    2: id = (+LibMsg <nothing found on top of>+);
    ! 3 prints what is on a supporter; use I6 default behaviour
    4: id = (+LibMsg <cannot search unless container-supporter>+);
    5: id = (+LibMsg <cannot search closed opaque containers>+);
    6: id = (+LibMsg <nothing found within container>+);
    ! 7 prints the contents of a container; use I6 default behaviour
    }
    jump end_part;

    LookUnder:
    switch (lm_n) {
    1: id = (+LibMsg <look under while dark>+);
    2: id = (+LibMsg <look under>+);
    }
    jump end_part;
    -)

    [17]

    Include (-
    Open:
    switch (lm_n) {
    1: id = (+LibMsg <cannot open unless openable>+);
    2: id = (+LibMsg <cannot open something locked>+);
    3: id = (+LibMsg <cannot open something already open>+);
    4: id = -2; ! reveal any newly visible exterior
    ! 5 is for the report opening rule, which will be called instead
    }
    jump end_part;

    Close:
    switch (lm_n) {
    1: id = (+LibMsg <cannot close unless openable>+);
    2: id = (+LibMsg <cannot close something already closed>+);
    ! 3 is for the report closing rule, which will be called instead
    }
    jump end_part;

    Lock:
    switch (lm_n) {
    1: id = (+LibMsg <cannot lock without a lock>+);
    2: id = (+LibMsg <cannot lock something already locked>+);
    3: id = (+LibMsg <cannot lock something open>+);
    4: id = (+LibMsg <cannot lock without the correct key>+);
    ! 5 is for the report locking rule, which will be called instead
    }
    jump end_part;

    Unlock:
    switch (lm_n) {
    1: id = (+LibMsg <cannot unlock without a lock>+);
    2: id = (+LibMsg <cannot unlock something already unlocked>+);
    3: id = (+LibMsg <cannot unlock without the correct key>+);
    ! 4 is for the report unlocking rule, which will be called instead
    }
    jump end_part;
    -)

    [18]

    Include (-
    SwitchOn:
    switch (lm_n) {
    1: id = (+LibMsg <cannot switch on unless switchable>+);
    2: id = (+LibMsg <cannot switch on something already on>+);
    ! 3 is for the report switching on rule, which will be called instead
    }
    jump end_part;

    SwitchOff:
    switch (lm_n) {
    1: id = (+LibMsg <cannot switch off unless switchable>+);
    2: id = (+LibMsg <cannot switch off something already off>+);
    ! 3 is for the report switching off rule, which will be called instead
    }
    jump end_part;
    -)

    [19]

    Include (-
    Wear:
    switch (lm_n) {
    1: id = (+LibMsg <cannot wear something not clothing>+);
    2: id = (+LibMsg <cannot wear not holding>+);
    3: id = (+LibMsg <cannot wear something already worn>+);
    ! 4 is for the report wearing rule, which will be called instead
    }
    jump end_part;

    Disrobe:
    switch (lm_n) {
    1: id = (+LibMsg <cannot take off something not worn>+);
    ! 2 is for the report taking off rule, which will be called instead
    }
    jump end_part;
    -)

    [20]

    Include (-
    Eat:
    switch (lm_n) {
    1: id = (+LibMsg <cannot eat unless edible>+);
    ! 2 is for the report eating rule, which will be called instead
    }
    jump end_part;
    Drink:
    id = (+LibMsg <block drinking>+);
    jump end_part;
    Taste:
    id = (+LibMsg <block tasting>+);
    jump end_part;
    Smell:
    id = (+LibMsg <block smelling>+);
    jump end_part;
    Listen:
    id = (+LibMsg <block listening>+);
    jump end_part;

    !Touch: all cases are handled by "report" rules
    -)

    [21]

    Include (-
    Yes:
    id = (+LibMsg <block saying yes>+);
    jump end_part;
    No:
    id = (+LibMsg <block saying no>+);
    jump end_part;
    Sorry:
    id = (+LibMsg <block saying sorry>+);
    jump end_part;
    Strong:
    id = (+LibMsg <block swearing obscenely>+);
    jump end_part;
    Mild:
    id = (+LibMsg <block swearing mildly>+);
    jump end_part;
    -)

    [22]

    Include (-
    Climb:
    id = (+LibMsg <block climbing>+);
    jump end_part;
    Jump:
    id = (+LibMsg <block jumping>+);
    jump end_part;
    JumpOver:
    id = (+LibMsg <block jumping over>+);
    jump end_part;
    Swim:
    id = (+LibMsg <block swimming>+);
    jump end_part;
    Swing:
    id = (+LibMsg <block swinging>+);
    jump end_part;
    WaveHands:
    id = (+LibMsg <block waving hands>+);
    jump end_part;
    -)

    [23]

    Include (-
    Attack:
    id = (+LibMsg <block attacking>+);
    jump end_part;
    Blow:
    id = (+LibMsg <block blowing>+);
    jump end_part;
    Burn:
    id = (+LibMsg <block burning>+);
    jump end_part;
    Cut:
    id = (+LibMsg <block cutting>+);
    jump end_part;
    Dig:
    id = (+LibMsg <block digging>+);
    jump end_part;
    Fill:
    id = (+LibMsg <block filling>+);
    jump end_part;
    Rub:
    id = (+LibMsg <block rubbing>+);
    jump end_part;
    Set:
    id = (+LibMsg <block set>+);
    jump end_part;
    SetTo:
    id = (+LibMsg <block setting to>+);
    jump end_part;
    Tie:
    id = (+LibMsg <block tying>+);
    jump end_part;

    Wave:
    switch (lm_n) {
    1: id = (+LibMsg <cannot wave something not held>+);
    ! 2 is for the report waving things rule, which will be called instead
    }
    jump end_part;

    Squeeze:
    switch (lm_n) {
    1: id = (+LibMsg <squeezing people>+);
    ! 2: is for the report squeezing rule, which will be called instead
    }
    jump end_part;

    ThrowAt:
    switch (lm_n) {
    1: id = (+LibMsg <throw at inanimate object>+);
    2: id = (+LibMsg <block throwing at>+);
    }
    jump end_part;
    -)

    [24]

    Include (-
    Push:
    switch (lm_n) {
    1: id = (+LibMsg <cannot push something fixed in place>+);
    2: id = (+LibMsg <cannot push scenery>+);
    ! 3: is for the report pushing rule, which will be called instead
    4: id = (+LibMsg <cannot push people>+);
    }
    jump end_part;

    PushDir:
    switch (lm_n) {
    1: id = (+LibMsg <block pushing in directions>+);
    2: id = (+LibMsg <not pushed in a direction>+);
    3: id = (+LibMsg <pushed in illegal direction>+);
    }
    jump end_part;

    Pull:
    switch (lm_n) {
    1: id = (+LibMsg <cannot pull something fixed in place>+);
    2: id = (+LibMsg <cannot pull scenery>+);
    ! 3 is for the report pulling rule, which will be called instead
    4: id = (+LibMsg <cannot pull people>+);
    }
    jump end_part;

    Turn:
    switch (lm_n) {
    1: id = (+LibMsg <cannot turn something fixed in place>+);
    2: id = (+LibMsg <cannot turn scenery>+);
    ! 3 is for the report turning rule, which will be called instead
    4: id = (+LibMsg <cannot turn people>+);
    }
    jump end_part;
    -)

    [25]

    Include (-
    Answer:
    id = (+LibMsg <block answering>+);
    jump end_part;
    Ask:
    id = (+LibMsg <block asking>+);
    jump end_part;
    Buy:
    id = (+LibMsg <block buying>+);
    jump end_part;
    Kiss:
    id = (+LibMsg <block kissing>+);
    jump end_part;
    Pray:
    id = (+LibMsg <block praying>+);
    jump end_part;
    Sing:
    id = (+LibMsg <block singing>+);
    jump end_part;
    Tell:
    switch (lm_n) {
    1: id = (+LibMsg <telling yourself>+);
    2: id = (+LibMsg <block telling>+);
    }
    jump end_part;
    -)

    [26]

    Include (-
    Think:
    id = (+LibMsg <block thinking>+);
    jump end_part;

    ! Consult: (the block consulting rule will be called instead)
    -)

    [27]

    Include (-
    Sleep:
    id = (+LibMsg <block sleeping>+);
    jump end_part;

    ! Wait: (the report waiting rule will be called instead)

    Wake:
    id = (+LibMsg <block waking up>+);
    jump end_part;

    WakeOther:
    id = (+LibMsg <block waking other>+);
    jump end_part;
    -)

    Include (-
    default:
    .end_part;
    if (id == -1) { rfalse; }

    if (id == -2) {
    if (WriteListFrom(child(lm_o), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT) == 0) {
             id = (+LibMsg <fake newly visible exterior> +);
        } else {
             id = (+LibMsg <fake newly visible exterior nothing> +);
        }
    }


    (+message-game-error+) = id;
    (+I6 returns rule+)();
         return (+cull inform default messages+);
    ];
    -)