intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Feb 18, 2018 9:18 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Jun 21, 2011 2:59 pm 
Offline
User avatar

Joined: Sat Feb 19, 2011 9:27 am
Posts: 67
Quote:
The Reading Room is a room. "The Reading Room is not dark. As a mater of fact, the lights are always on in this room and it has been rumored that the room was once used by a now defunct religious sect that never turned the lights off. You can see several oak shelves and pamplets here".

The shelving is a supporter. The shelving is fixed in place. The shelving is in the Reading Room.

The First Pamphlet is a thing. The first pamphlet is in the Reading Room. The description of the first Pamphlet is "How to play an Inform game.[line break]As you have found out just by getting here, Inforcom games are all text games and are played by entering a few words or numbers in response to a question or a 'prompt'.[line break]You will find almost no graphics in this game but you will find long passages that require intense reasoning.".

The Second Pamphlet is a thing. The second pamphlet is in the Reading Room. The description of the Second Pamphlet is "A guide to entering directions.[line break]There are 12 possible directions that can be entered. Not every move you make can use all or even two or more of these directions (as a mater of fact, most of the moves are designed to limit the number of moves you can make).The moves are [line break]north or n[line break]south or s[line break]east or e[line break]west or w[line break]northeast or ne[line break]southeast or se[line break]northwest or nw[line break]southwest or sw[line break]up or u[line break]down or d[line break]in side or in[line break]out side or out[line break]Usually, to reverse your travel, all you have to do is type the opposite direction. However, you will find times when the opposite direction is some other direction entirely or no direction at all. It is possible for a player to head into a 'room' that can not be exited!.[line break]Good luck, sucker!".

The Third Pamphlet is a thing. The Third Pamphlet is in the Reading Room. The description of the Third Pamphlet is "What to expect.[line break]The game (How Did I Get Here?) is structured in several phases or steps. The first three steps start simple and then get progressively more difficult. From that point on, the going really gets tough![line break]There is NO help file. You are on own.[line break]This much we will say. At the completion or someplace during each adventure you will find a treasure. What you do with this treasure will, of course, determine the outcome of the game.".

The fourth pamphlet is a thing. The fourth Pamphlet is in the Reading Room. The description of the Fourth Pamphlet is "I know the wording was a bit difficult, but if you still can't understand it, maybe you should ask somebody that graduated fourth grade.".

understand "Pamphlet 1" as First Pamphlet.
understand "Pamphlet 2" as Second Pamphlet.
understand "Pamphlet 3" as Third Pamphlet.
understand "Pamphlet 4" as Fourth Pamphlet.


This gives the following line:
ADVENTURE HERE>: x pamphlet
What do you want to examine: the 1) Third Pamphlet, the 2) First Pamphlet, the 3) Second Pamphlet, or the 4) fourth pamphlet?

Note that the order of the selections is not correct. How can I fix this? or is it not my problem?

Greg


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 6:51 pm 
Offline

Joined: Sun Mar 01, 2009 8:02 pm
Posts: 1617
I get the same output that you do. Interestingly, if you don't include the extension, the standard "which do you mean" output from Inform shows the pamphlets in the expected order. This is a strong hint that somehow the extension's code is juggling the items around in the process of listing them.

Beyond that ... dunno.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 7:37 pm 
Offline
User avatar

Joined: Wed Sep 01, 2010 1:50 am
Posts: 1369
Location: Sydney, Australia
Until there's a fix, just say that your game is railing against the tyranny of numerical order. No privileged number ones for you.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 8:18 pm 
Offline

Joined: Thu Oct 22, 2009 4:31 pm
Posts: 1301
It's actually internal Inform code doing this, though I don't have any real idea why. The line that causes it is this one, from Numbered Disambiguation Choices:

Understand the disambiguation id property as describing a thing.

If you want to see that this is so, add the following to the posted example code, and don't include Numbered Disambiguation Choices:

Code:
Every thing has a number called disambiguation id.  
Understand the disambiguation id property as describing a thing.


Somehow, this causes Inform to rearrange the internal order by which it iterates through these objects during parsing routines, at least in this particular case. It doesn't matter what the disambiguation id of the objects is--the simple existence of the understand line is enough to cause the change. I have no idea whether this should be considered a bug or not. Does Inform guarantee that objects will be printed in any certain order?

--Erik


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 8:53 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5213
Location: Burlington, VT
I sort of think it might be possible to work around this by assigning things a numbered property and sorting the list of disambiguation choices in order of that property; but in order to do that we have to silence everything that gets printed while asking which do you mean, collect it into a list, sort that list, and then print the names on the disambiguation list with their numbers. I've figured out how to suppress printing the names of the disambiguees, and I think I know at what step of the process you should sort and print the list; but that still leaves this abomination:

Code:
Which do you mean, the , the , the  or the ?


So I'd need to suppress the articles and the punctuation. My most optimistic idea is that it might be possible to do this with Custom Library Messages; anyone who knows how, halp!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 9:37 pm 
Offline

Joined: Thu Oct 22, 2009 4:31 pm
Posts: 1301
I suspect that that would require hacking the library. But if you're just looking to do a proof of concept, you could use Text Capture to write the abomination to a buffer and then just throw it away. You can then rewrite the whole thing yourself at the appropriate time.

By the way, it isn't necessary to have a property to store the numerical ordering. You can use a decide phrase to grab the I6 object number, which will reflect the creation order:

Code:
To decide which number is the object number of (O - an object): (- {O} -)


--Erik


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 9:40 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5213
Location: Burlington, VT
ektemple wrote:
I suspect that that would require hacking the library. But if you're just looking to do a proof of concept, you could use Text Capture to write the abomination to a buffer and then just throw it away. You can then rewrite the whole thing yourself at the appropriate time.


Suddenly I feel motivated to start doing my actual work instead. (Seriously, thanks for the suggestion; I'll look into it sometime.)

Quote:
By the way, it isn't necessary to have a property to store the numerical ordering. You can use a decide phrase to grab the I6 object number, which will reflect the creation order:

Code:
To decide which number is the object number of (O - an object): (- {O} -)


--Erik


Well, I figure it'd be nice to let the author set it instead of relying on source text ordering; they could even dynamically reset it, if they wanted to.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 21, 2011 9:54 pm 
Offline

Joined: Wed Oct 27, 2010 6:15 pm
Posts: 344
Because of the code that Erik identified, Inform calls DECIMAL_TOKEN to check for a number that describes the pamphlet. DECIMAL_TOKEN in turn calls ParseTokenStopped and therefore ParseToken in which the match list (currently being built) has to be saved and restored. But the save and restore are in reversed order, so the match list is flipped before each new match is added. Hence, you get the list built up as [ First ], then [ First, Second ], and [ Second, First, Third ], and finally [ Third, First, Second, Fourth ]. Whether that's a bug I don't know, but I would encourage you to report it.

In the meantime, you could workaround the problem by patching up ParseToken, or more hackily by adding another reversal with code like
Code:
Every thing has a number called hack.  The hack of a thing is always -1.  Understand the hack property as describing a thing.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jun 22, 2011 8:02 am 
Offline
User avatar

Joined: Sat Feb 19, 2011 9:27 am
Posts: 67
M..... It looks like I'm doomed to spend my life trying to sort out things that don't matter. Just think, what if I get this order in order then add a few more pamphlets. After all, we zealots must just keep adding to the knowledge of you lesser beings! :lol:


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group