I was wondering if it is possible to reboot without having to actually restarting the server. By that I mean, like all the turfs,npc, etc would go back to its original place just like a reboot. So if someone summon a npc out of place, then world restore would put it back to where it was without having to restart the server.
hmm so if someone picks up a sword for example and this proc takes effect it would go back yes (world restore code that i have restores items) but would it delete them from that person's inventory? Also..wouldn't this move players?
|
Correct, you would need to add logic to stop that.
You would need to do checking on if someone is a player to r prevent that too. (i.e. if(!m.client)) |
mob/Owner ok this would work then |
OR do i need to indent that a bit more
mob/Owner |
Second one would be the correct indentation. Now the return statement is not the correct one to use here. Return refers to the procedure. We just want to move to the next alliteration of the loop.
loopstatement Looking at the example, our loop statement here is the for. In order to exit the loop statement, you use break somewhere in the do something area. Now if you want to go to the next, you use continue in the do something area. |
hmm, ya i was thinking that i might need to use break ok replace break with return and else with else continue?
|
could you show me like an example or something? I think that maybe i would understand more, i have some procs like
break |
No, just replace return with continue.
This will say, when I reach a player, I don't want to do anything with them, go to the next loop. You can then just remove the else as it would be redundant. mob/Owner |
so return or break isnt needed? what im was trying to do with player and gm is so they they DONT get moved and everything else npc,obj etc do
|
it says
test.dm:7:error: M.x: cannot change constant value test.dm:7:error: M.y: cannot change constant value test.dm:7:error: M.z: cannot change constant value test.dm:7:error: M.loc: cannot change constant value mob/Owner |
So like...
mob/Owner |
test.dm:5:error: M.player: undefined var
test.dm:5:error: M.GM: undefined var why am i getting this error? I have it set look.. mob/Owner |
You're looking up /atom/movable in the loop, but the variables are defined for /mob, the compiler doesn't know what you're trying to do.
Since you want the loop catching everything, you can either change the way the variables are defined, or do some type-casting to check the variables after an istype() check. if(istype(M,/mob)) |
well since this code is bascially for npc and not players then this should work...
mob/Owner |
If they have not been destroyed, then you can loop though their vars list and set the values to their initial value by using initial().
You would need to use both to properly restore the world, unless you never deleted an item. Note, if someone picks something up, it'll move that back too.