Re: mobprog.patch

From: Michael Buselli (mhbusell@midway.uchicago.edu)
Date: 05/31/95


On Tue, 30 May 1995, Hazard@Divinity wrote:
> On Tue, 30 May 1995, FourSpace wrote:
> > Has anyone attempted to patch the mobprog code that is available on the
> > ftp site with Circle 3.0?  It was made to work with 2.2.
> 
> 	MobProgs are highly instable, you'd be better off
> 	without them -- or with rewriting them from scratch.
> 	Not to mention, it was pretty poorly designed in the
> 	Merc code, and when it was ported to Circle took
> 	some of that poor design with it.

I have succesfully integrated that patch into my mud, however, as Hazard
said, it's very poorly written.  I was required to do some minor debuging
to get it to work at all, and I was very displeased to find out the hard
way that a bad prog (that triggers itself again and again...) can crash
your entire system if you're not careful. 

Of course, I've fixed that problem now so it can't happen, and I'm slowly
rewritting the whole d**n thing.  I had to fix if-else-endif control flow. 
I also implemented recursive expresion evaluation (with type checking and
better error reports), although I do not support infix operations yet (ie,
addition is +(a, b) not a + b). 

Anyway, the best way to add mobprogs to your mud is to implement the patch
that you have, iron out the initial bugs (I forget details as to what they
were, they aren't hard to find as your mud won't compile with most of
them), set a recursive depth check and limit on mprog_driver (or whatever
that one function is.  You shouldn't have mobs triggering mobs triggering 
mobs triggering mobs...), and from there you should have something decently
stable for use.  When you get to this point, you can mail me about some of
the changes I've made from there, because I'm making these things really
powerful (not done yet). 

Oh, one bug that I can think of right now... make sure you fix the 
do_mpforce funtion so that mobiles don't force immortals!  It would not 
be nice to have a switched god or charmed mob "mpforce ras shutdown die" 
on you, or something like that.

Good luck, dude!  (You'll need it...)

Michael Buselli
mhbusell@midway.uchicago.edu



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