1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Adjective Server -->
<!--X-From-R13: Quevfgbcure Oyyra <tzsnatfNnfzeo.bet> -->
<!--X-Date: Thu, 14 Jan 1999 15:11:47 &#45;0800 -->
<!--X-Message-Id: 4.1.19990114150743.050fc100#mail,consensus.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Adjective Server</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:gmfangs#asmrb,org">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00176.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00178.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00209.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00174.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00177">Author</A>
&nbsp;|&nbsp;<A HREF="#00177">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00177">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Adjective Server</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Adjective Server </LI>
<LI><em>From</em>: Christopher Allen &lt;<A HREF="mailto:gmfangs#asmrb,org">gmfangs#asmrb,org</A>&gt;</LI>
<LI><em>Date</em>: Thu, 14 Jan 1999 15:10:22 -0800</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
There has been some discussion about how to make descriptions more varied
and relevant to play. One of my favorite methods in an LPMUD derived system
called DartMUD is the adjective server.

Basically the way the adjective server works is text within curly braces is
interpreted. The first word defines the adjective, the rest of the text to
the end brace is the data for the specific adjective.

Adjectives started off as a method to solve the problem of size with
different size characters, but since it was a generic mechanism it since
has been expanded to 40+ different adjectives. For instance, it can display
differently depending on the "detail_vision" attribute, or garble some text
based on how much skill you have in a language, or different for different
times of day, etc.

From the man files on dartmud.com:2525
&gt;parse_string(1) -- parses string with stat/skill info with adjective server
&gt;
&gt;string parse_string(string str,object player);
&gt;
&gt;Replaces str with a new string modified by calling the adjective server
&gt;which uses stats/skills of this_player().  player is optional, and if
&gt;supplied, this_player() will become player.  If str is 0, parse_string()
&gt;will also return 0.  Best described by examples:
&gt;
&gt;   str = parse_string("&amp;&amp; {size:100} sword.");
&gt;
&gt;might return
&gt;
&gt;   str == "An extremely large sword.";
&gt;
&gt;say if viewed by a gnome.  The function size() is called with arg 100 in
&gt;the /std/serv/adjective server and returns (in this case) "extremely large".
&gt;&amp; is converted to "a" or "an". (&amp;&amp; for capital letters)  Instead of calling
&gt;the adjective.c server, you can redirect to the current object by using
&gt;{*function:arg}, e.g.
&gt;   str = parse_string("&amp;&amp; {size:100} {*magic:50} dagger.");
&gt;
&gt;would call size(100) in /std/serv/adjective.c, and would call magic(50)
&gt;in this_object().  Finally, the object filename to call can be given,
&gt;e.g. {/usr/fermat/adjective:size:100} would call size(100) in the object
&gt;/usr/fermat/adjective.c.  If a string is to be returned "unparsed", then
&gt;a common convention for calling a function inside that object is to use
&gt;
&gt;   return "&amp;&amp; {/" + file_name() + ":size:100} dagger";
&gt;
&gt;Note also that to capitalize the return string, you need only capitalize
&gt;the first letter of the function name. e.g. {Size:100}.
&gt;NOTE: the filename has to start with a '/'!
&gt;
&gt;In addition to sending integer args, you can send string args as well.  If
&gt;the first letter is non-numeric, parse_string will assume it is a string,
&gt;also you can put strings inside "'s, example:
&gt;
&gt;   str = "{Personal:fermat} looks at the basket.\n";
&gt;would call personal("fermat") in the adjective server.
&gt;
&gt;Look at the file /std/serv/adjective.c for available functions, and
&gt;consult with a major creator if you want more added.
&gt;
&gt;There are some built-in things that parse_string() will recognize.  If a
&gt;{w} appears in the front, then the string will be sent through word_wrap(1).
&gt;A {u} in the front will indicate that the string should remain "unparsed".
&gt;
&gt;In addition, there is a special syntax for languages.  For example,
&gt;
&gt;   write("{w} The sign says '{L:gnomish:50:text}'\n");
&gt;
&gt;Everthing where the 'text' is will be put in gnomish, with "difficulty"
&gt;at 50. (old gnomish...hard to read)  The number will default to 100,
&gt;so just {L:gnomish:text} would suffice. 
&gt;
&gt;See also: adjective(7), adjectives(7), color(8), oneof(7),
&gt;language(7), timeline(7), and word_wrap(1).


From dartmud.com:2525
&gt;adjective(7) -- adjective server info
&gt;
&gt;The adjective server is called from parse_string(1), to insert stat/skill
&gt;varying adjectives into strings.  The following functions exist so far:
&gt;
&gt;size(n)     - large/small  \
&gt;height(n)   - high/low      \
&gt;length(n)   - long/short     }--- based on size
&gt;width(n)    - wide/thin     /
&gt;depth(n)    - deep/shallow /
&gt;speed(n)    - fast/slow based on agility
&gt;sound(n)    - loud/faint based on hearing
&gt;number(n)   - replaces integer n with numeral ("two", "fifteen", etc)
&gt;
&gt;All of which reside in the file /std/serv/adjective.c.  Size() thru
&gt;sound() each call a function describe(), which compares the size/agility/etc
&gt;of the viewer, with n.
&gt;
&gt;Here is an example of size(n) for a size 100 viewer and size 50 viewer.
&gt;                    size 100 viewer  size 50 viewer
&gt;   extremely small   21 and below      10 and below
&gt;   very very small   22 to  31         11 to 15
&gt;   very small        32 to  43         16 to 21
&gt;   small             44 to  62         22 to 31
&gt;   somewhat small    63 to  87         32 to 43
&gt;                     88 to 124         44 to 62
&gt;   somewhat large   125 to 174         63 to 87
&gt;   large            175 to 249         88 to 124
&gt;   very large       250 to 349        125 to 174
&gt;   very very large  350 to 499        175 to 249
&gt;   extremely large  500 and up        250 and up
&gt;
&gt;Basically it is broken up into categories, based on the premise that
&gt;doubling in size moves you down exactly two catagories.
&gt;
&gt;See also: adjectives(7), color(8), oneof(7), language(7),
&gt;parse_string(1), timeline(7), and word_wrap(1).


In particular I wrote two adjectives oneof() and timeline() which I found
tremendously powerful:

&gt;oneof(7) -- adjective for randomly selecting a phrase from list
&gt;
&gt;oneof() is an adjective in the adjective server "/std/serv/adjective.c" that
&gt;allows you to add variety to your descriptions by allowing you to have
&gt;having minor random differences each time your description is seen.
&gt;
&gt;Basically oneof() will randomly chose from phrases separated by vertical
&gt;bars "|" one phrase, with each phrase given equal weight.
&gt;
&gt;Example:
&gt;
&gt;parse_string("{w}{oneof:You are standing in a|This room is a} great "+
&gt;             "hall{oneof:full of|bustling with|jam packed with|crowded "+
&gt;             "with} all {oneof:sorts|kinds|types|creeds|races} of "+
&gt;             "{oneof:folk|people}.");
&gt;
&gt;This would generate one of 80 possible different descriptions.
&gt;
&gt;It is also possible to have null (blank) phrases, for example:
&gt;parse_string("{w}{oneof:|||test|||}");
&gt;
&gt;This will only only return the phrase "test" one time in 6.
&gt;
&gt;NOTE: It is not possible to have phrases that include colons or vertical
&gt;bars! This is because the parser uses that colons to break up arguements in
&gt;adjectives, and oneof() only accepts one arguement and parses the vertical
&gt;bars into separate phrases.
&gt;
&gt;NOTE: I haven't tested the upper bounds of how many "oneof" phrases you can
&gt;have -- from my reading of the docs I think the standard system array size
&gt;max for explode is the system max of 1000, so don't do more than 1000
&gt;choices, please ;-&gt;
&gt;
&gt;-- Nephilim
&gt;
&gt;See also: adjective(7), adjectives(7), timeline(7), and parse_string(1).

