"Pseudo-objects" "This provides a way to populate games with scenery without creating separate objects for each noun mentioned in a room description. When the parser can't find a match for an OBJSPEC, it checks the location's THINGS property, which (if present) defines a set of pseudo-objects, each with a list of adjectives, a list of nouns, and an action routine. If one of them matches, the singleton PSEUDO-OBJECT is returned, after setting its ACTION property to the routine and setting the global PSEUDO-LOC to the location. The format of the THINGS property is: .PROP 2,P?THINGS .WORD T?THINGS-TABLE T?THINGS-TABLE:: .WORD 1 ; Number of pseudo-objects .BYTE 1 ; Number of adjectives .BYTE 2 ; Number of nouns .WORD A?GINGERBREAD ; Adjective (stored directly since # adjectives = 1, ; otherwise this would point to a byte/word table) .WORD T?GINGERBREAD-HOUSE-NOUNS ; Noun table (since # adjectives > 1) .WORD GINGERBREAD-HOUSE-F ; Action routine T?GINGERBREAD-HOUSE-NOUNS:: .WORD W?HOUSE .WORD W?MANSION The property definition syntax is implemented by THINGS-PROPSPEC below." "Constants and macros to access pseudo entries" > > > > > ;"Like REFERS? but for pseudo entries. Args: SPEC: An OBJSPEC. PDO: A pseudo entry. Returns: A quality score from 0 to 3 indicating how well the OBJSPEC matches the pseudo." ) (N )) > > > > > )>) (.N ) (>) (ELSE >)> )>)>) (.A )>)> > <=? .A .AT>> > >>> <=? .N .NT>> > >>> ;"Tries to match an OBJSPEC against any of the pseudo entries in a THINGS property. Args: SPEC: The OBJSPEC. PT: The property table for the THINGS property. Returns: The address of the pseudo entry, or false if none matched." > > ) ( )> >>> ;"Initializes PSEUDO-OBJECT from a pseudo entry and returns it." > ,PSEUDO-OBJECT> > > )> > > > > ) (.NA > )> >>)> ) (.NN > )> >>)> >>>> > ) (FLAGS NARTICLEBIT)> > 3>>> )> 3>> )> > > > > > ) (ELSE >)>)> > ) (ELSE >)>)> 0) ( 1) (ELSE )>> 0) ( 1) (ELSE )>> ;"Adjectives" ADJ> >>>
) (ELSE ADJ>)>> .A>)) ) (ELSE )>>) ( >>)) ADJ> >) (ELSE ADJ>)>) (ELSE .A)> ;"Nouns" OBJECT>> .N>) ( OBJECT>) (ELSE .N)> ;"Action routine or text" <==? 2> VECTOR> STRING>>> ;"Create a simple action routine that responds to the verbs" > >)> > >>> >>>> .NAME>) ( .F) (ELSE )>>>>> (<> )>