Okay see, I have a problem where I was never really good at saving procs...so I need help on one...
Now, I expect the first reply to be, USE ONE OF THE LIBS OR DEMOS MORON N00B (or something to that effect.)
To reply to that now, I HAVE AND I HAVE PROBLEMS.
Okay, all of the Saving Codes I have ever used have one or more of the following problems
1) Does not work the way I want
2) Makes World Loadup INCREDIBLY SLOW and Ends up crashing DD/DS.
3) Crashes DD/DS on Save, causing a major problem + loss of data.
So, if anyone can help by making one without one of the LIBS or anything, reply with your email and I will email you more specific problems/what I really need.
AGAIN, I have TRIED the Demos and Examples and such all over the site, and I CANNOT get them to work as desired, please DO NOT post that I should use one. (I've already asked about something like this a while ago, and thats all I got, USE DEMOS/LIBS etc.)
1
2
ID:168516
Oct 3 2005, 3:28 pm
|
|
Oct 3 2005, 3:31 pm
|
|
Wrong category :P.
|
In response to Xeal
|
|
How So? I "Need" someone to help, which means it should be under the Classified Ads, besides, everywhere else I go I get flamed -_-
|
Developer How-To.
Deadron's CharacterHandling library and an example of how it's used. (I know you didn't want someone to tell you you should, but honestly, this works VERY well.) |
In response to Polantaris
|
|
Polantaris wrote:
How So? I "Need" someone to help, which means it should be under the Classified Ads, besides, everywhere else I go I get flamed -_- I think the topic you need is How-to... I don't see how you can't just read the savefiles section of the guide and not know how to use savefiles. Back when I first started DM. I had to learn all of the DM from just the reference. Cause back then there was no other source of information. O.o what seems to be the trouble with your savefile code? What are you wanting to do? |
In response to Green Lime
|
|
Green Lime wrote:
I don't see how you can't just read the savefiles section of the guide and not know how to use savefiles. Back when I first started DM. I had to learn all of the DM from just the reference. Cause back then there was no other source of information. So did I, but I never really understood the stuff with saving, hence the reason I need help...ANYWAY I need something like this... An Obj Saver that does the following: Saves ONLY Objs that have been modified (Ex. This is a Space game, so If I colonize a planet, I want it to save the planet changed, but if I never colonized the planet, don't save because planets are default added to the map file) Loads all SAVED Planets, and deletes all the planets that have a saved planet over them. (Ex. I Own Planet 1 and 2, but not Planet 3. When the world loads up, I want the ORIGINAL Planet 1 and 2, from the Map File, to be deleted and replaced by the saved Planet 1 and 2, but Planet 3 to be left alone, so that nothing happens to it.) No Duplicates (Ex. Several Times, I have gotten 1 and 2 to work, but then I get like 2 - 10 of the Non-Colonized version of that planet, over/under it. Not only does it screw up the stuff with the planets, but it also will very easily reach the obj limit.) Saves certain special planets. (Ex. There are "Markets" where while you do not colonize them, you can sell parts and resources to them, and other people can buy those parts that you sold. I don't want every planet saved, if its unnessicary, BUT I do want these planets to be saved specially because of their special function.) I've never been able to do ALL of that in one obj saver, and it's getting on my nerves. and so I need help. |
In response to Polantaris
|
|
Polantaris wrote:
Green Lime wrote: Save Da Planet! First part to using savefiles, saving (aka write). So we look at how we want are planets to be saved. How do you want them to be saved O.o. Lets just make a obj/planet code example bellow. obj/planet We'll do are saving when the world closes. So we add to the world/Del(). Normally a planet isn't owned by any one. So if it is we will save it. world/Del() Now we will re-write the write proc for are planet so it saves the location x,y,z. obj/planet/proc/Write(savefile/F) Load a Planet! Ok we have are planets being written to a savefile when the world ends. Now lets load the planets when the world begins. But before this we need to find the planets that are saved and delete them. world/New() Now we just need to edit the planets read proc so it sets the x,y,z values. obj/planet/proc/Read(savefile/F) No Duplicates (Ex. Several Times, I have gotten 1 and 2 to work, but then I get like 2 - 10 of the Non-Colonized version of that planet, over/under it. Not only does it screw up the stuff with the planets, but it also will very easily reach the obj limit.) |
In response to Green Lime
|
|
Okay, I changed a couple things because I have 2 Different types for Markets and for Planets (obj/Markets and obj/Planets) So, I'll repost it here because it's not working. If i changed anything vital accidentally, tell me.
obj/Planets/Write(savefile/F) That should be all of it, Please tell me what is wrong. |
In response to Polantaris
|
|
Polantaris wrote:
Okay, I changed a couple things because I have 2 Different types for Markets and for Planets (obj/Markets and obj/Planets) So, I'll repost it here because it's not working. If i changed anything vital accidentally, tell me. > obj/Planets/Write(savefile/F) That should be all of it, Please tell me what is wrong. Sorry but the loop statement while(!F.eof) dosn't even work. I just checked it with a test demo of the code above. I also just spent about an hour tring to figure out how to do a loop through a savefile. But can't get it to work. Does any one even know if its possible to loop through a savefile with a for loop? I tried F.dir but it didn't work either. |
In response to Green Lime
|
|
world/New() I beleive that would work. |
In response to CaptFalcon33035
|
|
What about normal Planets though? obj/Planets? I will try to dup it for Planets...See what I mean? I'm great with most of BYOND, but savefiles and such are so annoying + confusing to me.
|
In response to Polantaris
|
|
Okay, I added a new thing for the Normal Planets, it saves, loads, but I get Duplicates. I thought this line:
if(locate(P) in locate(O.saved_x,O.saved_y,O.saved_z)) del(P) was there to prevent that, but it's not working. Other than that, I don't see any major problems yet, I'll check around and repost if I find any. EDIT: On Markets, it does the same thing, I have 2 of the same Market when I tried to sell something to it and reloaded the game. And I'm not sure if it's saving the changes or not, I'd have to wait till it stops making dups to find out for sure. EDIT 2: Okay, I verified that it is saving everything inside Markets (By going by variables that are changed when saving) Though, I still have the problem with dups and I'm trying to fix that. I'll reply here if I figure out the problem on my own. |
In response to Polantaris
|
|
Polantaris wrote:
Okay, I added a new thing for the Normal Planets, it saves, loads, but I get Duplicates. I thought this line: if(locate(P) in locate(O.saved_x,O.saved_y,O.saved_z)) del(P) was there to prevent that, but it's not working. Other than that, I don't see any major problems yet, I'll check around and repost if I find any. if(var/obj/oldP in O.loc) // oldP then will equal any planet on the turf of O. |
In response to Polantaris
|
|
world/New() Yeah, I did not know if that would work or not, just didn't want to go through a for loop. Basically I also wanted to see what the reaction is when you do that, guess it doesn't work. This should work. |
In response to Green Lime
|
|
Uhmmm doesnt Move only work if something isn't there already? I just wanted to verify that because the Move thing shouldnt work if I rememeber correctly (or was that another Move thing?)
Edit: I used what you had, nothing. Then, I made it just O.loc = blah blah blah Still nothing. Seriously, This is why I had problems with the Obj Savers that are on the Libraries and such. So, someone really good at this crap really needs to help out here, nothing is working now -_- |
In response to CaptFalcon33035
|
|
Alright, since I still have no results from anything yet, I'll try this one... >_<
|
In response to Polantaris
|
|
GAHHHHHHHHH!!!!
It works, in a way. When I go to the Edit Variables Admin Command I have In game...I get the variables that are changed from saving the planet that arent there if I hadn't. Only problem: For SOME reason, my saved stuff isn't there!!! Okay, here's what I mean. In the Market, you can sell goods (A weapon let's say) to the Market, and get $$$. Then, someone looking for a discounted item, can go to the Market and buy that weapon from the Market, but ONLY if someone had previously sold it to the Market. Unfortunatly, that list isn't being saved! When I sell an item, I check the stock, make sure it's there. It is. Then I reboot the world, check the variables. All good. Then I try to buy that item back, but NO! It's not there! Any reasoning to this? |
In response to Polantaris
|
|
That is about the third time he has posted that and it's getting really annoying.
On another note, show us how you are coding these lists. |
In response to CaptFalcon33035
|
|
They are just lists in which I add types to them as they are sold/bought. This used to work, but then the obj saver I had overloaded easily (at about 50 saved planets) and I had to scrap it. Here's a jist of what I'm doing:
if(src.credits >= buying.price && src.storage - buying.space >= 0) They work, until I reboot, in which all the things in the list seem to be wiped from the list for no apparent reason. |
In response to Polantaris
|
|
BUMP
|
1
2