Saving variables on mobs/rooms/objs

We recently got a question on the forum (http://www.tbamud.com/forum/thread/743) , asking if it could be possible to save variables over reboots.


Well, now you can! I've made a shoddy first hack at something to that end.


I'm not entirely sure the AVL implementation license (MIT) is compatible with the circle license, so I think it needs some rewriting before it can be incoorporated in a release. But hey, as long as it's downloaded separately, there's no problems.


After installing the patch and the tree.h file, you have acces to two new commands in your dg scripts:



persist varname


Stores the current value of the variable with the given name to disk. It is stored based on type (room/mob/object) and vnum - so several mobs sharing a script or trigger will currently have separate values stored.

%self.persisted(varname)%


is substitued with the value from persistent storage


Be advised that currently the code has not been thoroughly tested, does not contain a lot of comments or log statements.