ID:175800
 
Thanks for your help yesterday, Lummox and Kunark. I fixed my rollback bug, but now I have another one to fix. Whenever I reboot my world, not everyone gets saved. How can I fix this so they get saved when I reboot, so I don't have to wait for everyone to logout to save?
make the game manualy save right before reboot
Oh ya, another bug, or perhaps not. How can I make items players have taken off the ground respawn? I mean, the item is taken and only respawns with defeated monsters if it is destroyed. So, how can I make them respawn while the player still getting to keep the item?
In response to Koolguy900095
Is there a form of code I can enter to activate for reboot, such as if its not caused by a command but by CTRL+R?
In response to Ryuo
mob/verb/reboot()
world.Reboot()
just stick the saving in there
In response to Ryuo
The problem you're having here is that the objs still exist, but they're just in another location. Notice how they respawn when the person that picks them up logs out? In order to fix this, you'll have to change how they're picked up:
obj/item/verb/Get()
set src in oview(1)
new src.type(usr)
del(src)

That's all you need. Since the object no longer exists, it will respawn correctly when you use Repop(). Of course, I suggest you use a different method of respawning items, or you'll just saturate the market with these. Something more like this would be...
obj/item/verb/Get()
set src in oview(1)
if(src.loc == initial(src.loc)) //If this is true, then it's been created on the spot it's at, and thus, is a "persistant" item.
src.loc = locate(/turf/Vault) in world //Make sure there is only one
new src.type(usr)
else
src.Move(usr)

turf/Vault
Enter(atom/movable/A)
return 0

var/repopcount = 0

Repop()
..()
repopcount++
if(repopcount == 10)
repopcount = 0
var/turf/Vault/V = locate(/turf/Vault) in world
for(var/obj/O in V)
O.loc = initial(O.loc)


And that will "respawn" the items every 10 repops.
In response to Magnus VI
I havent tried and sometimes there are restrictions or they just don't work, but I'm pretty sure you can just stick it in the world.Reboot() proc like this



Reboot()
//Do stuff here
..()


But I don't know if that will do it for when you reboot the world from DS, but I know it will through calling it in a proc.
Your putting it in Logout() is the problem...


Put it in client/Del() then call ..() at the end.

Example:

client/Del()
Save_me()
..()



You do this because during reboot it doesn't manually logout everyone, it just deletes them instead. But make sure you have this also:


mob/Logout()
..()
del(src)