StrSave

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Syntax:

StrSave variableName:string stringToSave:stringID [quest:quest object]

Saves a string's value to a script variable sequence. This can be reloaded with StrLoad later.

StrSave looks for a variable with the name variableName in the current script (or quest if given).

It writes the first character to that variable, then the second character to the next variable and so on until it writes all the characters to the string. Then the next variable is set to the value '0'.

StrSave requires length+1 variables including the one called variableName.


Example:

short str0
short str1
short str2
short str3
short str4
short str5
short str6
short str7
short str8
short str9
short str10
short str11
short str12
short str13

short string
short length

begin OnActivate
   set string to player.StrGetName
   set length to StrLength string
   if length <= 13
       StrSave "str0" string
   endif
end