• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Quicksave Mod

dchaley

Landlubber
Argh, maties!

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" /> I've been doing me reading in the code and after some well placed swoops of me text editing blade I think I have quicksave nearly fit for sea!

(pirate speak off)

So yeah, I have it saving, although for some reason you have to press the button twice. (Hmm.) Now I just need to get it to load as well, but that should be trivial.

Turns out that saving is a scurvy little monster. You can't just copy/paste the saving code, noooo, that gives you corrupted save files. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />

So my method is a little roundabout but it works - it's simulating the clicks on the menu and all that. You actually "see" the menus go by, and it's basically doing the clicking on 'save', 'save' for you.

Loading should be more straightforward since there aren't issues with taking screenshots for the saving.

I don't know why it is exactly that I can't save in a more direct way, but after two hours of trying I'm ready to settle for a roundabout way. As long as I just have to press one button and it will save. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />

So my `todo-list` for now is:
1- make it load
2- make it so that you only have to press save once, not twice, for it to save the file.
 
David, what happens if you are up to your limit in saves? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Uhh... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" /> I hadn't thought of that...

Well, with my original method (the one that doesn't work) it wouldn't have been a problem since it didn't go through the interface in the first place.

I suppose that I could make an extra, reserved slot that can't be saved normally and can only be the quicksave? Would that work out? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
that's how quicksaves normally work. but doing it that way would mean figuring out how to do it directly from the code rather than via the interfaces. (i hope cat won't mind me inviting you to use this if you feel it necessary: <img src="http://www.ganotherapyusa.com/extras/modding.gif" border="0" class="linked-image" />) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />

do any error messages appear in the log when you try to save a game directly from the code?
 
<!--`QuoteBegin-Kieron`+--><div class='quotetop'>QUOTE(Kieron)</div><div class='quotemain'><!--QuoteEBegin--> (i hope cat won't mind me inviting you to use this if you feel it necessary: <img src="http://www.ganotherapyusa.com/extras/modding.gif" border="0" class="linked-image" />) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />[/quote]Oh heck no. Matter of fact, I toyed with the idea of putting him into the smilies mix, but I'd want him to be piratey somehow, and the head bashing into the monitor just doesn't lend itself to either the bandana OR the hat. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
 
Yeah, saveload is a _beast_.
I _still_ don't really understand it, and I've been poking around there off and on for a year. Mostly to try to fix the faces are all #0 bug.

It _looks_ like if you have a temporary object to hold all the data from SettingDataForSave, and you have either copies of the functions called by it and processsave or `copy-paste` the code directly in, you could do it without the interface.

But it sounds like you already tried that. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

You can at least override GetCurSaveName so it saves as quicksave rather than the loc+date string it does now I think.


The save limit IMO should just be tossed. There's no real reason for it I can see, other than not overloading the memory of POTC which would be IMO vanishingly unlikely with any reasonable number of saves (and they're only 64x64 pictures and titlestrings, the rest of the save's data is not I think loaded.)

Good luck! A QS would be an _excellent_ feature!
 
At the moment, I've mostly finished the saving part - that works *most* of the time, even though you have to press it twice for some strange reason. (However, since that global isn't working, currently you can only quicksave and not save. :p)

Loading, as I suspected, works with no problems at all.

It looks like I'll have to go back to the `direct-code` method. I don't understand exactly what needs to be done, though. It seems that the save_load.c functions do a <b>lot</b> of stuff, and I originally thought it was all just interface related i.e. just displaying stuff. Now, however, I have the impression that some of it might be necessary.

My first solution - the one I got done in an hour and expected to work straight away - was saving corrupted files. That is, a normal save produced a 3.4 mb file, but my version only produced a 3.1 mb file. I don't know what is in those extra 300k - I *suspect* that it's the screenshot.

So my next attempt was to copy the screenshot code, but that meant going in and creating 'interface textures' or something like that. Furthermore I could never actually test it, because of that blasted 'ghost A reference' error - which seems to occur whenever I had *any* kind of global. (Very weird.)

So that's where I stand at the moment. I've been playing all day to get spirits up, and will soon eat dinner before getting ready to tackle this again.

This is one of those plans that didn't survive contact with the enemy. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/urgh.gif" style="vertical-align:middle" emoid=":urgh" border="0" alt="urgh.gif" />
 
Hmm.
It seems to me you'll need to have or duplicate:
ProcessSave()
Which calls
GetCurSaveName (change this to always output quicksave)
SettingDataForSave (use a temporary object instead of GameInterface, as SaveGame() needs that data? And ParseSaveData is tied to that methinks).

Plus the screenshot stuff.

