Difference between revisions of "User:Scrivener07/Strings"

4 bytes removed ,  19:04, 13 June 2019
Changed note about localized strings.
imported>Qazaaq
(Added a workaround using localized text.)
imported>Qazaaq
(Changed note about localized strings.)
 
Line 14: Line 14:
== Workarounds ==
== 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.
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.
Another possible workaround is to use localized strings where possible, internally <code>BGSLocalizedString</code>.


== 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