[unsolvable] How to modify Wesnoth save files?

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
ZombieKnight
Posts: 147
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

[unsolvable] How to modify Wesnoth save files?

Post by ZombieKnight »

Hi
I'd like to modify some wesnoth save files (to make an event one-time-seen).
How to do so?
Last edited by ZombieKnight on April 20th, 2024, 6:02 am, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
white_haired_uncle
Posts: 1202
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: How to modify wesnoth save files?

Post by white_haired_uncle »

Do you mean the start of scenario save, or from some arbitrary turn?

If the latter, how is the event created? If it is created dynamically, are we to assume it has been created at the point of the save, or not, or would this be unknown? Assuming the event has been created at the point of the save, are we to assume the event has not been triggered, has been triggered exactly once, has been triggered at least once, this is unknown?
Speak softly, and carry Doombringer.
User avatar
Celtic_Minstrel
Developer
Posts: 2233
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to modify wesnoth save files?

Post by Celtic_Minstrel »

The title of this topic is wrong. It should not be "How to modify wesnoth save files?" but rather "How to make an event one-time-seen?". You've started by deciding that you know the correct way to approach your problem and asking how to achieve that approach, rather than presenting the problem itself and asking how to approach it.

I don't know how you imagine modifying save files would achieve your goal of making an event "one-time-seen", and I'm also not entirely sure what "one-time-seen" means, but… if your goal is that the player can only see the event once ever, even if they play through again, then you should be looking at PersistenceWML. And if you want the event to trigger only once per playthrough… that's the default for how events work. But if the event can occur in multiple places and you want only one of those events to trigger in any given playthrough, then all you need to do is set a variable when the event triggers and add [filter_condition] to the event so it doesn't trigger if the variable is set.

If any of the above paragraph hits the mark, then this is also in the wrong forum and should be moved to WML Workshop.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
ZombieKnight
Posts: 147
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify wesnoth save files?

Post by ZombieKnight »

I basically don't want to allow player to save after the event is fired and reload it (it's one, where you could get perfect outcome if you'll repeat it once)...


Also... How to disable saving or something, to make a hardcore mode without reloading (except the start of a scenario and last-progress save)?
I'm not sure, how to describe it, but I'd like to allow player to save only one position(basically before quiting wesnoth) and then let it to reload only once(so player can't save and load).
Is my aim clear?
Any idea how to make so?
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Celtic_Minstrel
Developer
Posts: 2233
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to modify wesnoth save files?

Post by Celtic_Minstrel »

There's no facility to disable saving. That goes against the spirit of the game.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Ravana
Forum Moderator
Posts: 3011
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: How to modify wesnoth save files?

Post by Ravana »

You can use https://files.wesnoth.org/addons/1.14/U ... od.tar.bz2 style to achieve such effect.
User avatar
ZombieKnight
Posts: 147
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify wesnoth save files?

Post by ZombieKnight »

Thanks, I'll take a look.
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
ZombieKnight
Posts: 147
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify wesnoth save files?

Post by ZombieKnight »

How does it work??? tryied it on SotBE... but I can reload after loosing units
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Ravana
Forum Moderator
Posts: 3011
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: How to modify wesnoth save files?

Post by Ravana »

After reload unit is still dead.
User avatar
ZombieKnight
Posts: 147
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to modify wesnoth save files?

Post by ZombieKnight »

True sorry, I've found a way to track the last save, but Is a bit dangerous as a player can loose its saves completelly, if he for example moves a unit after saving and then just quits the game...
I had saurian in profile before, but I've merged my discord profile with forum one...
Post Reply