1997Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  Re: Verb binding -->
<!--X-From-R13: pynjerapNphc.uc.pbz -->
<!--X-Date: from tacitus.globecomm.net [207.51.48.7] by mx4.ibm.net id 861939788.67806&#45;2 Fri Apr 25 03:43:08 1997 -->
<!--X-Message-Id: 199704250057.RAA08222#xsvr3,cup.hp.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 9704241355.7ya5@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  Re: Verb binding</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:clawrenc#cup,hp.com">
</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="msg00206.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00208.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00203.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00292.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00207">Author</A>
&nbsp;|&nbsp;<A HREF="#00207">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00207">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  Re: Verb binding</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  Re: Verb binding</LI>
<LI><em>From</em>: <A HREF="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</A></LI>
<LI><em>Date</em>: Wed, 23 Apr 97 17:18:31 -0700</LI>
<LI><em>Reply-to</em>: <A HREF="mailto:claw#null,net">claw#null,net</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
In &lt;<A HREF="msg00202.html">9704241355.7ya5#ami-cg,GraySage.Edmonton.AB.CA</A>&gt;, on 04/24/97 
   at 08:44 AM, cg#ami-cg,graysage.edmonton.ab.ca (Chris Gray) said:

&gt;What about a situation like this: there is an apple tree, and you
&gt;want to be able to pick apples from it. I do this by having two kinds
&gt;of apples, one on the tree, and the other in the hand. So, you can
&gt;refer to 'apple' whether or not you have picked one. The 'pick' verb
&gt;is global, so it has no trouble generating a new apple for you,
&gt;whether or not you have one in your hand. How would you guys do this
&gt;with verbs bound to objects? The 'pick' verb on the apple in your
&gt;hand would get called, and its going to have to go out and figure out
&gt;whether an apple tree is nearby, and do the right stuff to generate a
&gt;new apple. This is exactly what a global 'pick' verb does. In that
&gt;case you have to first search for the verb (likely finding it on the
&gt;apple being carried, but perhaps you have some way to force it to
&gt;happen for the hidden on-tree apple), and then the verb has to search
&gt;for a tree.

I handle with one of a few simple approaches:

If I don't care if the apple's state is retained after it is picked
(eg the unpicked apple may contain a worm, but the picked one won't,
or perhaps a message scratched on its skin) I have two different sorts
of apples, one that lives only in the apple tree and has a "pick"
verb, and another non-tree apple.  

When an apple is picked, the verb only exists on the tree-type apples,
so that is matched.  The verb methods then create a new apple of type
non-tree which doesn't have a "pick" verb, and hand that off to the
user while destructing the tree-apple.

If I do want to retain state (eg I want the worm to still be there
after the apple is picked, or the scratched message), then I merely
have an inherited parent which defines the "picked" verb.  Then, when
the apple is picked it disinherits the parent, and the pick verb goes
away.

A variation on this last one occurs when the parent with the "pick"
verb occurs way up the inheritance tree and can't be disinherited due
to other required methods.  (This is approach is also probably more
efficient for the last case as well).  Create a seperate object which
is associated with the apples, and bears the "pick" verb.  If the case
demands it, have one such pick-object per apple.  The pick object then
resolves the "pick" verb, the invoked method transfers the location of
the associated apple to the player, and the pick-object
self-destructs.

Pleasantly both of these last approaches allow already picked apples
to be placed back in the tree (say lodged atop a branch), AND be
unpickable (but still gettable).  Ahh, illusion.

If you really want reaplced apples to be pickable, just put a watch on
the tree's contents, and re-create the original setup )pick-object or
whatever) whenever an apple is placed in the tree.

-- 
J C Lawrence                           Internet: claw#null,net
(Contractor)                           Internet: coder#ibm,net
---------------(*)               Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00202" HREF="msg00202.html">Re: Verb binding</A></STRONG>
<UL><LI><EM>From:</EM> cg#ami-cg,GraySage.Edmonton.AB.CA (Chris Gray)</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00206.html">Re: [MUD-Dev]  Re: Why have a combat state?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00208.html">Re: [MUD-Dev]  Re: Issues from the digests and Wout's list</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00203.html">Re: [MUD-Dev]  Re: Verb binding</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00292.html">Re: Verb binding</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00207"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00207"><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><A NAME="00206" HREF="msg00206.html">Re: [MUD-Dev]  Re: Why have a combat state?</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Fri 25 Apr 1997, 02:06 GMT
<UL>
<LI><strong><A NAME="00232" HREF="msg00232.html">Re: [MUD-Dev]  Re: Why have a combat state?</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Sat 26 Apr 1997, 06:11 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00202" HREF="msg00202.html">Re: Verb binding</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 24 Apr 1997, 21:46 GMT
<UL>
<LI><strong><A NAME="00203" HREF="msg00203.html">Re: [MUD-Dev]  Re: Verb binding</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 24 Apr 1997, 23:57 GMT
</LI>
<LI><strong><A NAME="00207" HREF="msg00207.html">Re: [MUD-Dev]  Re: Verb binding</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Fri 25 Apr 1997, 10:43 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00292" HREF="msg00292.html">Re: Verb binding</A></strong>, 
S001GMU <a href="mailto:S001GMU#nova,wright.edu">S001GMU#nova,wright.edu</a>, Wed 30 Apr 1997, 01:08 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00193" HREF="msg00193.html">Re: [MUD-Dev]  Re: Issues from the digests and Wout's list</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Thu 24 Apr 1997, 02:54 GMT
<UL>
<LI><strong><A NAME="00201" HREF="msg00201.html">Re: [MUD-Dev]  Re: Issues from the digests and Wout's list</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 24 Apr 1997, 21:45 GMT
</LI>
<LI><strong><A NAME="00204" HREF="msg00204.html">Re: [MUD-Dev]  Re: Issues from the digests and Wout's list</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Fri 25 Apr 1997, 00:33 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>