Difference between revisions of "ToString"
Jump to navigation
Jump to search
imported>Odessa (forgot to add categories) |
imported>Odessa |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
{{Function | {{Function | ||
|origin = NVSE | |origin = NVSE | ||
|summary = Added by NVSE V4. Attempts to convert an expression to a string. For numeric expressions, the result is a string representation of the numeric value. For objects, it is the name of the object if available; otherwise it is the formID expressed in hexadecimal notation. For string | |summary = Added by NVSE V4. Attempts to convert an expression to a string. For numeric expressions, the result is a string representation of the numeric value. For objects, it is the name of the object if available; otherwise it is the formID expressed in hexadecimal notation. | ||
For string variables, conversion is only necessary for vanilla and old NVSE functions (eg: It is needed for [[PrintToConsole]], but not for [[Print]]) | |||
You can also use the shorthand alias '$'. | You can also use the shorthand alias '$'. | ||
Line 21: | Line 23: | ||
<pre> | <pre> | ||
string_var my_string | string_var my_string | ||
int iValue | |||
let my_string := $SunnyREF | |||
my_string == "Sunny Smiles" ; thats the name of the reference | |||
let my_string := " | let iValue := 13 | ||
let my_string := $iValue + " and " + $VCG01 ; an int and a quest | |||
my_string == "13 and Ain't That a Kick in the Head" | |||
</pre> | </pre> | ||
You only need to use it with string variables for vanilla and old NVSE functions: | |||
<pre> | <pre> | ||
string_var my_string | string_var my_string | ||
let | let my_string := "whatever" | ||
MessageEx $my_string | |||
my_string | |||
</pre> | </pre> | ||
Line 43: | Line 48: | ||
*[[Tutorial: String Variables 6|String Variables Tutorial: Passing strings as parameters]] | *[[Tutorial: String Variables 6|String Variables Tutorial: Passing strings as parameters]] | ||
*[[ToNumber]] | *[[ToNumber]] | ||
*[[GetFormIDString]] (if you want the formid of a named object) | |||
*[[NumToHex]] | |||
*[[ActorValueToStringC]] | |||
*[[TypeOf]] | |||
[[Category:Functions_(NVSE)]] | [[Category:Functions_(NVSE)]] | ||
[[Category:String Variables]] | [[Category:String Variables]] |
Latest revision as of 09:28, 21 July 2014
< [[::Category:Functions|Category:Functions]]
A function added by the New Vegas Script Extender.
Description
Added by NVSE V4. Attempts to convert an expression to a string. For numeric expressions, the result is a string representation of the numeric value. For objects, it is the name of the object if available; otherwise it is the formID expressed in hexadecimal notation.
For string variables, conversion is only necessary for vanilla and old NVSE functions (eg: It is needed for PrintToConsole, but not for Print)
You can also use the shorthand alias '$'.
Syntax
(string) ToString ToConvert:exp
Alias
(string) $ToConvert:exp
Example
string_var my_string int iValue let my_string := $SunnyREF my_string == "Sunny Smiles" ; thats the name of the reference let iValue := 13 let my_string := $iValue + " and " + $VCG01 ; an int and a quest my_string == "13 and Ain't That a Kick in the Head"
You only need to use it with string variables for vanilla and old NVSE functions:
string_var my_string let my_string := "whatever" MessageEx $my_string
See Also
- String Variable
- String Variables Tutorial: Passing strings as parameters
- ToNumber
- GetFormIDString (if you want the formid of a named object)
- NumToHex
- ActorValueToStringC
- TypeOf