Skip to content
ryobg edited this page Feb 15, 2018 · 6 revisions

Set of issues caused by Skyrim architecture you had to deal with, know about...

Skyrim strings

Skyrim strings are case-insensitive and equal strings are reused. Thus a string "Agility" imported from JContainers may turn into "agility" or even "agIlitY" if Skyrim already contains "agility" or "agIlitY" string. That's why all string comparison in JContainers are case insensitive.

String encoding

The only encoding supported by JContainers is UTF-8 and of course, ASCII as it is a subset of UTF-8. The only encoding supported by Papyrus is ASCII. Be careful when processing a string containing any special western, asian, or similar sets with extra characters! StringUtil assumes it works with ASCII strings, where single byte represents single character, which is ONLY the case for ASCII encoded string. If you need them you better use some UTF-8 string processing library.

Dynamic forms

There are static and dynamic forms in Skyrim. The first are persistent (any Creation Kit entry, like Quest, unique NPC and etc. is static, persistent form) and the latter can be deleted any time. Skyrim reuses dynamic form identifiers. So, one day 0xffabcde0 may point to dynamically spawned bear in some cave and later it will point to a guard in the city.

So be careful when dealing with stored dynamic forms. This one is JContainers flaw, which may be eliminated in next versions.