Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000409Core InformActivitiespublic2010-11-12 22:482014-05-07 07:33
ReporterRon Newcomb 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
PlatformPPCOSMac OS XOS Version10.4
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000409: the you-can-also-see rule incorrectly calls activity and has unreplaceable text
DescriptionIn the code below, the you-can-also-see rule (in the For Printing A Locale Description rulebook) will run the Before Listing Nondescript Items activity, but won't run the After Listing Nondescript Items activity. The docs say, in "17.3. Rules applied to activities", "[...]because (unlike an action) an activity always finishes, so there is no question of not reaching its 'after' stage."

I also supplied a fix which corrects this, and allows the hard-coded prose in the rule to be replaced with "issue library message.." phrases. (#5 and #6 originally comprised the you-can-also-see rule in its entirety, until, I'm guessing, an edge case about recursing into nondescript containers which contained described/mentioned items caused problems, so the handling was rewritten in Inform 7 rather than the usual Inform 6 LanguageLM() call.)
Minimal Source Text To Reproduce
"after listing nondescript items bug"

The Fountain near the Space Needle is a room.  "Scores of vendors line the walkways, and a few hundred 
attendees wander about."

Several people frolicking in the water are here. "Many soaking-wet people frolic in the spray."  


A rainbow-colored lei is here. 
 
Before listing nondescript items, say "The walk-in fountain spews all manner of convention leftovers 
skyward:  plastic pennants, styrofoam cups, etc.  [run paragraph on]"

After listing nondescript items, say "You might be able to grab something if you're quick."


Test me with "look / take lei / look".
Additional InformationThe rule itself
------------------------------
For printing the locale description (this is the you-can-also-see rule):
now everything is unmarked for listing;
repeat through the Table of Locale Priorities:
[say "[notable-object entry] - [locale description priority entry].";]
if the locale description priority entry is at least one and the notable-object entry is not [already] mentioned, now the notable-object entry is marked for listing;
if something is marked for listing:
let the domain be the parameter-object;
begin the listing nondescript items activity with the domain;
if handling the listing nondescript items activity:
issue library message looking action number 5 for the domain;
let the common holder be nothing;
let contents form of list be true;
repeat with list item running through marked for listing things:
if the holder of the list item is not the common holder:
if the common holder is nothing, now the common holder is the holder of the list item;
otherwise now contents form of list is false;
if the list item is mentioned, now the list item is unmarked for listing;
filter list recursion to unmentioned things;
if contents form of list is true and the common holder is not nothing,
list the contents of the common holder, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, listing marked items only;
otherwise say a list of marked for listing things including contents;
unfilter list recursion;
issue library message looking action number 6 for the domain;
now the domain is the parameter-object; [ just in case someone assigned to it in a Before or For rule ]
end the listing nondescript items activity with the domain;
continue the activity.
-------------

And replace cases 5 and 6 of ##LOOK in LanguageLM()...
-----------------

5,6:
     if (x1 ~= location) {
          if (x1 has supporter) print "On "; else print "In ";
          print (the) x1, " you";
     }
     else print "You";
     print " can ";
     if (n == 5) print "also ";
     print "see ";
     WriteListFrom(child(x1),
     ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+WORKFLAG_BIT);
     if (x1 ~= location) "."; else " here.";
----------------------

..with the I6 equivalent of these (5 and 6 now being very different)....
-------------------------

To issue library message (act - the looking action) number (n - 5) for (x1 - an object):
say "[if x1 is the location]You [otherwise if x1 is a room]In [x1] you [otherwise if x1 is a supporter]On [x1] you [otherwise if x1 is an animal]On [x1] you [otherwise]In [x1] you [end if]can [if the locale paragraph count > 0]also [end if]see "

To issue library message (act - the looking action) number (n - 6) for (x1 - an object):
say "[if x1 is not the location].[otherwise] here.[end if]"

-----------

The I7 rule still prints the actual list. The messages just hold the "In [location] you can also see" and "here." wrappers.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0000811)
Ron Newcomb (reporter)
2010-11-12 22:58

