Difference between revisions of "ToString"

297 bytes added ,  10:07, 21 July 2014
clarified
imported>Odessa
(forgot to add categories)
imported>Odessa
(clarified)
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 expressions no conversion is necessary.
  |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 := "whatever"
let iValue := 13
let my_string := $iValue + " and " + $VCG01 ; an int and a quest


MessageEx $my_string
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
ref rActor


let rActor := SunnyREF
let my_string := "whatever"
 
MessageEx $my_string
let my_string := $rActor
 
my_string == "Sunny Smiles" ; thats the name of the reference
</pre>
</pre>


Anonymous user