Re: Long item-list fix

From: Anthony Spataro (ads@netcom.com)
Date: 06/23/95


Alright...here's what it would take to get pretty descriptions working:

Change the format of your objects so they have:
name ('@a@some@ @waybread@waybreads@')
grounddesc ('@# strange @piece@pieces@ of bread @lie@lies@ on the ground.')

Now...whenever the MUD displays either of these strings, it first passes 
them to a routine, say char *enpluralize(int num, char *src) with the 
number of the item being described, and the source grounddesc.  
enpluralize replaces the @# with a number, depending on the value of num, 
and goes through the rest of the string, pulling out the correct words 
from the compound @-sequences and putting them into its buffer.

So enpluralize(1,"@# strange @piece@pieces@ of bread @lies@lie@ here.");
would return "A strange piece of bread lies here."  
(Enpluralize would be smart enough to capitalize the A, since it's the first 
letter of the sentence.)

enpluralize(14,"@# strange @piece@pieces of bread @lies@lie@ here.");
would return "Fourteen strange pieces of bread lie here."

The same thing happens to name, so you could take "a waybread" or "some 
waybreads".

The advantages of using this method are that it doesn't require any major 
modification to either your MUD or your world files.  Sure, it takes a 
little bit of work, but very little, compared to adding whole new fields 
to the .obj files.

I may work on this later today or next week if I get some time.  If I 
manage to get it working, I'll send it to the list.

 _/\_   GU -d H s : g? p5 au- a17 w v- C UL P L 3- E---- N K- W--- M-- V-- po
/ L  \  Y t 5 j-- R G---- tv-- b D B--- e u*(**) h! f !r !n !y+   
\_ C_/  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  \/    HLT! OUT POLICE! MOV HEAD+1,HANDS. MOV SI,[MIRANDA]. REP OUTSB

If you live in a country run by committee, be on the committee.
		-- Graham Summer



This archive was generated by hypermail 2b30 : 12/18/00 PST