Lovely. Mantis dislikes tabs.
Once more, with feeling:

For printing the locale description (this is the you-can-also-see rule):
TAB now everything is unmarked for listing;
TAB repeat through the Table of Locale Priorities:
TAB TAB [say "[notable-object entry] - [locale description priority entry].";]
TAB TAB if the locale description priority entry is at least one and the notable-object entry is not [already] mentioned, now the notable-object entry is marked for listing;
TAB if something is marked for listing:
TAB TAB let the domain be the parameter-object;
TAB TAB begin the listing nondescript items activity with the domain;
TAB TAB if handling the listing nondescript items activity:
TAB TAB TAB issue library message looking action number 5 for the domain;
TAB TAB TAB let the common holder be nothing;
TAB TAB TAB let contents form of list be true;
TAB TAB TAB repeat with list item running through marked for listing things:
TAB TAB TAB TAB if the holder of the list item is not the common holder:
TAB TAB TAB TAB TAB if the common holder is nothing, now the common holder is the holder of the list item;
TAB TAB TAB TAB TAB otherwise now contents form of list is false;
TAB TAB TAB TAB if the list item is mentioned, now the list item is unmarked for listing;
TAB TAB TAB filter list recursion to unmentioned things;
TAB TAB TAB if contents form of list is true and the common holder is not nothing,
TAB TAB TAB TAB list the contents of the common holder, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, listing marked items only;
TAB TAB TAB otherwise say a list of marked for listing things including contents;
TAB TAB TAB unfilter list recursion;
TAB TAB TAB issue library message looking action number 6 for the domain;
TAB TAB now the domain is the parameter-object; [ just in case someone assigned to it in a Before or For rule ]
TAB TAB end the listing nondescript items activity with the domain;
TAB continue the activity.
(0000812)
Ron Newcomb (reporter)
2010-11-12 23:04

Oh, I guess the I6 would just be this simple change, yes?


5:
     if (x1 ~= location) {
          if (x1 has supporter) print "On "; else print "In ";
          print (the) x1, " you";
     }
     else print "You";
     print " can ";
     if ((+ locale paragraph count +) > 0) print "also ";
     print "see ";

6:
     if (x1 ~= location) "."; else " here.";
(0002239)
EmacsUser (manager)
2014-01-02 16:37

Revisiting this one, the part about library messages looks fine, but the change in when and whether the activity is begun breaks Example A in WI 17.23, as well as similar rules. Perhaps it would be better to end the activity normally, but give the after rules a documented way to decide whether any text was printed?
(0002249)
ChrisC (reporter)
2014-01-04 21:16
edited on: 2014-01-04 21:18

For future reference, Ron, this system allows certain html tags, including < pre>.
See also 0000259

(0002374)
graham (administrator)
2014-01-25 15:07

The implementation is different now, but this remains the rare case in which the Standard Rules abandon an activity. The documentation now makes this clear, which I think is the best solution.

- Issue History
Date Modified Username Field Change
2010-11-12 22:48 Ron Newcomb New Issue
2010-11-12 22:58 Ron Newcomb Note Added: 0000811
2010-11-12 23:04 Ron Newcomb Note Added: 0000812
2010-11-12 23:44 jmcgrew Status new => acknowledged
2010-11-13 07:26 EmacsUser Status acknowledged => confirmed
2014-01-02 16:37 EmacsUser Note Added: 0002239
2014-01-04 21:16 ChrisC Note Added: 0002249
2014-01-04 21:18 ChrisC Note Edited: 0002249 View Revisions
2014-01-04 21:18 ChrisC Note Edited: 0002249 View Revisions
2014-01-25 15:07 graham Note Added: 0002374
2014-01-25 15:07 graham Status confirmed => resolved
2014-01-25 15:07 graham Resolution open => fixed
2014-01-25 15:07 graham Assigned To => graham
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker