Page 1 of 1

Elven Island

Posted: Thu Nov 29, 2012 9:56 pm
by Cindy
Anyone have a waypoint file for the quests in elven island by chance?

Re: Elven Island

Posted: Fri Nov 30, 2012 8:54 am
by Cindy
Well, I tried to make a WP for elven island, using the 0 option to insert code as I went along. Unfortunately after about 10 quests createpath crashed with "Macro text too long", so now the WP is gone, and I can't redo the quest recording... so.. can we have createpath autosave the file after each WP?

Re: Elven Island

Posted: Fri Nov 30, 2012 9:06 am
by rock5
I suggest you don't try to do 10 quests in a row. Break it up into smaller parts and then merge them together later. Also, to avoid that error, leave adding long complex code until after you save the file. Just add a comment to let yourself know where to insert the code later.

Although I am a bit interested in the idea of auto saving your progress. There are many situations in which you could loose your work and it would be nice to be able to recover the work already done. This would require either asking for the file name first or saving to a temporary file that gets renamed or copied later to the new name. I'll think about it and see how difficult it would be.

Re: Elven Island

Posted: Fri Nov 30, 2012 9:37 am
by Cindy
Yea just open a temp file, "Createpathautosave.xml", at each WP save just write to file and flush. :)
Essentially like logging to a file, at each waypoint press.

Re: Elven Island

Posted: Fri Nov 30, 2012 10:37 am
by rock5
I was thinking of writing each line. The 'saveWaypoint' function is already set up to write each line in the table one at a time. I thought I could change it to writing only one line then, each time a line is saved to the table it saves it instead by calling that function.

I was a bit worried about how long it takes for it to open a file, write to it and then close but I just tested it. It's very fast.

Re: Elven Island

Posted: Fri Nov 30, 2012 11:50 pm
by rock5
Ok, this took me longer than expected because I couldn't get the numbering working properly.

Anyway it's working now. It's based on the RC version which fixed the numbering in the file. I made the extra effort and made it so it saves the waypoint each time you press the waypoint or harvest buttons, instead of after every line. I did this because, in another version I did for my own needs, I managed to add a button for adding a waypoint tag and I wanted to leave open the possibility of adding it to this version too. And for me to be able to do that you would need to add the tag before saving the waypoint.

I named the temporary file "_recoveryfile.lua". When it saves it, it actually just renames it. If the renaming fails it will print an error message and ask you to try again.

Let me know what you think.