[DGD] [Melville] non-static mappings

John Ruiz jruiz at psu.edu
Tue Feb 5 19:07:45 CET 2002


> This works fine as long as the mapping is static, but when I try to
make 
> it non-static, so that it will be saved, I get an "Index on bad type" 
> error whenever the process_alias() function is called.

Glad to see someone else is using the Melville lib ;)

Basically, my alias code is the same as yours, but with one major
difference.  Instead of being in shell.c, I just put it in player.c.
That way, the mapping of aliases gets saved with the rest of the player
info.  That will solve the problem you're having.

You could, of course, keep it in shell.c and write to save files and
then restore it in all your functions, but there's no reason (in my
mind) why aliases - aside from making the player object just a touch
larger - wouldn't have a right to sit in player.c.

Also, you may want to consider actually subtracting the key out (as
opposed to setting it to nil) when removing aliases, so that you don't
run the risk of getting zeros in your save file.  Noah Lee Gibbs has an
insanely useful website that can show you how to do this (among other
things).  You'll find it here:
http://www.angelbob.com/projects/DGD_Page.html.

Good Luck!

John Ruiz


_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list