Project

General

Profile

Bug #4096

Messagebox with the "%0.f" format should use 0 digit precision

Added by R C 8 days ago. Updated 3 days ago.

Status:
Closed
Priority:
Normal
Category:
Scripting
Target version:
Start date:
09/12/2017
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

This may need some feedback from a non-OpenMW user, but:

As the title states, the mod Town Criers (http://mw.modhistory.com/download-64-12713) places new NPCs into cities that routinely announce the time.

During my testing of the mod, the Town Criers gave the time in decimal numbers ranging until ca 5 values after the decimal point.

Screenshots from the original mod suggest this is unintended and that the Town Criers are meant to announce the times in a more "normal" fashion.

84cb18926b1c5b12.jpg View - Screenshot taken from mod page showing (91.9 KB) R C, 09/12/2017 03:27 PM

Screen Shot 2017-09-12 at 3.34.55 PM.png View - Screenshot taken in OpenMW, showing time displayed as decimal number (1.64 MB) R C, 09/12/2017 03:37 PM

Associated revisions

Revision 4bb349a5 (diff)
Added by Andrei Kortunov 3 days ago

Use default 0 precision in the float formatting (bug #4096)

Revision 054380e4
Added by scrawl . 3 days ago

Merge pull request #1458 from akortunov/precisionfix

Use default 0 precision in the float formatting (bug #4096)

History

#1 Updated by R C 8 days ago

#3 Updated by Andrei Kortunov 8 days ago

  • Status changed from New to Confirmed
  • Reproducibility changed from Have not tried to Always
  • Operating system changed from MacOS to Other

A script command:

MessageBox "Town Crier: ''The time is %0.f of the clock.''" Gamehour

Looks like an original engile rounds float values, OpenMW - no:
https://github.com/OpenMW/openmw/blob/openmw-42/components/interpreter/miscopcodes.hpp#L61

A question: If we will add a rounding here, how to display float as it is?

#4 Updated by Miroslav Remák 7 days ago

I'm pretty sure that's not the case. I believe OpenMW uses default precision for formatting if the format specifier contains no number after the dot, while it should use 0 precision. See https://github.com/OpenMW/openmw/blob/master/components/misc/messageformatparser.cpp#L39.

#5 Updated by Andrei Kortunov 3 days ago

  • Subject changed from [Mod] Town Criers - town crier NPCs announce the time in decimal numbers as opposed to an integer. to Messagebox with the "%0.f" format should use 0 digit precision
  • Category set to Scripting
  • Status changed from Confirmed to Closed
  • Assignee set to Andrei Kortunov
  • Target version set to openmw-0.43
  • % Done changed from 0 to 100

Also available in: Atom PDF