Re: [OFF-TOPIC]

From: Daniel A. Koepke (dkoepke@california.com)
Date: 06/21/99


On Sun, 20 Jun 1999, George Greer wrote:

> I was thinking about[1] a Perl port yesterday.  One of the really nice
> things would be that you could execute arbitrary Perl code through 'eval'
> while online to aid in debugging or just do something unique.  That would
> be quite cool and someone has done a Perl MUD.

Would this not be possible through Perl's API (whatever that connotes)
given a decent, generic scripting engine?  One of the things that I'm
finding more and more interesting is the scripting engine supporting
several other languages and, moreover, dynamic linking.  As I mentioned at
the meeting, my current plan is for two scripting languages.  One is a
server scripting language (e.g., lower level) and could theoritically be
used for writing the entire game portion of the MUD in.  This is a real
programming language, with variables, etc., and the sort we're all
familiar with.  This is called Locus (a play off of "Circle" for those
into mathematics).  The second language is not really a programming
language at all.  Instead, it is a mechanism by which non-programmer
builders, or maybe even just your average 10 year old, could create
interesting behavior from mobiles.  This language would be implemented in
Locus.

This second language is the one of most interest to me at this time.  The
idea is to create a language so simple that anyone can understand and use
it without any formal training or documentation on hand.  What I've
decided upon is something like this,

When...

    0:0 [... and/or] scripted thing is created...
    0:1 [... and/or] scripted thing dies...
    0:2 [... and/or] scripted thing moves...
    0:3 [... and/or] scripted thing moves direction X...
    0:4 [... and/or] scripted thing enters room X...
    .
    . (lots of others, like flag checking on scripted thing)
    .

    1:0 ...and it has flags X...
    1:1 ...and it doesn't have flags X...
    1:2 ...and it's of type X...
    1:3 ...and it can be worn on X... [object specific]
    1:4 ...and it weighs between X and Y... [!room]
    .
    . (bunch of other ones)
    .

then

    2:0 [...and] issue command X...
    2:1 [...and] move object to room X...
    2:2 [...and] get (seen) object...
    2:3 [...and] go direction X...
    2:4 [...and] teleport to room X...
    .
    . (bunch of other ones)
    .

A script would actually look like this,

    0:7 2400 1:0 afg 2:4 3001 ;

which would mean something like, "When scripted thing sees object 2400,
and it has flags afg, teleport the scripted thing to 3001."  The builder
wouldn't, of course, need to type in scripts in this manner.  Instead,
they'd simply be given a choice from a menu, then a few prompts to fill in
the parameters of any given choice, and so on from there.  Or perhaps
another method, like building a simple diagram of how they want the thing
to work using a GUI interface.  The latter would be extremely cool, but I
am presently not willing to go hacking through GTK enough to figure out
how one could create a usable, portable GUI.  Maybe QT is easier and just
as portable...?  I'd have to look into it all.

This language wouldn't be suitable for writing anything but world scripts,
however it'd be very easy to learn and employ for builders, who tend to be
non-programmers, but still want to do cool things with their NPCs,
objects, rooms, etc.  A more complex example might be,

    0:7 2400 1:0 afg | 0:7 2401 1:1 afg 2:4 3001 2:7 f ;

which might be, "When scripted thing sees object 2400 and it has flags
afg, or when scripted thing sees object 2401 and it doesn't have flags
afg, then teleport to room 3001 and set flag f on scripted thing."  Of
course, since Locus is what this language is written in, it'd still be
entirely possible for you or your builders to write these sorts of
scripts in it, or -- given the right level of abstraction in my
scripting engine -- whatever other language you have plugged into
CircleMUD.

What'dya think, sirs?

-dak :
  Make no promises, accept no promises; have no hope, miss no milestones;
  be rich, be frugal; embrace your friends, don't turn your back on them;
  there are no people, only demographics; money is secondary, attention's
  everything.  This is the essence of ultra-Capitalism.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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