Difference between revisions of "CreateString"
Jump to navigation
Jump to search
imported>Speedo (Updated syntax) |
imported>Quetzilla |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
A command for [[:Category: Pluggy|Pluggy]]. | A command for [[:Category: Pluggy|Pluggy]]. | ||
Line 12: | Line 10: | ||
*If the ESP file is not active upon reloading a savegame, all the associated strings are destroyed when/if the player saves. | *If the ESP file is not active upon reloading a savegame, all the associated strings are destroyed when/if the player saves. | ||
*If ''RefuseZero'' is 1, then the returned StringID will never be zero. | *If ''RefuseZero'' is 1, then the returned StringID will never be zero. | ||
==Notes== | |||
*There is no way to pass the function a blank string. If you wish to create a blank string that is Protected or refuses StringID 0, use [[StringLen]] immediately after creating the string: | |||
set nuString to CreateString -1 0 1 1 | |||
StringLen nuString 0 | |||
*Due to a bug with [[Set]], you can't directly create large strings with CreateString, as the CS will crash when you attempt to compile the script. To get around this, simply use [[SetString]] immediately after CreateString to set the contents: | |||
set myString to CreateString -1 0 1 1 | |||
SetString myString "Very, very, very, long string [...]" | |||
==See Also== | |||
*[[DestroyString]] | |||
[[Category: Functions (Pluggy)]] | [[Category: Functions (Pluggy)]] | ||
[[Category: String Functions (Pluggy)]] | [[Category: String Functions (Pluggy)]] |
Latest revision as of 11:24, 14 July 2008
A command for Pluggy.
Syntax:
(StringID:long) CreateString EspID:short Text:string Protected:short RefuseZero:short
Creates a new string containing Text tagged with the EspID, and returns the StringID of the new string.
- If EspID is not specified or is -1, then the EspID is automatically associated to the calling mod.
- If Protected is not 0, then the string will be write-protected from other mods, and only the associated mod will ever be able to modify the string. Setting Protected to 1 is recommended if you don’t want your string to be modified by another mod.
- If the ESP file is not active upon reloading a savegame, all the associated strings are destroyed when/if the player saves.
- If RefuseZero is 1, then the returned StringID will never be zero.
Notes[edit | edit source]
- There is no way to pass the function a blank string. If you wish to create a blank string that is Protected or refuses StringID 0, use StringLen immediately after creating the string:
set nuString to CreateString -1 0 1 1 StringLen nuString 0
- Due to a bug with Set, you can't directly create large strings with CreateString, as the CS will crash when you attempt to compile the script. To get around this, simply use SetString immediately after CreateString to set the contents:
set myString to CreateString -1 0 1 1 SetString myString "Very, very, very, long string [...]"