Promotion and policy saving bug (v.122,123)

Fujisan

Warlord
Joined
Sep 9, 2003
Messages
130
Bug description

Promotion and policy saving game options invert their values every time the game loaded. To make it clear see the next flow chart.

Code:
Game start
. . . . .
Promotion and policy saving is ON (by default)
. . . . .
Save game
Load game
. . . . .
Promotion and policy saving is OFF
. . . . .
Save game
Load game
. . . . .
Promotion and policy saving is ON
. . . . .
and so on.

Workaround

When, after loading your saved game, you see the game doesn't allow ending turn without promoting all your unpromoted units, just save your current game and load again.

Possible fix

Looking through the code I found the following lines in "core\CiVUP - Events.lua" where these options are set.

Code:
for optionInfo in GameInfo.GameOptions() do
	if optionInfo.Reverse then
		Game.SetOption(optionInfo.ID, not Game.IsOption(optionInfo.ID))
	end
end

As one can see these options are reversed every time the game loaded/started.

If there an event that fired only once, when the game is started, then binding this script with the game start event may resolve the problem. However I'm quite new in civ 5 scripting and couldn't find how to implement this.

PS:
I wonder why this bug wasn't reported before.
 
I'm running v 122 and have several times and in different games experienced unit promotions disappear while their exp points and exp level remained (after reload??). I also run a lot of other mods - mostly wonders - and haven't done any proper testing, but this could sound related.

If so it seems like a very nasty bug!

\Skodkim
 
So are no one else noticing this? If it's for real it seams like a game breaker...

\Skodkim
 
I'm running v 122 and have several times and in different games experienced unit promotions disappear while their exp points and exp level remained (after reload??). I also run a lot of other mods - mostly wonders - and haven't done any proper testing, but this could sound related.
\Skodkim

I've never experienced promotion disappearing. And anyway I don't think it is related to the promotion and policy saving bug.
 
As to why nobody noticed (or paid attention) to this bug before.

That is very simple.

Most people, I suppose, play Civ on the default options. In vanilla Civ5 the promotion and policy saving is OFF by default (so you have to promote your units within the current turn whenever they get experience).

In this mod the default options for the promotion and policy saving is inverted (ON). So you have NOT to promote your units immediately. At least it is supposed to be.

However due to this bug, the promotion and policy saving options invert their values every time the game saved/loaded.

So what a player see in the game?

When a player is forced to accept a policy or a unit promotion, the player don't surprise because it is the default vanilla Civ5 behavior.

When accepting a policy or a unit promotion is not required, the player just don't pay attention to this or just don't notice it.

Simple.

And finally how to simply find this bug in your game.

1. Confirm that you play with the default advanced options.

2. If you are required to promote your units or accept a new policy before the end of the turn, it means that the bug exists. Because by default promoting units or accepting a new policy are not required (in this mod).

3. If you are NOT required to promote your units or accept a new policy before the end of the turn, just check this next time after you save and load your game.
 
Top Bottom