Topic: Does modifying campaign level scripts change them in savegames?

Sauss-Ente
Avatar
Topic Opener
Joined: 2025-06-15, 22:00 UTC+2.0
Posts: 5
OS: Windows 7 / Linux
Version: 1.2.1
Ranking
Just found this site
Posted at: Yesterday 20:39 UTC+2.0

Very specific question. I'm trying to modify a lua script in one of the campaign levels and would like to apply it to an existing savegame. The script files for savegames (on loading them) aren't taken from their "original" campaign folder, are they? Does some kind of debug option exist to do so?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16 UTC+1.0
Posts: 2842
Ranking
One Elder of Players
Location: Bavaria
Posted at: Yesterday 21:57 UTC+2.0

Unfortunately there is no option to apply changed scripts to a savegame.
the scripts (in their actual state) are saved within the binary savegame. even modifying them in the map folder saved with the savegame does not change anything in the game.

Edited: Yesterday 21:57 UTC+2.0

Top Quote
Ron_of_Nord
Avatar
Joined: 2024-04-20, 23:43 UTC+2.0
Posts: 188
OS: Windows
Version: 1.3
Ranking
Widelands-Forum-Junkie
Location: Land_down_under
Posted at: Today 04:30 UTC+2.0

Sauss-Ente wrote

Very specific question. I'm trying to modify a lua script in one of the campaign levels and would like to apply it to an existing savegame. The script files for savegames (on loading them) aren't taken from their "original" campaign folder, are they? Does some kind of debug option exist to do so?

Isn't that cheating ? Unless you're debugging your own script I suppose...


The aussies are coming, ya ho! ya ho!

Top Quote
Sauss-Ente
Avatar
Topic Opener
Joined: 2025-06-15, 22:00 UTC+2.0
Posts: 5
OS: Windows 7 / Linux
Version: 1.2.1
Ranking
Just found this site
Posted at: Today 08:56 UTC+2.0

Ron_of_Nord wrote

Isn't that cheating ? Unless you're debugging your own script I suppose...

You're right, if the savegames could be modified that easily, it could be used for cheating. But nah, I just wanted to do some tweaking on one of the levels and wanted to test it on a savegame. But savegames can be recreated with the fast-forward button, so that will do. The scripts in Widelands are written with a clean programming language and almost invite for modifying them.

hessenfarmer wrote

the scripts (in their actual state) are saved within the binary savegame.

Thank you for clarifying. These tiny 2-3 MB .wgf savegame files must contain a lot of data.

Edited: Today 08:58 UTC+2.0

Top Quote
Ron_of_Nord
Avatar
Joined: 2024-04-20, 23:43 UTC+2.0
Posts: 188
OS: Windows
Version: 1.3
Ranking
Widelands-Forum-Junkie
Location: Land_down_under
Posted at: Today 09:11 UTC+2.0

Tweaking some things can make something more fun. I believe the savegames hold both the map itself and all the game state data,
but I have not looked at it for a long time myself. When you have a lrge map with lot's of players/enemies there must be a lot of enviroment/state
data to save along with your teams economic data as well.


The aussies are coming, ya ho! ya ho!

Top Quote