Hmm.
Maybe best to (for now) leave out the screenshot and `officer-pics`?
(If that's possible)
 
I don't think leaving out the screenshots is an option. What seems to happen is that the save/load screen tries to read in the screenshots from the saved game, and if it doesn't find them it goes hiccup and declares the file to be corrupt.

I suppose I could hack that and make it not declare quicksaves to be corrupt?

Still, I'd rather find the 'right' way of doing this. Now that I know what that error message was, and now that I've done some more reasearch, I think I know what my mistake was.
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->The save limit IMO should just be tossed. There's no real reason for it I can see, other than not overloading the memory of POTC which would be IMO vanishingly unlikely with any reasonable number of saves (and they're only 64x64 pictures and titlestrings, the rest of the save's data is not I think loaded.)[/quote]

the only 'pro' i can think of is the fact that it takes years to scroll from one end of the scrollimage to the other <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
I have finished the first version of the Quicksave mod, and uploaded the code to the CVS server.

So the CVS server currently has:
Build 11 + updates + quicksave

Press F5 to quicksave and F9 to quickload.

Here are the caveats: (there just had to be some eh? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />)
- A quicksave will not have a screenshot in the load list
- If you quicksave when there's already a quicksave, the new one will be in the same place as the old one in the list.

I have not tested quicksaving when you've used up all 40 slots, but it <b>should</b> work.

Use at your own risk - if you lose a saved game or something don't come looking for me! *ducks* <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dev.gif" style="vertical-align:middle" emoid=":d:" border="0" alt="dev.gif" />

Have fun, let me know if you have any suggestions or anything.

Future version <b>might</b> fix the screenshot issue but I doubt it. I've reached the "good enough" stage, and the "good" stage is many hours of work ahead. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/pirate2.gif" style="vertical-align:middle" emoid=":p:" border="0" alt="pirate2.gif" />
 
Sounds great!
Good job. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<!--`QuoteBegin-dchaley`+--><div class='quotetop'>QUOTE(dchaley)</div><div class='quotemain'><!--QuoteEBegin-->Here are the caveats: (there just had to be some eh? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />)
- A quicksave will not have a screenshot in the load list
[/quote]

how did you sort it? did you create a 'quicksave' texture that is always used?

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->- If you quicksave when there's already a quicksave, the new one will be in the same place as the old one in the list.<!--QuoteEnd--></div><!--QuoteEEnd-->

is it possible to sort that by editing the 'fillscroll' function?

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Future version <b>might</b> fix the screenshot issue but I doubt it. I've reached the "good enough" stage, and the "good" stage is many hours of work ahead. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/pirate2.gif" style="vertical-align:middle" emoid=":p:" border="0" alt="pirate2.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->

i honestly don't think it's a problem at all not to have a screenshot. the quicksave isn't really designed for saving the game and returning after lots of time, when you need the screenshot to remind you which game it is, but to provide a quick emergency save in case of game over / crash, no?
 
No, I didn't create any screenshot at all - I just left it with the plain old default "Bad Save" error picture. *grin* But I suppose I could make a cute little 'Quicksave' texture, that might look nicer!

And yeah, I'll see what I can do regarding sorting the fillscroll function - but to be frank I don't want to mess with that too much since the game seems rather finicky about what goes there.

Besides, that brings me to another caveat - you can't load the quicksave from the load menu, because it thinks the save is corrupt. Perhaps I'll rework that code to let you load it if it's corrupt but a quicksave...

And yeah, quicksave is meant for very frequent saving. Now that I have it, I'm saving once every few minutes. *grin*

Incidentally I don't know what happens if you try to quicksave while at sea (e.g. during battle.) It might work, but I've never tried it. Next time I play I'll see what happens. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
It's separate. It doesn't interface with the scroll at all, so it just writes a file called "quicksave". Now again, I admit that I haven't tried to fill up my save scroll and quicksave <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> But, the save limit is just a limit to the size of the scroll. Chances are, if you were to fill up your scroll and then quicksave, you just wouldn't be able to scroll to it.

If it's an issue, I could expand the scroll by one, and reserve that final slot for the quicksave only. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
If you could work it so that it would continue to save over itself, and have a slot reserved ONLY for itself, AND a way to load from somewhere, that would be very cool... I am guessing you're working towards that end. I only ask the questions I do so as to help the process along (I hope!).

Here's a neat piratey lock pic you might use to make the "quicksave" icon/pic:

<img src="http://www.ganotherapyusa.com/extras/snblock_a.jpg" border="0" class="linked-image" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Well, it already writes over itself, and you can quickload at any time as long as you're in the game already (and not from a menu.) But I will definitely at some point let you load from the menu, and if I'm feeling adventurous I'll also have it reserve a slot. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/pirate2.gif" style="vertical-align:middle" emoid=":p:" border="0" alt="pirate2.gif" />

Hey, that is a pretty cool picture. I'll definitely use that if I give the quicksave its own texture. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

And hey, no worries about the questions! They're most welcome. It shows that there's interest in the mod and that's the whole point, isn't it? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
<!--`QuoteBegin-dchaley`+--><div class='quotetop'>QUOTE(dchaley)</div><div class='quotemain'><!--QuoteEBegin-->And hey, no worries about the questions! They're most welcome. It shows that there's interest in the mod and that's the whole point, isn't it?  :onya[/quote]<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/blush.gif" style="vertical-align:middle" emoid=":eek:ops" border="0" alt="blush.gif" /> Well I didn't want you to think I was being demanding, or anything. Most of my questions are meant to stimulate the creative process along...

And HECK YEAH there is INTEREST! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
You betcha there's interest!
I couldn't get it to work right before, but now it does, and it's great! Woohoo and thankyou!
 
Back
Top