Difference between revisions of "User:Scrivener07/Strings"

624 bytes added ,  19:04, 13 June 2019
Changed note about localized strings.
imported>Qazaaq
(Created page with "In practice, Papyrus strings are ''case-insensitive'' due to the way the game engine's string pool operates for efficiency reasons. Most strings in the engine come from th...")
 
imported>Qazaaq
(Changed note about localized strings.)
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:


This is potentially a problem for some [[Game Systems]] which require a '''case-sensitive''' string.
This is potentially a problem for some [[Game Systems]] which require a '''case-sensitive''' string.
== Workarounds ==
In general the workaround to creating a string with any preferred casing would be to use a pseudo uniqueness. For example the string "raider" is cached but you want "Raider". You can use a pseudo uniqueness by prefixing or suffixing the string with a space character (" "). Sticking with the example, the user would be none the wiser if you used "Raider " for UI purposes. This is not a suitable workaround for all cases. For other cases you should make your strings more unique if possible.


== Notes ==
== Notes ==
* The game engine internally uses a data structure called <code>BSFixedString</code> for handling string data.
* The game engine internally uses a data structure called <code>BSFixedString</code> for handling string data.
* Localized strings, internally <code>BGSLocalizedString</code>, are also vulnerable to string pool limitations.
* [[UI Script|UI]] function calls to Scaleform are affected by this string casing limitation.
* [[UI Script|UI]] function calls to Scaleform are affected by this string casing limitation.
* [[Initialization File]] related function calls are affected by this string casing limitation.
* [[Initialization File]] related function calls are affected by this string casing limitation.
Anonymous user