No Autosaving
Moderator: Forum Moderators
No Autosaving
Hey everyone, I was attempting to disable autosaving in an RPG scenario, and instead go for a manual save so that there would be no cheating involved. I cannot disable the save mechanism, so I tried to utilize the :nosaves command.
This is from menu_events.cpp for some context:
And from game_config.cpp:
How would I change "disable_autosave" to true if it is in C++? I know you can in Lua. Or could I just fire command "nosaves" somehow? Help would be very appreciated here.
This is from menu_events.cpp for some context:
Code: Select all
void do_nosaves();
...
register_command("nosaves", &console_handler::do_nosaves,
_("Disable autosaves."));
...
void console_handler::do_nosaves() {
game_config::disable_autosave = (get_data() != "off") ? true : false;
Code: Select all
std::string wesnoth_program_dir;
bool debug = false, editor = false, ignore_replay_errors = false, mp_debug = false, exit_at_end = false, no_delay = false, small_gui = false, disable_autosave = false;
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: No Autosaving
You somehow seem to miss that C++ code is not part of any addon. You can use such modifications only personally on your computer with your own recompiled wesnoth binary. Unless others don't happen to have your recompiled binary they won't be affected.
Other than that, afaik there's no support for this in wml or the lua interface.
Other than that, afaik there's no support for this in wml or the lua interface.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: No Autosaving
It wouldn't be a bad idea to expose it though. It's useful in other scenarios also. In some WML-heavy scenarios saving can take a long time, so it's recommended to have autosaves off.
Re: No Autosaving
If so, then I would make the preference a three-way one:AI wrote:It wouldn't be a bad idea to expose it though. It's useful in other scenarios also. In some WML-heavy scenarios saving can take a long time, so it's recommended to have autosaves off.
Autosave:
- always
- when not disabled by WML
- never
I (as a user) don't want a campaign designer to disallow me using autosaving. (I would be forced to save manually each turn.)
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: No Autosaving
If this happens the author should use lua or new wml tags and structures to reduce wml bloat instead. Custom events instead of macros etc.pauxlo wrote:In some WML-heavy scenarios saving can take a long time, so it's recommended to have autosaves off.
I don't feel comfortable about autosaving compulsorily disabled too.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: No Autosaving
You're welcome to refactor some of the 10k+ line scenarios we have in wesnoth-umc-dev.
Anyway, making features take less code won't reduce the size of the code, it will increase the number of features. That's how these things tend to work.
Anyway, making features take less code won't reduce the size of the code, it will increase the number of features. That's how these things tend to work.
Re: No Autosaving
I'm not worried about saving taking a long time or WML bloat. See below.
A. Create an event/WML function/Lua function to disable autosaving. Then I can set a menu item for the user to save under the right conditions (most effective IMHO).
B. Create a new event type (name=save) with [filter_condition] to use my custom variable refreshing. This would be the easiest, but would rather defeat the purpose of no autosaving.
C. Create a function to delete saves. This would be less effective than the first, but may work. However, I doubt that this would work, as saves and user files are protected. Unchecked, this could potentially allow a campaign writer to delete the player's hard drive or something drastic like this.
D. Warn the user not to save because files may be corrupted and just deal with the consequences (bleh).
I want to create a new way of saving. A.K.A only let the user save out of non-combat/stress situations. This way data still gets saved, but no save loading. Also, this has to happen because every time the user saves I have to reset and refresh certain variables. The solutions to this problem are:pauxlo wrote:I (as a user) don't want a campaign designer to disallow me using autosaving. (I would be forced to save manually each turn.)
A. Create an event/WML function/Lua function to disable autosaving. Then I can set a menu item for the user to save under the right conditions (most effective IMHO).
B. Create a new event type (name=save) with [filter_condition] to use my custom variable refreshing. This would be the easiest, but would rather defeat the purpose of no autosaving.
C. Create a function to delete saves. This would be less effective than the first, but may work. However, I doubt that this would work, as saves and user files are protected. Unchecked, this could potentially allow a campaign writer to delete the player's hard drive or something drastic like this.
D. Warn the user not to save because files may be corrupted and just deal with the consequences (bleh).
Think of this in an RPG situation. In the Pokemon games, the only places that saves were allowed were outside of the battle scenes. In Wesnoth, it is all too easy to save-load to get the right hits you want.Anonymissimus wrote:I don't feel comfortable about autosaving compulsorily disabled too.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: No Autosaving
There is wesnoth.game_events.on_save in 1.9 wich is a lua function called every time a game is saved. So you could sort of warn that autosaves must be disabled and when this function is called fire [endlevel]result=defeat (which you can make dependant on whatever variables you want). This affects manual saves and autosaves, not sure whether the function is not called at all then.bigkahuna wrote:Also, this has to happen because every time the user saves I have to reset and refresh certain variables.
...
B. Create a new event type (name=save) with [filter_condition] to use my custom variable refreshing. This would be the easiest, but would rather defeat the purpose of no autosaving.
Agreed. And IMHO some difficulty reports would suddenly start to shift from "bah this is so easy" to complaints.Think of this in an RPG situation. In the Pokemon games, the only places that saves were allowed were outside of the battle scenes. In Wesnoth, it is all too easy to save-load to get the right hits you want.Anonymissimus wrote:I don't feel comfortable about autosaving compulsorily disabled too.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign