vefboost.blogg.se

Byond save file editor
Byond save file editor





  1. #Byond save file editor how to#
  2. #Byond save file editor code#

So yes, obj.loc will be null until immediately after obj.Read() finishes -except in the case of atoms/turfs.

#Byond save file editor code#

Everything that's already scheduled will execute, and then the code that's been injected into the internal pending proc queue by spawn(0) is executed in the order that it was called on the same tick. The loc of objects are set within the saved parent's Read() proc internally, so the location will be null until after the Read() proc is finished.īy using spawn(0), you are effectively pushing the processing of the code block within spawn until the end of the current tick. Meaning, an object in the contents list of another object within a savefile is relocated after Read() executes within that object. All other objects must be repositioned after the object is recreated (like in the object's Read() proc).īasically, what's going on, is the Read() proc internally relocates objects created from within an object's identity block within the savefile. In the case of turfs, the location of the turf is also recorded so that it can be recreated at the same position. If it is zero, the spawned code is scheduled to happen right after other existing events that are immediately pending. If delay is negative, the spawned code is executed before continuing in the main code. Statement may be a single statement or a code block enclosed in (optional) braces and indented.

#Byond save file editor how to#

I'll show you here how to save additional data, and not just less: There is one thing you really should do, though, which is save the player's location on the map. Yeah, I know I told you guys that it was going to be harder than "F << src", but with the setup work we did, it eliminates the need for the player to specify much of anything. set up your icons, icon_state, screen objects, screen locs, underlays, and overlays here. Var/savefile/F = new/savefile( "saves/ /. Well, because we implemented NeverSave as a separate callback, we can remove "icon" from the list like so: Now, let's say I want to later on down the road, allow a player to save their icon? So for this one and only variable, we let it save, then delete it. If you change the key, the client disconnects from the mob. Note here that I have to remove key from the savefile manually. If(src.underlays!=initial(src.underlays)&neversave.Find( "underlays")) If(src.overlays!=initial(src.overlays)&neversave.Find( "overlays")) because you can't just assign a list to overlays or underlays we want to get a local copy of the overlays and underlays if we don't have any defined nonsavables yet. (L) //return whatever the parent type does. L.Add( "icon", "icon_state", "overlays", "underlays") The reason I'm adding it as a separate function, is so that I can later specify that there are neversave elements that I want to remove from the list, thus allowing "neversave" variables to be saved by subclasses of an object that won't save them. The function itself is designed to build a list of variables that won't be saved every time it's run. We're going to introduce a new function to the mix, so that we can better control what we don't save later on down the road. For movable, I don't want to save screen_loc, and for mob, I never want to save the key. Looking through the reference, I don't ever want to save icon variables, icon_state, overlays, or underlays. We can actually do this by overriding the default variables for datum (already done), atom, turf atom/movable, mob, and obj. In order to use the saving system, we need to start telling the game what to save, and what not to save. It's not really that important that you deeply understand that bit of code. reset the values that may have been overwritten if the variable shouldn't be saved (tmp/const/global/static) check if neversave has been initialized as a list with contents Read( var/savefile/F, var/list/neversave=null) fall back to normal behavior if neversave is not set up.

byond save file editor

return whatever default would have returned.

byond save file editor

go back through everything and set it to whatever it should be. remove the variable as it won't save because it's the default value. and set the variable to default so it won't save. if it has been changed since runtime, store the current value in neversave. now, check if the variable would normally save. if the variable is not savable (tmp/const/global/static) just remove it, If(neversave!=null&istype(neversave,/list)&neversave.len>=1)

byond save file editor

make sure neversave has been initialized as a list with contents Write( var/savefile/F, var/list/neversave=null) modify standard saving/loading behavior a bit for all objects







Byond save file editor