Default Messages

version 12/091223 by David Fisher

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 3 - Implementation

    [ perform a binary search to quickly find the message id in the
    table of library messages (assumes the table has been sorted) ]

    This is the print library message rule:
    let n1 be 1;
    let n2 be the number of rows in the table of library messages;
    change libmsg_printed to 0;
    while n1 <= n2 begin;
    let mid be n1 plus n2;
         change mid to mid divided by 2;
         choose row mid in the table of library messages;
         if the message id entry is library-message-id begin;
         if the message text entry is not "~" begin;
    if library message debug is dbg_on,
    say "{[library-message-id] - custom}[line break]";
         say the message text entry;
         change libmsg_printed to 1;
    otherwise;
    if library message debug is dbg_on,
    say "{[library-message-id]}[line break]";
         end if;
         change n1 to n2 + 1; [ to force the loop to stop ]
         end if;
         if the message id entry < library-message-id, change n1 to mid plus 1;
    if the message id entry > library-message-id, change n2 to mid minus 1;
    end while.

    libmsg_printed is a number that varies.
    The main object is an object that varies.
    The secondary object is an object that varies.

    To decide whether noun is living:
    (- noun has animate -).

    To decide whether noun is doing the action:
    (- noun == actor -).

    To decide whether noun is not doing the action:
    (- noun ~= actor -).

    To decide whether player is doing the action:
    (- actor == player -).

    To decide whether player is not doing the action:
    (- actor ~= player -).

    [ Some conventient abbreviations to prevent spurious line breaks
    from occurring in some messages ]

    To say dot: say "/unicode 46/".
    To say ExMark: say "/unicode 33/".
    To say QMark: say "/unicode 63/".

    [ These two are equivalent to [bracket] and [close bracket], but have been
    retained for compatibility with old versions of Custom Library Messages ]
    To say LeftSqBr: say "/unicode 91/".
    To say RightSqBr: say "/unicode 93/".

    To say /n: say line break.
    To say /p: say paragraph break.
    To say /r: say run paragraph on.