In response to Polantaris
BUMP Mk.2
In response to Polantaris
I don't think that is the problem. But, I guess you can try to make another list for each store. Then copy one list t the other and clear the original stock list. Then, when you load thm up, for every object in the other list, you add it to the stock.
In response to Polantaris
Yet another BUMP

Nothing I do fixes this. But I found something else. When I save the world, I have it say every Planet's path that is being saved. I get 2 versions of each "Market". Now I searched the Map File and everything else I can out of game for a duplicate version of the Planet. There isn't one. This tells me that for some reason, the code either makes another version of every planet that it needs to save (MY CODE DOESN'T DO THIS! EVEN UNTOUCHED MARKETS HAVE THIS PROBLEM) or makes one when it is saving. Either way it is making an extra version of each market upon save. This is the problem I assume. It saves over the planet that is supposed to be saved, unsaving the new market list. THIS NEVER happened before, which is the reason I believe that the new code that I implemented is the problem. Someone help, I cannot figure this out.
In response to CaptFalcon33035
No, that isn't the problem, BUT I found the problem (Read the new message I made) Unfortunatly I don't know how to fix it =/
In response to Polantaris
Bumpy Bump
In response to CaptFalcon33035
Thats a good idea, I'll try that, thanks.
In response to Polantaris
YES! I fixed it! I dunno why it was happening, but I made 2 vars based on nothing(var/stuff, not mob/var or obj/var etc) one for each market then I checked to make sure each planet goes with the correct stocks, saved to them, then loaded from them doing the same thing with an if statement:
    Del()
var/list/PlanetsSaved = new/list()
var/savefile/F = new("planets.sav")
var/savefile/R = new("markets.sav")
var/list/Markets = new/list()
var/list/Planets = new/list()
redstock = new/list()
bluestock = new/list()
greenstock = new/list()
for(var/obj/Markets/O in world)
if(O.owner)
for(var/obj/Z in O.stock)
if(istype(O,/obj/Markets/TerranMarket/))
bluestock += Z
else if(istype(O,/obj/Markets/RedMarket/))
redstock += Z
else if(istype(O,/obj/Markets/GreenMarket/))
greenstock += Z
O.saved_x=O.x
O.saved_y=O.y
O.saved_z=O.z
PlanetsSaved += O.name
Markets += O
R["Stock"]<<bluestock
R[""]<<redstock
R[""]<<greenstock
R["Market"]<<Markets

world
New()
..()
var/savefile/F = new("planets.sav")
var/savefile/R = new("markets.sav")
var/list/Markets = new/list()
var/list/Planets = new/list()
R["Stock"]>>bluestock
R[""]>>redstock
R[""]>>greenstock
R["Market"]>>Markets
for(var/obj/Markets/O in Markets)
for(var/obj/Markets/P in locate(O.saved_x,O.saved_y,O.saved_z))
del(P)
for(var/obj/Z in bluestock)
if(istype(O,/obj/Markets/TerranMarket/))
O.stock += Z
for(var/obj/Z in redstock)
if(istype(O,/obj/Markets/RedMarket/))
O.stock += Z
for(var/obj/Z in greenstock)
if(istype(O,/obj/Markets/GreenMarket/))
O.stock += Z
O.loc=locate(O.saved_x,O.saved_y,O.saved_z)
Markets -= O
d

NEW PROBLEM:

FRIGGIN PLANET SAVING DOESN'T WORK ALL OF A SUDDEN!

world
New()
..()
F["Planets"]>>Planets
for(var/obj/O in Planets)
O.loc=locate(O.saved_x,O.saved_y,O.saved_z)
for(var/obj/Planets/P in world)
if(P.loc == O.loc)
del(P)
Planets -= O

Del()
for(var/obj/Planets/O in world)
world <<O.owner
if(O.owner)
O.saved_x=O.x
O.saved_y=O.y
O.saved_z=O.z
Planets += O
F["Planets"]<<Planets


For a reason Unknown, that has ceased to function at all. I have no runtime errors either. Several Times I have tried different ways to doing it (that's why it probably doesn't look anywhere near the same as it used to.)

(NOTE: For anyone thinking about this, I AM NOT using 5 verions of world/New() and world/Del(). I just cut off all the extra stuff because they are BIG and I don't want to clutter the post)

Minor Problem: If I accidentally Load 2 versions of the game or something, I get a problem with the market.sav being in use. It's not a game ending problem, but is there anyway to stop using certain codes automatically if the Save Files are in use, and to display a message about it?

THANKS TO EVERYONE FOR THEIR HELP!
In response to Polantaris
BUMP
Still nothing =/ Can anyone help? My Market finally works, but the friggin Planet saving is broken again! Someone help!
Page: 1 2