Re: [ Idea, Problem? ] Mobprogs and Variables...

From: Erwin S. Andreasen (erwin@PIP.DKNET.DK)
Date: 09/26/97


On Thu, 25 Sep 1997, Daniel Koepke wrote:

> -+I am not sure about the layout of the stock mobprogs anymore - we've made
> -+some modifications to them or two, like tokenizing, external compilation
>
> These things (variables) would be your own extensions to mobprogs.

I know that :P

> impression that a new scripting language needs to be written for
> CircleMUD, because mobprogs have always left a particularly foul
> taste in my mouth -- even if you add features to it (it's not just
> an issue of power; but of how it does things internally, which is
> sickening and over-complex).

I have gradually rewritten the mobprogs as needs arose. I feel my current
code is adequate and easy on builders. I think that the line-orientation
of mobprogs is eaier on builders: while as a full fledged langauge which
is token-orientated is somehow more difficult though powerful: for
example, it'd be necessary to put all strings in quotes. And, with some
4000 existing programs, I'd have a hard time convincing the builders to
convert to a new system :)

Anyway, I don't know what part of mobprogs you especialyl disliked, but I
have at least gotten rid of the constant comparing of strings. First,
programs are parsed, creating a linked list of tokens. For example:

if $n.age < 18
  sayto $n You are not old enough!
else
  smile $n
endif

will become after tokenizing:

[ if check ] --\
   |           |
   v           |
[sayto]        |
   |           |
   v           |
[else] <-------/
   | \----\
   v      |
[smile]   |
   |      |
   v      |
[endif]<--/


When the program actually runs, and the if token is reached, if the
condition is true, nothing is done. If the condition is false, next
instruction is set to the one following the else.

If the condition was true, once the else is reached, the next instruction
will the one following the endif.

So, with a bit of rewriting, I think they can be useful.

Hmm, come to think of it: I think that the mobprogs I based off and
Circle's are slightly different - try finding some package called
"Rom24Mobprogs* or such, created by Newt (or such, Markuu Nyylander
(sp!)). He too rewrote large amounts of the code, his code is probably
much nicer to base off, if one decides to improve existing mobprogs rather
than start from scratch.

 =============================================================================
Erwin Andreasen   Herlev, Denmark <erwin@pip.dknet.dk>  UNIX System Programmer
<URL:http://pip.dknet.dk/~erwin/>         <*>           (not speaking for) DDE
 =============================================================================


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



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