From dartmud.com:2525
&gt;timeline(7) -- adjective giving text for different times of the day
&gt;
&gt;timeline() is an adjective in the adjective server
&gt;"/std/serv/adjective.c" that allows you to add variety to your
&gt;descriptions by allowing you to have having minor differences
&gt;depending on the time of day as given by the time server.
&gt;
&gt;Basically timeline() will chose from phrases separated by vertical
&gt;bars "|" one phrase in order LATENIGHT|SUNRISE|MORNING|NOON|
&gt;AFTERNOON|SUNSET|NIGHT, based on current time value returned by the
&gt;the time server.
&gt;
&gt;Example:
&gt;
&gt;return "{w}{timeline:The streetlights flicker. |The sunrise is nice. |"+
&gt;       "You smell breakfast. |The sun is high. |Children play here. |"+
&gt;       "The sunset is pretty.|Its a spooky night. }";
&gt;       
&gt;From midnight until an hour before dawn:             The streetlights flicker.
&gt;From an hour before dawn 'til an hour after dawn:    The sunrise is nice.
&gt;From an hour after dawn 'til hour before noon:       You smell breakfast.
&gt;From an hour before noon 'til an hour after noon:    The sun is high.
&gt;From an hour after noon 'til an hour before sunset:  Children play here.
&gt;From an hour before sunset 'til an hour after sunset:The sunset is pretty.
&gt;From an hour after sunset 'til midnight:             Its a spooky night.
&gt;
&gt;NOTE: It is not possible to have phrases that include colons or vertical
&gt;bars! This is because the parser uses that colons to break up arguements in
&gt;adjectives, and timeline() only accepts one arguement and parses the vertical
&gt;bars into separate phrases.
&gt;
&gt;-- Nephilim
&gt;
&gt;See also: adjective(7), adjectives(7), oneof(), and parse_string(1).

A good adjective facility can be used for many things, these all from dartmud:

