1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]	PirateMUD and CSL -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: from stimpy.globecomm.net [207.51.48.4] by in4.ibm.net id 870847500.51286&#45;1 Wed Aug  6 06:05:00 1997 CUT -->
<!--X-Message-Id: 9708060212.8ame@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]	PirateMUD and CSL</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">
</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="msg00407.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00409.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00505.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00504.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00408">Author</A>
&nbsp;|&nbsp;<A HREF="#00408">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00408">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]	PirateMUD and CSL</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]	PirateMUD and CSL</LI>
<LI><em>From</em>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A> (Chris Gray)</LI>
<LI><em>Date</em>: Tue, 5 Aug 97 19:12:02 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
[Niklas E:]
:Greetings everyone,

Greetings!

:	 &lt;room&gt;
:	 .. (room data)
:	 &lt;csl&gt;
:	 &lt;leave&gt;
:	 if (is_env("north")) then {
:		 if (has_item("fraznium gloves") {
:			 tell_room("The portal glows as @the(i) enter@ve(i).")
:			 okay()
:		 }
:		 else {
:			 tell_room("The portal prevents @the(i) from entering."
:			 fail()
:		 }
:	 }
:	 &lt;/leave&gt;
:	 &lt;/csl&gt;
:	 &lt;/room&gt;
:
:This worked tremendously well, and has allowed us to write some very nice
:puzzles and quests. However, there is one little problem with this approach:
:Since the MUD engine gets confirmation of an event from the CSL function,
:things may happen in the wrong order.

Been there. Noticed the problem. Don't really have a solution. :-)

However, what I did was to make up a datatype that is 3-valued, and have
many such routines return that type. I call the type "status", and it
is built into the language just like "int", "bool", etc. The three values
it has, and their common meanings are:

    success - the activity has completed successfully
    failure - the activity has failed
    continue - continue with the activity

In your example, the writer of the CSL could choose whether or not to
return 'success', having done everything related to the event, or return
'continue', indicating that the default activities should happen. Returning
'continue' doesn't mean that nothing special has been done, however.
Naturally, I then ran into cases where 3 values weren't enough, so I
fudged it. You could just return an integer, and predefine some values.

(I do note that your CSL doesn't actually return anything, but you could
replace the okay()/fail() calls with a status() call which takes an
integer argument.)

--
Chris Gray   cg#ami-cg,GraySage.Edmonton.AB.CA

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00504" HREF="msg00504.html">Re: [MUD-Dev] PirateMUD and CSL</A></strong>
<ul compact><li><em>From:</em> clawrenc#cup,hp.com</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00407.html">Re: [MUD-Dev] Reputation, was butthead features</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00409.html">Re: [MUD-Dev] Graphic MUDS/Ultima Online</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00505.html">Re: [MUD-Dev] Generalized AI Resend</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00504.html">Re: [MUD-Dev] PirateMUD and CSL</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00408"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00408"><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>Re: [MUD-Dev] PirateMUD and CSL</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00534" HREF="msg00534.html">Re: [MUD-Dev] PirateMUD and CSL</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 14 Aug 1997, 00:53 GMT
<UL>
<LI><strong><A NAME="00573" HREF="msg00573.html">Re: [MUD-Dev] PirateMUD and CSL</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Thu 14 Aug 1997, 21:25 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
<LI><strong><A NAME="00412" HREF="msg00412.html">[MUD-Dev] Generalized AI Resend</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Wed 06 Aug 1997, 22:00 GMT
<UL>
<LI><strong><A NAME="00505" HREF="msg00505.html">Re: [MUD-Dev] Generalized AI Resend</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Wed 13 Aug 1997, 00:01 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00408" HREF="msg00408.html">Re: [MUD-Dev]	PirateMUD and CSL</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 06 Aug 1997, 13:05 GMT
<UL>
<LI><strong><A NAME="00504" HREF="msg00504.html">Re: [MUD-Dev] PirateMUD and CSL</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Tue 12 Aug 1997, 23:47 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00402" HREF="msg00402.html">[MUD-Dev] Reputation, was butthead features</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Wed 06 Aug 1997, 02:16 GMT
<UL>
<LI><strong><A NAME="00407" HREF="msg00407.html">Re: [MUD-Dev] Reputation, was butthead features</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Wed 06 Aug 1997, 09:41 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00411" HREF="msg00411.html">RE: [MUD-Dev] Reputation, was butthead features</A></strong>, 
Koster, Kristen <a href="mailto:kkoster#origin,ea.com">kkoster#origin,ea.com</a>, Wed 06 Aug 1997, 21:30 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>