Glossary Compatibility Fix

If you liked this item, please rate it up on Steam Workshop page.

Author: Cathelia Samicora

Last revision: 5 May, 2024 at 08:21 UTC

File size: 2.73 MB

On Steam Workshop

Description:

——————–
Summary:

The display of newly added glossary terms from some mods requires support from this mod to be seen, please remember to place this mod at the bottom of mod list.
This mod will generate numerous blank terms at the bottom of the Glossary. If scrolling them makes you feel inconvenient, please consider using the mouse wheel or clicking the arrows on the edge of scrollbar to navigate them faster.

——————–
Q&A For Players:

Q1: What does this mod do?
A1: This mod grant compatibility to the in-game Glossary, leading to allow modders to use any glossary term number in the range from 0 to 9999. (Of course they should not use the same number that already occupied by vanilla game or other modders, in order to avoid conflict, otherwise they will overwrite each other)

Q2: Why does this mod do that?
A2: Redhook has a complex mechanism on retrieving the glossary term number.
For example: the vanilla game (including all official DLCs) has used glossary term numbers as follows: 1~62, 1001~1006, 2001~2010.
If a modder want to use a set of glossary term numbers which begins from 63, all shall be fine.
BUT, if the modder want to begin from 73, or even from 100, 200, 300… Then they will find themselves unable to see these glossary terms, as Redhook will not retrieve these numbers at all.

Q3: How does this mod fix that?
A3: To force Redhook to retrieve any non-continuous glossary term numbers within the range 0~9999, this mod has put an empty glossary term in EVERY 10 numbers of the range 0~9999.
This fix way might seem to be similar to "Clair’s Journal Compatibility Fix" that used to fix Journals, but there is no way to hide empty glossary terms, so there is something more:
To avoid so many empty glossary terms obstructing players from viewing the normal glossary terms, all empty glossary terms have the first letter of title set to "EF BF BF" in hexadecimal, which is the last letter in 3-byte form of UTF-8.
So that all these empty glossary terms will ALWAYS be shown at the bottom of the whole Glossary, NO MATTER which language players are using.

Q4: How do I use this mod?
A4: If you are a normal player, just sort this mod at the bottom of your mod list, which in other words, BELOW ALL OTHER MODS.
If you are a modder who want to make your own glossary terms, select any proper glossary term numbers within the range 0~9999 (Of course they should not be used by vanilla game or other modders, in order to avoid conflict, otherwise yours and others will overwrite each other), then tell your players to use this mod as above mentioned.

Q5: There are too many empty glossary terms, how do I search the one I need to view?
A5: All these empty glossary terms will ALWAYS be shown at the bottom of the whole Glossary, no matter which language players are using.
So if you scroll to empty glossary terms, you should stop scrolling down at once, and try to scroll up back to the normal terms.
Find yourself tired to slowly scroll all these terms? You can click on the two arrows at the top and bottom of the scrollbar, each click on the arrows will scroll one single page of the glossary, which will help you find the certain terms much easier.

———-
For Modders:

(1) How does Redhook perform the retrieve mechanism on Glossary?

This is a bit complex. Redhook perform the retrieve mechanism on Glossary according to the algorithm below:

Start by appending the number 0 to "str_glossary_term_".
Search for this term in the loaded localized text. If found, increase the appended number by 1 and reset the "miss counter". Repeat this process.
If the term is not found, increase the "miss counter" by 1, and increase the appended number by 1. Repeat this process.
If the "miss counter" equals 10, change the appended number to the next multiple of one thousand (which means all unretrieved numbers are abandoned until the next multiple of one thousand) and repeat the process.
Once processing begins from a multiple of one thousand, if the number of searches and the "miss counter" both equal 10, increase the "termination counter" by 1, and change the appended number to the next multiple of one thousand (from section 1000+ jump to 2000, from section 2000+ jump to 3000, etc); otherwise, reset the "termination counter" to 0.
If the "termination counter" equals 3, terminate all "str_glossary_term_" processing flows, so that the whole retrieve mechanism on Glossary ends.

(2) Redhook do have many overflows, so is there a similar limit on Glossary?

Unfortunately, in my test, there is a limit on Glossary, it is about the text length of the whole Glossary.
When this limit on Glossary happens, Redhook will inform us through a blackscreen about text length overflow if we click and open the Glossary page, then the blackscreen crashes after ESC.
But it should be very large thus we might not need to worry too much about it right now.
Let’s just use Glossary freely until we actually encounter this problem.

(3) Glossary term numbers that already in-use by vanilla game or existing mods are as follows:

Note:
The list below is only gathered from what I know, surely there should be more than that.
If anyone wanna to add glossary term numbers which has not been included in the list below, you are welcomed to inform me, thank you.
If any modder wanna to use some not-in-use glossary term numbers, please leave a comment to me, so that I can list them here to tell other modders avoid conflicts on these numbers, thank you.
If any modder find your glossary term numbers conflict with this list, please leave a comment to me, I shall inform the creators of those mods to change their numbers if necessary, and thank you too.

Vanilla Game (including official DLCs):
1~62, 1001~1006, 2001~2010

Scarlet Ruins:
63~99
("Scarlet Ruins" has fixed its glossary number conflict, thank Phasmy for the update!)

The Mountain – Updated Version:
1007, 1008, 1009
("The Mountain" has fixed its glossary number conflict, thank Grim_Reaper for the update!)

The Voivode – Reworked:
101~105
(Without this mod to fix Redhook’s retrieve mechanism, the glossary terms of this mod will not be seen if there are no other mods filling the numbers from 72~91.)

Grunt’s Modded Fallen Heroes:
230~247
(Without this mod to fix Redhook’s retrieve mechanism, the glossary terms of this mod will almost have no chance to be seen at all.)

Skadi the corrupting heart:
4001~4005

Slash Blade:
4009~4017

Abigail Williams:
5001~5031

———-
Warning:
Due to a study on the bug that causes glossary of other mods to duplicate the same term for several times, Redhook’s glossary algorithm has something wrong on the 10 numbers before every multiple of a thousand since 3000, which leading to multiple duplicated retrieve thread. To avoid that bug, the following glossary term numbers MUST NOT BE USED BY ANY MOD including this compatibility Fix mod.

These special glossary term numbers which must not exist in the whole game are:
2990~2999,
3990~3999,
4990~4999,
5990~5999,
6990~6999,
7990~7999,
8990~8999,
9990~9999.