ID:157565
 
How would I go about creating a savefile like this:

There is a list of verbs in the savefile. In this list is an ordered group of 1's and 0's. If there is a 1, you give the user their verb when they log in. If there is a 0, they dont. (or 1 and nothing, w/e floats the boat)



An example with &:

skills = "1&1&1&1&1&&&&&&&&&&&&&&&&&&&&&&&&&&&&1&1&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"

An example of list iventory:

inv = list(50,1,555,34,1,56,17,0)
Can you maybe explain what you're talking about a little better. From what I read, I assumed you were working with 2 lists, one filled with verbs, the other filled with (1 or 0) corresponding to the verb found in the same position in the other list. Except what you said afterwards has nothing to do with this, where you showing a list of seemingly random numbers.

I'd comment on the other stuff you're talking about, but until you explain yourself more clearly, I'd rather not make any suggestions.
In response to Keeth
Basically what I would like to go about doing (and I'm not too particular on it) is to make a list in which there would be 2 differentiating operators (could be nothing there at all) and if one of the operators is in the person's save file, they will have the according verb added when read (or logged in). I'm really not sure where to start, I'm not asking for somebody to code me something, but if somebody could give me a small example with the commands I should look up in reference, that would be cool! (Thank you for helping for at least reading this).

In other words, a numerical list that decides whether verbs should be added or not, like if somebody obtained a skill, in this

skills = list(0,0,0)

It could change to:
skills = list(1,0,0)

and because that 1 was there, the verb would be added when the savefile was read to their commands.

Or maybe im misenterpiting this and it is deciding if it is set hidden or not? Maybe there is an easier way to do this?
In response to Darkjohn66
Since verbs automatically save why can't you use a simple add or remove verb system?

for instance give the players all the skills you want them to have at the beginning and the ones you don't make it so that must acquire or learn them.

It seems kind of obvious so I may not be grasping the full weight of what you are trying to ask, if that's the case my apologies.
In response to Dariuc
Verbs don't automatically save. You have to save them manually.

I'm not quite sure why it's necessary to have a list and needing to encode/decode it, though. Just save and load the verbs list.
In response to Kaiochao
I'd like to have small save files which would be easy to manipulate in a save editor.
In response to Darkjohn66
Why would you want the saves to be easy to edit in a savefile editor? I fail to see the point of doing that to your own game. Just edit them in DM through the game code.
In response to Gunbuddy13
if only this was commented a bit more. I know the basics but really dont get how it truly works. (OBJ save demo) I know this isnt exactly what I was talking about but this would help to understand, and thanks!

/*
OBJ SAVING with a list.
*/



#define DEBUG
world
mob = /mob
turf = /turf

var/list/objs = list ()

world/New()
..()
if(fexists("Map.sav"))
var/savefile/F = new ("Map.sav")
F >> objs
for(var/obj/o in objs)
o.loc = locate(o.lastx, o.lasty, o.lastz)
objs.Cut()
return ..()

world/Del()
var/savefile/F = new("Map.sav")
for(var/obj/o in world.contents)
o.lastx = o.x
o.lasty = o.y
o.lastz = o.z
objs.Add(o)
F << objs
return ..()

mob
icon = 'mob.dmi'
Stat()
..()
statpanel("OBJS", contents)
Login()
for(var/i = 1, i < 3, i ++)
new/obj/obj1(src)
new/obj/obj2(src)
return ..()
obj
verb
Drop()
set src in usr
Move(usr.loc)
var/lastx
var/lasty
var/lastz
obj1
icon = 'obj1.dmi'
obj2
icon = 'obj2.dmi'

turf
icon = 'turf.dmi'
In response to Kaiochao
I've never had to save any of the verbs i use for my mob. Then again i've never had to add any verbs either. I use objects to handle skills and such.
In response to Dariuc
The difference in size is negligible and decoding a sequence of 1s and 0s is not any easier than having, you know, the actual type paths written out for you.

Of course, you should be using objs to represent dynamic access to actions, rather than directly modifying the verbs list anyway, which you're already apparently doing and will automatically be saved. So, I don't see any problem.
// writing
var/savefile/sfile = new("asavefile.blah")
sfile["alist"] << list("this is", "a list", 123) // write the data to the "alist" entry in the savefile

// reading
var/savefile/sfile = new("asavefile.blah")
var/list/alist
sfile["alist"] >> alist // read the data from the savefile entry "alist" into our alist variable.


Please consult the reference for more information about savefiles, the datum procs Write() and Read(), and lists.
In response to Keeth
Say I wanted to check a certain spot in the list. If that certain spot was equal to the value I wanted, when the savefile was read, it would do some kind of action such as outputing a message.
In response to Darkjohn66
You read the list using the method I just provided, and then you treat the list like a list. If you don't know how to use lists, there is a reference.