From dartmud.com:2525
&gt;
&gt;
&gt;		if a high value   if a small value  if a moderate value
&gt;		---------------  ----------------  -------------------
&gt;height    	- high         		low 		"" 
&gt;size          - large             	small  		""
&gt;length      	- long            	short   	""
&gt;width         - wide             	thin    	""
&gt;speed        	- fast         		slow 		""
&gt;depth        	- deep            	shallow 	""
&gt;sound    	- loud            	faint        moderate
&gt;physical_scale  - large        	small     about your size
&gt;                                  + compared to you
&gt;perceived_light - 
&gt;
&gt;day                             - {day:daystring:nightstring}
&gt;                                  returns the "daystring" during the 
&gt;				    daytime, the "nightstring"
&gt;                                  during the night
&gt;                                
&gt;dim                             - bright/dim/dark/""
&gt;shadowy                 - bright/shadowy/dark/""
&gt;dark                    - bright/dark/extremely dark/""
&gt;dimly_lit               - brightly/darkly/dimly/lit
&gt;dimly_lit_o             - brightly/dimly/""/lit
&gt;
&gt;number                  - 
&gt;one/two/three/.../ten/eleven/twelve/.../twenty/thirty/.../hundred/.../
&gt;                                  thousand/.../million/
&gt;
&gt;count                   - exactly/at least
&gt;
&gt;round_off               - 1/5/10/25/50/100/250/500/1000/3000/alot
&gt;
&gt;personal                - you
&gt;person                  - you
&gt;possessive              - your
&gt;persons                 - your
&gt;person_is               - you are
&gt;person_was              - you were
&gt;is_monster              - 
&gt;
&gt;strength        
&gt;intelligence    
&gt;detail_vision   
&gt;distance_vision 
&gt;night_vision    
&gt;smell                           
&gt;hearing                 
&gt;dexterity               
&gt;agility                 
&gt;constitution            
&gt;resilience              
&gt;power                   
&gt;will                            
&gt;
&gt;race
&gt;race_handle
&gt;
&gt;announce_hit
&gt;
&gt;announce_miss
&gt;
&gt;rand
&gt;
&gt;creator
&gt;
&gt;weapon_name
&gt;weapon_short
&gt;
&gt;exists
&gt;
&gt;aura
&gt;
&gt;ree
&gt;
&gt;blue
&gt;green
&gt;cyan
&gt;magenta
&gt;brown
&gt;lt_gray
&gt;dk_gray
&gt;lt_blue
&gt;lt_green
&gt;lt_cyan
&gt;lt_red
&gt;lt_magenta
&gt;white
&gt;blink
&gt;underline
&gt;reverse
&gt;
&gt;l
&gt;
&gt;garble                  - 
&gt;oneof           
&gt;timeline
&gt;
&gt;
&gt;These all have an argument of the form:
&gt;#~string or
&gt;#-#~string
&gt;
&gt;They simply return the string part of the argument if the person's stat is
&gt;greater than the number (in the case of #~string) or if it's in the range
&gt;(in the case of #-#~string).
&gt;
&gt;
&gt;strength
&gt;intelligence
&gt;detail_vision
&gt;distance_vision
&gt;night_vision
&gt;smell
&gt;hearing
&gt;dexterity
&gt;agility
&gt;constitution
&gt;resilience
&gt;power
&gt;will
&gt;
&gt;See also: adjective(7), color(8), oneof(7), language(7),
&gt;parse_string(1), timeline(7), and word_wrap(1). 
-----------------------------------------------------------------------
.. Christopher Allen                          1563 Solano Ave., #353 ..
.. &lt;gmfangs#asmrb,org&gt;         ;-&gt;           Berkeley, CA 94707-2116 ..
..                                                     h510/528-9899 ..
..                                       f510/649-3301 o510/649-3300 ..


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00176.html">[MUD-Dev] Re: Levels versus Skills, who uses them and when.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00178.html">[MUD-Dev] Re: Levels versus Skills, who uses them and when.</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00209.html">[MUD-Dev] Re: Reputations, More Mazes</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00174.html">[MUD-Dev] ADMIN Name server problems and upes</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00177"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00177"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: Levels versus Skills</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00208" HREF="msg00208.html">[MUD-Dev] Re: Levels versus Skills</A></strong>, 
quzah [softhome] <a href="mailto:quzah#softhome,net">quzah#softhome,net</a>, Sun 17 Jan 1999, 01:45 GMT
</LI>
<LI><strong><A NAME="00230" HREF="msg00230.html">[MUD-Dev] Re: Levels versus Skills</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 20 Jan 1999, 21:04 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00187" HREF="msg00187.html">[MUD-Dev] Reputations, More Mazes</A></strong>, 
Eli Stevens (KiZurich) <a href="mailto:c718157#showme,missouri.edu">c718157#showme,missouri.edu</a>, Fri 15 Jan 1999, 10:05 GMT
<UL>
<LI><strong><A NAME="00209" HREF="msg00209.html">[MUD-Dev] Re: Reputations, More Mazes</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 17 Jan 1999, 01:47 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00177" HREF="msg00177.html">[MUD-Dev] Adjective Server</A></strong>, 
Christopher Allen <a href="mailto:gmfangs#asmrb,org">gmfangs#asmrb,org</a>, Thu 14 Jan 1999, 23:11 GMT
<LI><strong><A NAME="00174" HREF="msg00174.html">[MUD-Dev] ADMIN Name server problems and upes</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 14 Jan 1999, 21:23 GMT
<LI><strong><A NAME="00159" HREF="msg00159.html">[MUD-Dev] Re: mobile movement (the fault of tracking)</A></strong>, 
quzah [softhome] <a href="mailto:quzah#softhome,net">quzah#softhome,net</a>, Thu 14 Jan 1999, 03:29 GMT
<LI><strong><A NAME="00152" HREF="msg00152.html">[MUD-Dev] Re: Thoughts</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Thu 14 Jan 1999, 00:46 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00154" HREF="msg00154.html">[MUD-Dev] Re: Thoughts</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Thu 14 Jan 1999, 01:05 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>