ID:139386
 
Code:


Problem description:

Okay, so basically, say there's two players logged in, server reboots. When it comes back up, sometimes there's copies of those players. And I don't get why. We have world saving options, could it be that the lists that are saved, or saving mobs, and on load, it loads them as well? Or something? I just don't get it. It seems to do the same for the /meanies (not /mob, parent type is /mob) as well. Making dozens of them, way more then there should be.
It's probably your world saver. If you're saving turfs(which you really shouldn't), you must make sure you're not saving their contents.
If there's anywhere else there are non-tmp variables that contain /mobs, you should make them temporary variables.
In response to Kaiochao
Kaiochao wrote:
It's probably your world saver. If you're saving turfs(which you really shouldn't), you must make sure you're not saving their contents.
If there's anywhere else there are non-tmp variables that contain /mobs, you should make them temporary variables.

Would saving a "loc" save the mobs inside it, as well?
In response to Asellia
If it's considered a "loc", it has a "contents" variable, which contains everything that has a "loc" equal to that "loc".
Yes, saving a loc saves its contents. That's basically what I said in my other post.
In response to Kaiochao
Kaiochao wrote:
If it's considered a "loc", it has a "contents" variable, which contains everything that has a "loc" equal to that "loc".
Yes, saving a loc saves its contents. That's basically what I said in my other post.

Ah, I was using it to essentially save "locs" of where objects were NOT (as normally, wall objects are e3verywhere, but can be destroyed, so theyre objects not turfs) and instead of saving 900k + objectsd, I saved where they're not. Any alternative suggestions? As opposed to saving the "loc" I mean
In response to Asellia
Save the x/y/z coordinates, then find the turf with locate(x,y,z) when you load it.

(Posting in this old thread since it hasn't had a solution yet)
In response to Asellia
You could also have it look through all the mobs in the world upon startup. Have a list of the names of all the NPCs in the game. If there are mobs who do not have a name in this list, it's likely a player mob that as saved. You can then instruct the world to delete those player mobs. An easier way to do this is to create a variable that, upon login, is set on the mob, such as "player=0" which is set to 1 upon login.

Then when the world resets it'll look through all the mobs, find which ones that are player mobs and deletes them.

This is only if you're not comfortable with modifying how the world saves. Otherwise, just find a way to exclude those mobs from being saved in the first place.