Auto-grouping

Alex
29 Nov 2009, 17:49
ender wrote:


having come from Inform 7 it seems strange to have objects not auto group ... i.e. I have a room with 3 candles in it ... I'd like to write a custom room description where the object list says something like ... 'a black box, 3 candles, and a jar of batwings' ... I could do this with having a single object called '3 candles' or simply 'candles' with the prefix 3 ... maybe done using a property ... but the player needs to be able to take the candles and use them one by one ...



How does Inform handle the auto-grouping? I've been thinking about how to achieve this in Quest 5.0.

Freak
29 Nov 2009, 19:40
To determine whether two objects are indistinguishable by vocab
- If one is lit and the other is not, they are distinguishable.
- If one is open and the other is not, they are distinguishable.
- If they have non-matching parse_name routines, they are distinguishable.
- If they have equal, non-null parse_name routines, then that routine is asked whether the two objects are indistinguishable.
-- It may reply "yes", "no", or "defer".
-- If it replies "yes" or "no", that is taken as the final answer.
- If parse_name replies "defer", or both have null parse_names, then it checks their 'name' properties.
-- If every word in the name property of the first object appears in the name property of the second, and vice versa
--- the objects are ruled indistinguishable.
-- Otherwise, they are ruled distinguishable.

To determine whether two objects should be grouped as plurals:
- they must be indistinguishable by vocab
- they must have identical, non-null values for the plural property.

There's other related stuff, such as the list_together property. Inform has a pretty powerful list writer; all the related functions come to about 500 lines of Inform source.