<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] (fwd) [DESIGN] Macro semi-language --> <!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> --> <!--X-Date: Fri, 27 Apr 1998 12:42:37 -0700 --> <!--X-Message-Id: 199804271810.LAA316652#under,engr.sgi.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] (fwd) [DESIGN] Macro semi-language</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:claw#under,engr.sgi.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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00776.html">Previous</a> | <a href="msg00779.html">Next</a> ] Thread: [ <a href="msg00447.html">Previous</a> | <a href="msg00790.html">Next</a> ] Index: [ <A HREF="author.html#00775">Author</A> | <A HREF="#00775">Date</A> | <A HREF="thread.html#00775">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] (fwd) [DESIGN] Macro semi-language</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] (fwd) [DESIGN] Macro semi-language</LI> <LI><em>From</em>: J C Lawrence <<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>></LI> <LI><em>Date</em>: Mon, 27 Apr 1998 11:10:09 -0700 (PDT)</LI> <LI><em>Cc</em>: <A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A></LI> <LI><em>Delivery-date</em>: Fri Apr 27 12:42:38 1998</LI> <LI><em>Delivery-date</em>: Fri, 27 Apr 1998 12:42:38 -0700</LI> <LI><em>Envelope-to</em>: claw#kanga,nu</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Sender</em>: "Petidomo List Agent,,,," <<A HREF="mailto:petidomo#kanga,nu">petidomo#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> From: Richard Woolcock <KaVir#dial,pipex.comNOSPAM> Newsgroups: rec.games.mud.diku,rec.games.mud.admin,alt.mud.programming Subject: [DESIGN] Macro semi-language Date: Sat, 25 Apr 1998 04:22:00 -0700 Recently I was asked by a friend and fellow implementor if I could show her how to code on the mud. She had used pascal before, but never used C, and didn't really seem to have any grasp of the language. In order to try and help her, on wednesday I threw together a set of macros to create a sort of pseudo-language. I added a few more features on thursday, and today got the chance to show her how it worked. Although she is still having problems, she is finding this macro-based system far easier to use, and I have started wondering if it might help a few other coder wannabe's. Note that this system is designed for Merc, but could be easily adepted to most other hard-coded systems. The advantages and disadvantages as I see it are as follows: * ADVANTAGES: More verbose and robust than direct C coding, as well as requiring less actual code to be written. Compiles down almost as efficiently as pure C, and can be mixed and matched. * DISADVANTAGES: Excessive macros resulting in poor type checking, severe limitations on what you can do, and doesn't really help teach the user C. The hope is that as the user requires more and more from the code, they will slowly begin to teach themselves, rather being dropped in at the deep end and not knowing how to do anything. Any comments are welcome. Two examples of code follow. KaVir. ----- DO_FUNCTION(KICK) /********************************************************************* ---------------------------------------------------------------------- Function : do_KICK Author : KaVir Date : 25th April 1998 ---------------------------------------------------------------------- Description : Takes in a person as the first parameter. If no first parameter is entered, then the player will attempt to kick the person they are fighting, if any. ---------------------------------------------------------------------- *********************************************************************/ VARIABLES NONE; PARAMETERS VICTIM_IN_ROOM(FIRST_PARAMETER); BEGIN IF EMPTY_PARAMETER(FIRST_PARAMETER) THEN IF PERSON_ME_FIGHTING IS FALSE THEN TEXT_TO_ME("Who do you want to kick?"); EXIT; ELSE SET VICTIM TO PERSON_ME_FIGHTING; ENDIF ENDIF IF VICTIM_EXIST IS FALSE OR ME_SEE_VICTIM IS FALSE THEN TEXT_TO_ME("They are not here."); EXIT; ELSIF IS_SAFE IS FALSE THEN SET DAMAGE TO RANDOM_NUMBER(1,4) + ME_DAMROLL; ME_HIT_VICTIM(KICK); WAIT_STATE(ME,4); ENDIF END FUNCTION DO_FUNCTION(TRANSPORT) /********************************************************************* ---------------------------------------------------------------------- Function : do_TRANSPORT Author : KaVir Date : 25th April 1998 ---------------------------------------------------------------------- Description : Takes in an object as the first parameter and a person as the second parameter. The object is then transported to the person. ---------------------------------------------------------------------- *********************************************************************/ VARIABLES NONE; PARAMETERS OBJECT_IN_ROOM(FIRST_PARAMETER); VICTIM_IN_WORLD(SECOND_PARAMETER); BEGIN IF EMPTY_PARAMETER(FIRST_PARAMETER) OR EMPTY_PARAMETER(SECOND_PARAMETER) THEN TEXT_TO_ME("Transport what object to whom?"); EXIT; ENDIF IF ME_SEE_OBJECT IS FALSE THEN TEXT_TO_ME("You cannot see that object."); EXIT; ENDIF IF ME_CARRY_OBJECT IS FALSE THEN ACT_TO_ME_OBJ("You are not carrying $p."); EXIT; ENDIF IF ME_SEE_VICTIM IS FALSE THEN TEXT_TO_ME("You cannot see that person."); EXIT; ENDIF IF VICTIM_ROOM IS ME_ROOM THEN TEXT_TO_ME("They are already here!"); EXIT; ENDIF ACT_TO_ME_OBJ("$p vanishes from your hands in a swirl of smoke!"); ACT_TO_ROOM_OBJ("$p vanishes from $n's hands in a swirl of smoke!"); ACT_TO_VICTIM_OBJ("$p appears in your hands in a swirl of smoke!"); FULL_ACT_TO_ROOM(VICTIM,OBJECT,NONE,"$p appears in $n's hands!"); OBJECT_TO_VICTIM; END FUNCTION -- J C Lawrence Internet: claw#null,net (Contractor) Internet: coder#ibm,net ---------(*) Internet: claw#under,engr.sgi.com ...Honourary Member of Clan McFud -- Teamer's Avenging Monolith... -- MUD-Dev: Advancing an unrealised future. </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="00250" HREF="msg00250.html">[MUD-Dev] Re: (fwd) [DESIGN] Macro semi-language</A></strong> <ul compact><li><em>From:</em> J C Lawrence <claw#under,engr.sgi.com></li></ul> <li><strong><A NAME="00790" HREF="msg00790.html">[MUD-Dev] Some thoughts on languages and users - was: Macro semi</A></strong> <ul compact><li><em>From:</em> "Jon A. Lambert" <jlsysinc#ix,netcom.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="msg00776.html">[MUD-Dev] (fwd) Re: POLL: Games ruined by bad players (Player killers, tank rushers etc)</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00779.html">[MUD-Dev] Re: OT: Birth announcement</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00447.html">[MUD-Dev] Re: Wired, UO, and Internet Gaming (was Re: OT:</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00790.html">[MUD-Dev] Some thoughts on languages and users - was: Macro semi</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00775"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00775"><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: OT: Birth announcement</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <LI><strong><A NAME="00314" HREF="msg00314.html">[MUD-Dev] Re: OT: Birth announcement</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Sat 02 May 1998, 00:42 GMT </LI> <LI><strong><A NAME="00341" HREF="msg00341.html">[MUD-Dev] Wired, UO, and Internet Gaming (was Re: OT: Birth announcement )</A></strong>, Mike Sellers <a href="mailto:mike#bignetwork,com">mike#bignetwork,com</a>, Sun 03 May 1998, 12:59 GMT <UL> <LI><strong><A NAME="00347" HREF="msg00347.html">[MUD-Dev] Re: Wired, UO, and Internet Gaming (was Re: OT:</A></strong>, Dr. Cat <a href="mailto:cat#bga,com">cat#bga,com</a>, Sun 03 May 1998, 20:47 GMT <UL> <LI><strong><A NAME="00447" HREF="msg00447.html">[MUD-Dev] Re: Wired, UO, and Internet Gaming (was Re: OT:</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 06 May 1998, 23:12 GMT </LI> </UL> </LI> </UL> </LI> </ul> </ul> </LI> <LI><strong><A NAME="00775" HREF="msg00775.html">[MUD-Dev] (fwd) [DESIGN] Macro semi-language</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 27 Apr 1998, 19:42 GMT <UL> <LI><strong><A NAME="00790" HREF="msg00790.html">[MUD-Dev] Some thoughts on languages and users - was: Macro semi</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 28 Apr 1998, 05:10 GMT </LI> <LI><strong><A NAME="00250" HREF="msg00250.html">[MUD-Dev] Re: (fwd) [DESIGN] Macro semi-language</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 30 Apr 1998, 00:24 GMT </LI> </UL> </LI> <LI><strong><A NAME="00776" HREF="msg00776.html">[MUD-Dev] (fwd) Re: POLL: Games ruined by bad players (Player killers, tank rushers etc)</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 27 Apr 1998, 19:31 GMT <UL> <LI><strong><A NAME="00787" HREF="msg00787.html">[MUD-Dev] Re: (fwd) Re: POLL: Games ruined by bad players (Playe</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 27 Apr 1998, 23:09 GMT </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>