ID:138672
 
Just as a suggestion, it may sound a bit outlandish, but could a proc be implemented to just save the entire state of a given world, or basically make a map with everything in the current positions? I'm running into a lot of problems with procs that would be cancled when the server is reset that would leave mobs with bogus stats. On another note, no one really told me how to use the call proc. The feature's list was rather bland, and I don't know how I would structure that in to a code to oder mobs to perform verbs.
On 3/29/00 9:49 pm DerDragon wrote:
I'm running into a lot of problems with procs that would
be cancled when the server is reset that would leave mobs
with bogus stats

I ran into similar problems, and what I've done is create Reset() proc for all major node branches which gets checked frequently, verifies the state of all objects it's responsible for, making any changes nessisary.

It has some drawbacks in that extra calculations which I'd normally just add to a value now has to be stored in variables or things like spell enhancement, etc get lost.

Some of the things that Reset() checks for are available verbs (eg. if an object is hidden, it should not have the obj/verb/get()), for calculated values (eg. Offensive Bonus is a bonus derived from seven procs added together; Reset() recalculates this value.), from obj/mob states beyond verbs (if there is a mob in a doorway, and the doorway variable states that it's closed, change the doorway so that it is open).

I generally have the system run the Reset() procs whenever an object changes state - login, from visible to hidden, from alive to unconsious, from a spirit body to a living body, when first created, etc.

Not sure if something like this would help your situation, but there it is ;). It's a bit more work, as I have to add each major item to the Reset() proc that it will be run under, but it seems to work for me.

Example of extra work...
mob/spirit does not have many verbs that a mob/human has, so I have to specifically state if(istype(/mob/spirit)). I could probably make this easier by making my nodes deeper (/mob/living/humanoid containing all humanoid mobs with similar verbs, /mob/living/fish, mob/living/lizard/monster, whatever.)
On 3/29/00 9:49 pm DerDragon wrote:
Just as a suggestion, it may sound a bit outlandish, but could a proc be implemented to just save the entire state of a given world, or basically make a map with everything in the current positions?

We've been discussing this very issue quite a bit in the last few days. It's a fairly tricky problem to do correctly, but we may have some reasonable compromises.

We can support a "snapshot" of the entire world (including running procs, all objects, etc) in an already existing filetype: the .dmb file! (thanks to Dan for pointing this one out). I think this is pretty neat, but it is very inflexible in the sense that you won't be able to incorporate this save file with any changes in your code (since all new changes get written to a new .dmb).

Ideally, we would have some format that could write the entire object state of the world to a .dmp file. As a first go, we may support doing this through a savefile, since the .dmp isn't really as general as we'd like (yet).

You can in fact already do this kind of "object save" yourself, but since there is no way to loop through a list of vars you have to manually code in each element to be saved, and that is kind of a pain. So as yet another option we may support some function to loop through properties of an object. Then we can make a generic saveworld function that the user can override to do specific saves. I'll update everyone on the decisions, and of course would appreciate any input.
In response to Tom H.
I'd love to be able to loop through all the properties of an object. Mobs have over a hundred variables (so far) in Ceruelea and it was a pain to write the code that saves them. But I don't save every one of them. So if we did have some proc that looped through all the variables of an object, it'd be great if we could enter as arguments the names of variables to skip.

Z