Difference between revisions of "Measuring Time to Display Menus"
Jump to navigation
Jump to search
m
→Issues: Formatting Changes
imported>Khalim19 m (→Notes: Grammar correction) |
imported>Khalim19 m (→Issues: Formatting Changes) |
||
Line 140: | Line 140: | ||
==Issues== | ==Issues== | ||
*The script will not yield correct values if the time measured is longer than one day (= 86400 seconds), which is extremely unlikely to happen. | *The script will not yield correct values if the time measured is longer than one day (= 86400 seconds), which is extremely unlikely to happen. | ||
*The script will not measure time if a menu is reloaded via the | *The script will not measure time if a menu is reloaded via the ''reload'' command from the console. | ||
As already mentioned, the script also measures time it takes to switch to another menu. There is an issue with this behavior, however. For example, in player's inventory menu, there are multiple menus on the screen that can be active (one at a time) - inventory menu, magic popup menu and HUD main menu. Moving your mouse outside the inventory menu causes the game to switch to the HUD main menu, which triggers the time measure. Moving your mouse back to the inventory menu triggers it again. | As already mentioned, the script also measures time it takes to switch to another menu. There is an issue with this behavior, however. For example, in player's inventory menu, there are multiple menus on the screen that can be active (one at a time) - inventory menu, magic popup menu and HUD main menu. Moving your mouse outside the inventory menu causes the game to switch to the HUD main menu, which triggers the time measure. Moving your mouse back to the inventory menu triggers it again. | ||
Line 146: | Line 146: | ||
Ignoring the HUD main menu is not a solution, because if player opens the inventory menu and the mouse cursor points outside the inventory menu, the HUD main menu will be active first. The entire time the mouse is positioned over the HUD main menu would add to the time measured, causing it to be incorrect. | Ignoring the HUD main menu is not a solution, because if player opens the inventory menu and the mouse cursor points outside the inventory menu, the HUD main menu will be active first. The entire time the mouse is positioned over the HUD main menu would add to the time measured, causing it to be incorrect. | ||
If you didn't understand from the description what the issue is, it should be clearer once you change the timePassedLowerBound variable to 0, use the script in game and watch the console output. You may want to toggle debug text on by typing | If you didn't understand from the description what the issue is, it should be clearer once you change the '''timePassedLowerBound''' variable to 0, use the script in game and watch the console output. You may want to toggle debug text on by typing ''tdt'' in the console so that the output is displayed even if the console is not active. | ||
This issue occurs in any menu. Thankfully, the 0.2 second threshold filters most of the "bogus" time measures. | This issue occurs in any menu. Thankfully, the 0.2 second threshold filters most of the "bogus" time measures. | ||
[[Category: Useful Code]] | [[Category: Useful Code]] |