Jump to content

Papyrus changing string cases?


Recommended Posts

I believe I read somewhere that Papyrus stores a string value in a case-insensitive cache, including strings created by the vanilla game, other mods etc.

 

Eg. If the case-insensitive cache already has the value "gold" Papyrus will not store a new value of "Gold", but do something like pointing the new string variable to the existing one "gold".

 

Not sure if it is a bug or a feature :wink:

 

Edit:

Source and solutions, https://github.com/xanderdunn/skaar/wiki/Common-Tasks

See the "Understanding Strings" section.

  • Thanks 1
Link to comment
Share on other sites

  • 10 months later...

Thanks a lot for the explanation.

 

I also stumbled upon this issue with "end" and "ok" words changed into "End" and "Ok", while storing strings in JSON with the JsonUtil library.

 

Another solution is to consider that strings are just case insensitive in our scripts. That is acceptable unless we use strings to be displayed to the gamer. Strings used as identifiers, internal states, etc... can be handled naturally.

Link to comment
Share on other sites

  • 6 months later...

I believe I read somewhere that Papyrus stores a string value in a case-insensitive cache, including strings created by the vanilla game, other mods etc.

 

Eg. If the case-insensitive cache already has the value "gold" Papyrus will not store a new value of "Gold", but do something like pointing the new string variable to the existing one "gold".

 

Not sure if it is a bug or a feature :wink:

 

Edit:

Source and solutions, https://github.com/xanderdunn/skaar/wiki/Common-Tasks

See the "Understanding Strings" section.

This information is correct. In my case i could get away with:

 

myStringArray = new string[2]

myStringArray[0] = "Heal "

myStringArray[1] = "Shield "

Debug.Notification(myStringArray[0] + "- " + myStringArray[1])

 

Without the additional space heal will come out all lower case and shield all upper case.

Since this thread is the only worthwile google result i figured that might help someone someday, though obviously doing it like this has its own issues.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...