ID:178362
 
alright, let's get a couple things straight. In the year that I've been on BYOND (only been coding for about 7 months), I've asked for code three times. I'm very proud of my self. It seems that I may have to make it four times. I am pledging, though, that I will NOT use this code until I know exactly what it does, and how it does it. I take pride in my reasoning ability :P


Ok- How can I make a save system, so that it asks the player which of the following he wants to save-
say_color
VARS (This is a list full of variables)
who
he can choose one, two or all three. No other vars are saved. I also need it set up so that there can be multiple characters per player. Thanks for your time!

Airson
Airson wrote:
Ok- How can I make a save system, so that it asks the player which of the following he wants to save-
say_color
VARS (This is a list full of variables)
who
he can choose one, two or all three. No other vars are saved. I also need it set up so that there can be multiple characters per player. Thanks for your time!

Well, since the choice is made at runtime, you can't use var/tmp to set these up individually. What you're going to have to do is build a special mob.Write() proc to handle this, and set all these to temporary vars.
mob
var/tmp/say_color
var/tmp/list/VARS
var/tmp/who

var/saveflags=7

Write(savefile/F)
if(saveflags&1) F["say_color"] << say_color
if(saveflags&2) F["VARS"] << VARS
if(saveflags&4) F["who"] << who
F["saveflags"] << saveflags
// don't call ..() if you don't want other vars to save

Read() should function normally without having to override it.

Lummox JR