[v144]Counters for DoF and Denouncements do not scale with Game speed

Aristos

Lightseeker
Joined
Dec 11, 2001
Messages
3,912
Location
Deep inside...
The following block of code uses the same code as DiploGameOverview, and it produces a negative counter for DoF and denouncements when speed is not standard:

Code:
--if isBNW then
	local turnsleft;
	if(Players[targetPid].GetDenouncedPlayerCounter ~= nil) then
		turnsLeft = GameDefines.DENUNCIATION_EXPIRATION_TIME - Players[targetPid]:GetDenouncedPlayerCounter(thisPid);
		tooltipData["denounce"][targetPid] = tooltipData["denounce"][targetPid] .. " (" .. turnsLeft .. ")";
	end
--end

The value GameDefines.DENUNCIATION_EXPIRATION_TIME is fixed (does not scale with game speed) and produces the error.

EDIT: either the reason above, or the counter function somehow does not reset to zero in some situations (maybe after a War Declaration?).


EDIT 2:

I fixed the error for the Global Relations mod using the following:

Code:
local speed = GameInfo.GameSpeeds[ PreGame.GetGameSpeed() ];
local relationDuration = speed.RelationshipDuration;

......

turnsLeft = relationDuration - thisPlayer:GetDoFCounter(targetPid);

idem for the denouncement counter.

I assume this is what you wanted to implement into the Diplo Overview also. Please confirm.
 
I found in my last (marathon) game that denunciations in the F4 count down from 50 to -100.
150 to 0 would surely be an improvement.
 
I found in my last (marathon) game that denunciations in the F4 count down from 50 to -100.
150 to 0 would surely be an improvement.

Fixed in Global Relations mod (at least for the counters in the relations wheel).
 
Back
Top Bottom