ID:174043
Oct 8 2003, 5:48 pm
|
|
if i make global variables under world like team pts are these automatically saved or is there a proc needed from time to time so that all is not lost if world sleeps/crashes? Thanks
|
Oct 8 2003, 6:18 pm
|
|
I made a world save and world load so if my world goes down for any reason its saved and its loaded when it goes back up.
|
In response to Aridale
|
|
ok..I'm a total newb.well not total I guess since I do have 200 rooms in this game LOL they just don't do much right now. I haven't worked on the character saving or loading so I'm not sure how to save the world either LOL Is there an easy way to do this once I get the variables identified that need to save?
|
var
BlueTeamPoints = 0 RedTeamPoints = 0 GreenTeamPoints = 0 world.New() ..() var/savefile/F = new("Worldvars.sav") F["BTP"] << BlueTeamPoints F["RTP"] << RedTeamPoints F["GTP"] << GreenTeamPoints world.Del() ..() var/savefile/F = new("Worldwavs.sav") F["BTP"] >> BlueTeamPoints F["RTP"] >> RedTeamPoints F["GTP"] >> GreenTeamPoints |
In response to Buzzyboy
|
|
just 1 question--why do the save files get different names? thanks
|
In response to Illiania
|
|
Because he made a typo, you should probably fix it.
|
In response to Nadrew
|
|
Here's my world code (variables are all defined above this)
world New() //overrides the world's New() proc for (var/Atype in typesof(/area)) //loops through area prototypes var/area/A = new Atype //creates a new instance of each prototype A.tag = A.name //makes its tag the same as its name ..() //calls the parent var/savefile/F = new("Worldvars.sav") F["GPTS"] << gryffindorpts F["SPTS"] << slytherinpts F["RPTS"] << ravenclawpts F["HPTS"] << hufflepuffpts F["HB"] << headboys F ["HG"] << headgirls F["Gry"] << gryffindor F["Sly"] << slytherin F["Rav"] << ravenclaw F["Huf"] << hufflepuff F["Pre"] << prefects Del() ..() var/savefile/F = new("Worldvars.sav") F["GPTS"] >> gryffindorpts F["SPTS"] >> slytherinpts F["RPTS"] >> ravenclawpts F["HPTS"] >> hufflepuffpts F["HB"] >> headboys F ["HG"] >> headgirls F["Gry"] >> gryffindor F["Sly"] >> slytherin F["Rav"] >> ravenclaw F["Huf"] >> hufflepuff F["Pre"] >> prefects When I compile I get: loading hogwarts.dme hogwarts.dm:32:error::invalid expression hogwarts.dm:31:F :warning: variable defined but not used hogwarts.dm:48:error::invalid expression hogwarts.dm:46:F :warning: variable defined but not used hogwarts.dmb - 2 errors, 2 warnings (double-click on an error to jump to it) when I take out the invalid expression lines, the next line down becomes the invalid line. I'm not familiar enough with this (or understand it, although I'm reading the guide). Unfortunately I'm a hands-on learner LOL Anyone see the problem? |
In response to Illiania
|
|
Makin a HP game huh? =) I love HP =) As for your question and errors tho I have no idea =( only thing I see wrong is F ["HG"] << headgirls it should be like the rest and no space after F and before [ other than that I dont see what the problem is without tryin to compile the source mahself.
|