I’m wanting to make an AutoSave mod so that the game saves regularly during the alpha so that people don’t loose everything because they have saved recently.
Although there is a big problem,
I don’t know how to approach creating the modification.I have unzipped the stonehearth.zip ,had an explore around and looked at some of the files.
I would appreciate it if someone could point me into the right direction of how to make this modification.
Below is a list of all the features I wish this mod to cover.
Auto Saving works similar to Fallout 3, where the auto-save is shared between all saves.
Currently the autosave directory is located $(stonehearth_install_path)/saved_games/autosave. In theroy it would be possible to add a few different auto-saves and cycle between them. This is something else Fallout 3 did.
As for the quick save hot key, I tied it to ‘Tab’, for whatever reason. The way this works is the first time the player uses quick save a new save entry is created, from this point on any other quick save will overwrite that data.
As of now their is a small bug, in that the auto-save maintains it’s self on top of the save entry list, reguardless of if it’s the last modified save. I think this has something to do with how I’m getting the date and time. The normal save functions begin on the html/js side of things, my code is on the lua side. Therefore I used lua functions to get at the time and date. I’m sure it can be worked out though.
To me it’s a lot of fun messing around with Stonehearth, especially on the modding side. As I said before, how much pointing do you want? Is this something you’d like to figure out on your own, with a little help, or would you like my work I’ve done so far, so that you can extend it to fit the rest of your concept.
I’m really glad that you liked the idea of autosaving. I think that its especially important to have in alphas and betas when there are loads of bugs and crashes that occur.
I first learnt LUA ages ago when I was playing Roblox, and even that wasn’t proper LUA. However that was a few years ago so i’m still trying to remember stuff and re-teach my self LUA.
If possible could I view your current code to see how you made this mod and how it used the implemented features of StoneHearth. I’m currently very new to modding games so it would be amazing to see how you made this mod
Anyone planning on using this as a mod must rename the download to autosave.smod.
As a side note, the auto-saving it set to happen every 5 minutes. I never tested with such a long wait time, I hope the timers allow for it. Other than that possible but unlikely snag we should be good to go.
On a side note, I don’t know if this mod would help against the ‘deleted saves’ bug. It’s super useful for people who forget saving and have crashes, but I’m worried for the people who’s getting the bug. Luckily we’re getting more information recently about when it happens and such.
The best experience is doing. One of the best learning source is others work. I would only suggest this if you have some basic knowledge, otherwise I’d recommend getting some background knowledge first.
You don’t just have to learn lua, all programming languages basically go back to the same root subjects, variables, functions, ect. Learning one proficiently will help with others. If you have the interest I would try learning something like C#. It’s very simple and straight forward and easy to get into, compared to say C++.
Here’s Microsofts IDE, it’s free and feature complete, note they have older version’s if you are running Vista and below.
I have never watched them but Jamie King on youtube has videos on the C#.
And many more. Overall the Internet is riddled with tutorial C# videos, find someone you enjoy watching.
Lua is different from C# but your understands will carry over.
I use this to look through Stonehearth lua files. The main thing it does is format the minified files, making them much more readable. It also supports searching for text, and provides highlighting. Overrall it has some problems, but I currently use it everytime I go to do work on Stonehearth.
Best of Luck
My hope is that because my code never calls any of the delete save functions, and re-uses save keys, that the ‘deleted saves’ bug wont be an issue. I can’t say for sure though. But thanks for the concern