https://wiki.beyondunreal.com/w/index.php?action=history&feed=atomLegacy:Global Function (UT) - Revision history2017-11-17T23:24:40ZRevision history for this page on the wikiMediaWiki 1.25.1https://wiki.beyondunreal.com/Legacy:Global_Function_(UT)?diff=46407&oldid=prevSeriousBarbie: +"is equal to or"2016-11-23T23:14:25Z<p>+"is equal to or"</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 23:14, 23 November 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L59" >Line 59:</td>
<td colspan="2" class="diff-lineno">Line 59:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>====Class Hierarchy ====</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>====Class Hierarchy ====</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; bool ClassIsChildOf (class TestClass, class ParentClass) [static] : Returns whether <tt>TestClass</tt> is a subclass of <tt>Parentclass</tt>.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; bool ClassIsChildOf (class TestClass, class ParentClass) [static] : Returns whether <tt>TestClass</tt> is <ins class="diffchange diffchange-inline">equal to or </ins>a subclass of <tt>Parentclass</tt>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; bool IsA (name ClassName) : Returns whether the object's class is the specified class or a subclass. This function doesn't need a reference to the desired class, but just the class's name.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; bool IsA (name ClassName) : Returns whether the object's class is the specified class or a subclass. This function doesn't need a reference to the desired class, but just the class's name.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>SeriousBarbiehttps://wiki.beyondunreal.com/Legacy:Global_Function_(UT)?diff=46229&oldid=prevSeriousBarbie: SetPropertyString -> SetPropertyText2015-09-25T20:42:55Z<p>SetPropertyString -> SetPropertyText</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 20:42, 25 September 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L68" >Line 68:</td>
<td colspan="2" class="diff-lineno">Line 68:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>====Objects / Properties ====</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>====Objects / Properties ====</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; string GetPropertyText (string PropName) : Returns the value of the specified property [[Legacy:Typecasting|typecasted]] to string. This is useful when you don't want any dependencies to the package of an object, but still need to access its properties.<br />Usage: <tt>aString = anObject.GetPropertyText("''PropertyName''");</tt></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; string GetPropertyText (string PropName) : Returns the value of the specified property [[Legacy:Typecasting|typecasted]] to string. This is useful when you don't want any dependencies to the package of an object, but still need to access its properties.<br />Usage: <tt>aString = anObject.GetPropertyText("''PropertyName''");</tt></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; SetPropertyText (string PropName, string PropValue) : Assigns a value to the specified property of an object. Only use this for properties that can be [[Legacy:Typecasting|typecasted]] from string.<br />Usage: <tt>anObject.<del class="diffchange diffchange-inline">SetPropertyString</del>("''PropertyName''", "''new value''");</tt></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; SetPropertyText (string PropName, string PropValue) : Assigns a value to the specified property of an object. Only use this for properties that can be [[Legacy:Typecasting|typecasted]] from string.<br />Usage: <tt>anObject.<ins class="diffchange diffchange-inline">SetPropertyText</ins>("''PropertyName''", "''new value''");</tt></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; name GetEnum (Object E, int i) [static] : Returns the i-th element of the given enumeration, as in <code>GetEnum(enum'MyEnum', 2)</code> or an empty name of the specified index exceeds the number of elements in the enumeration.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; name GetEnum (Object E, int i) [static] : Returns the i-th element of the given enumeration, as in <code>GetEnum(enum'MyEnum', 2)</code> or an empty name of the specified index exceeds the number of elements in the enumeration.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; [[Legacy:Object (UT)|Object (UT)]] DynamicLoadObject (string ObjectName, Class ObjectClass, optional bool MayFail) [static] : Loads and returns the specified object. If <tt>bMayFail</tt> is true no error will be logged.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; [[Legacy:Object (UT)|Object (UT)]] DynamicLoadObject (string ObjectName, Class ObjectClass, optional bool MayFail) [static] : Loads and returns the specified object. If <tt>bMayFail</tt> is true no error will be logged.</div></td></tr>
</table>SeriousBarbiehttps://wiki.beyondunreal.com/Legacy:Global_Function_(UT)?diff=33855&oldid=prevAzura: Removed incorrect reference to modulo in description of Abs function2008-12-30T15:40:07Z<p>Removed incorrect reference to modulo in description of Abs function</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 15:40, 30 December 2008</td>
</tr><tr><td colspan='4' style='text-align: center;' class='diff-multi'>(One intermediate revision by one other user not shown)</td></tr><tr><td colspan="2" class="diff-lineno" id="L16" >Line 16:</td>
<td colspan="2" class="diff-lineno">Line 16:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Float Functions ===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Float Functions ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; float Abs (float A) [static] : Returns the absolute value <del class="diffchange diffchange-inline">(also known as the modulo) </del>of A, usually written |A|. Eg: Abs(5) == Abs(-5) == 5.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; float Abs (float A) [static] : Returns the absolute value of A, usually written |A|. Eg: Abs(5) == Abs(-5) == 5.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Sin (float A) [static] : Returns sine( A )</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Sin (float A) [static] : Returns sine( A )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Cos (float A) [static] : Returns cosine( A )</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Cos (float A) [static] : Returns cosine( A )</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L31" >Line 31:</td>
<td colspan="2" class="diff-lineno">Line 31:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Lerp (float Alpha, float A, float B) [static] : "Returns the linear interpolation between A and B."<br />The return value is calculated through something like this:<br /><tt>(B - A) * Alpha + A</tt></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Lerp (float Alpha, float A, float B) [static] : "Returns the linear interpolation between A and B."<br />The return value is calculated through something like this:<br /><tt>(B - A) * Alpha + A</tt></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Smerp (float Alpha, float A, float B) [static] : Returns an Alpha-smooth nonlinear interpolation between A and B.<br />The return value seems to be calculated through something like this:<br /><tt>(-2 * (B - A) * Alpha ** 3) + (3 * (B - A) * Alpha ** 2) + A</tt></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float Smerp (float Alpha, float A, float B) [static] : Returns an Alpha-smooth nonlinear interpolation between A and B.<br />The return value seems to be calculated through something like this:<br /><tt>(-2 * (B - A) * Alpha ** 3) + (3 * (B - A) * Alpha ** 2) + A</tt></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>;[[Image:Legacy_interpolation-smerp.gif|]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>;[[Image:Legacy_interpolation-smerp.gif|<ins class="diffchange diffchange-inline">Legacy_interpolation-smerp.gif</ins>]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float RandRange (float Min, float Max) : Returns a random number between Min and Max. This function is not static.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; float RandRange (float Min, float Max) : Returns a random number between Min and Max. This function is not static.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L81" >Line 81:</td>
<td colspan="2" class="diff-lineno">Line 81:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Operators|Operators]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Operators|Operators]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Object (UT)|Object class]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Object (UT)|Object class]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">==Discussion==</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">:'''Nobody:''' Do all the string functions count the first character of the passed string as 0? I know it says here that instr(...) does this, and I've updated mid(...) to show this, not sure of the others, if so needs clarified.</del></div></td><td colspan="2"> </td></tr>
</table>Azurahttps://wiki.beyondunreal.com/Legacy:Global_Function_(UT)?diff=3399&oldid=prevBc179129.bendcable.com: that seems better =)2006-02-02T03:28:48Z<p>that seems better =)</p>
<p><b>New page</b></p><div>{{classbox| [[Legacy:UT|UT]] :: [[Legacy:Object (UT)|Object (UT)]] (Methods)}}<br />
<br />
The functions listed here are globally available in all classes. Due to [[Legacy:UnrealScript|UnrealScript]]'s strict object-oriented approach, they're actually methods of the [[Legacy:Object (UT)|Object (UT)]] class.<br />
<br />
Almost all of these functions are declared as native and final (see [[Legacy:Class Syntax|class syntax]]) and most of them are also [[Legacy:Static Function|static function]]s.<br />
<br />
See [[Legacy:Vector|vector]] and [[Legacy:Rotator|rotator]] for functions on those variable types.<br />
<br />
See [[Legacy:Global Function|Global Function]] for global UT2003 functions.<br />
<br />
===Integer Functions ===<br />
; int Rand (int Max) [static] : Returns a random number ranging from 0 to Max-1.<br />
; int Min (int A, int B) [static] : Returns the lower of the two values.<br />
; int Max (int A, int B) [static] : Returns the higher of the two values.<br />
; int Clamp (int V, int A, int B) [static] : If V is smaller than A, A is returned. If V is larger than B, B is returned. In any other case V is returned.<br />
<br />
===Float Functions ===<br />
; float Abs (float A) [static] : Returns the absolute value (also known as the modulo) of A, usually written |A|. Eg: Abs(5) == Abs(-5) == 5.<br />
; float Sin (float A) [static] : Returns sine( A )<br />
; float Cos (float A) [static] : Returns cosine( A )<br />
; float Tan (float A) [static] : Returns tan( A )<br />
; float Atan (float A) [static] : Inverse tangent. Returns tan<sup>-1-</sup>(A). Other inverse trig functions are not included in [[Legacy:UT|UT]]'s UnrealScript. (see [[Legacy:Useful Maths Functions|Useful Maths Functions]])<br />
; float Exp (float A) [static] : Returns e<sup>A</sup><br />
; float Loge (float A) [static] : Returns log(A), the natural logarithm.<br />
; float Sqrt (float A) [static] : Returns the square root of A.<br />
; float Square (float A) [static] : Returns A<sup>2</sup>.<br />
; float FRand ( ) : Returns a random number between 0 and 1.<br />
; float FMin (float A, float B) [static] : Returns the lower of the two values.<br />
; float FMax (float A, float B) [static] : Returns the higher of the two values.<br />
; float FClamp (float V, float A, float B) [static] : If V is smaller than A, A is returned. If V is larger than B, B is returned. In any other case V is returned.<br />
; float Lerp (float Alpha, float A, float B) [static] : "Returns the linear interpolation between A and B."<br />The return value is calculated through something like this:<br /><tt>(B - A) * Alpha + A</tt><br />
; float Smerp (float Alpha, float A, float B) [static] : Returns an Alpha-smooth nonlinear interpolation between A and B.<br />The return value seems to be calculated through something like this:<br /><tt>(-2 * (B - A) * Alpha ** 3) + (3 * (B - A) * Alpha ** 2) + A</tt><br />
;[[Image:Legacy_interpolation-smerp.gif|]]<br />
; float RandRange (float Min, float Max) : Returns a random number between Min and Max. This function is not static.<br />
<br />
===String Functions ===<br />
; int Len (coerce string S) [static] : Returns the length of the string, i.e. the number of characters in it.<br />
; int InStr (coerce string haystack, coerce string needle) [static] : If the string <tt>needle</tt> is found inside <tt>haystack</tt>, the number of characters in <tt>haystack</tt> ''before'' the first occurance of <tt>needle</tt> is returned. That is, if the <tt>needle</tt> is found right at the beginning of <tt>haystack</tt>, 0 is returned. If <tt>haystack</tt> doesn't contain <tt>needle</tt>, InStr returns -1.<br />
; string Mid (coerce string S, int skip, optional int num) [static] : Returns a substring of <tt>S</tt>, skipping <tt>skip</tt> characters and returning the next <tt>num</tt> characters or all remaining if the third parameter is left out. Mid("hello", 0, 2) returns "he", Mid("hello", 1) returns "ello", i.e. all but the first character.<br />
; string Left (coerce string S, int num) [static] : Returns the <tt>num</tt> leftmost characters of <tt>S</tt> or all of them if <tt>S</tt> contains less than <tt>num</tt> characters.<br />
; string Right (coerce string S, int num) [static] : Returns the <tt>num</tt> rightmost characters of <tt>S</tt> or all of them if <tt>S</tt> contains less than <tt>num</tt> characters.<br />
; string Caps (coerce string S) [static] : Returns <tt>S</tt> converted to uppercase.<br />
; string Chr (int i) [static] : Returns the character matchin the given ASCII code.<br />
; int Asc (string S) [static] : Returns the ASCII code of the first character in <tt>S</tt>.<br />
<br />
===General Functions ===<br />
<br />
====Logging ====<br />
; Log (coerce string S, optional name Tag) [static] : Writes a line to the log file. The line begins with the Tag or "ScriptLog:" if Tag was not specified, followed by the log string.<br />The tags 'Error' and 'Warning' (and probably others, too) have a special meaning in [[Legacy:Commandlet|Commandlet]]s.<br />
; Warn (coerce string S) [static] : Same like <tt>Log</tt>, but the line starts with "ScriptWarning:" and contains information about the object, state and function that called <tt>Warn</tt>.<br />
; string Localize (string SectionName, string KeyName, string PackageName) [static] : Returns the string found in ''PackageName''.int in the [''SectionName''] section. Logs an error if no localization for the specified string is found.<br />
<br />
====State-Related ====<br />
; GotoState (optional name NewState, optional name Label) : Switches to a new state. State code execution begins at the specified label or at "Begin:" if <tt>Label</tt> is not specified.<br />Before the state is changed the old state's <tt>EndState</tt> function is called. After the state changed <tt>BeginState</tt> of the new state is called.<br />
; bool IsInState (name TestState) : Returns whether the object's current state is the one specified.<br />
; name GetStateName ( ) : Returns the object's current state name.<br />
; BeginState ( ) [not native, not final] : This event is executed during GotoState right after the object switched to the new state. This function can be overridden in any state of any class.<br />
; EndState ( ) [not native, not final] : This event is executed during GotoState right before the object switches to the new state. This function can be overridden in any state of any class.<br />
<br />
====Class Hierarchy ====<br />
; bool ClassIsChildOf (class TestClass, class ParentClass) [static] : Returns whether <tt>TestClass</tt> is a subclass of <tt>Parentclass</tt>.<br />
; bool IsA (name ClassName) : Returns whether the object's class is the specified class or a subclass. This function doesn't need a reference to the desired class, but just the class's name.<br />
<br />
====Enabling / Disabling Functions ====<br />
; Enable (name ProbeFunc) : Enables a [[Legacy:Probe Function|probe function]].<br />
; Disable (name ProbeFunc) : Disables a [[Legacy:Probe Function|probe function]].<br />
<br />
====Objects / Properties ====<br />
; string GetPropertyText (string PropName) : Returns the value of the specified property [[Legacy:Typecasting|typecasted]] to string. This is useful when you don't want any dependencies to the package of an object, but still need to access its properties.<br />Usage: <tt>aString = anObject.GetPropertyText("''PropertyName''");</tt><br />
; SetPropertyText (string PropName, string PropValue) : Assigns a value to the specified property of an object. Only use this for properties that can be [[Legacy:Typecasting|typecasted]] from string.<br />Usage: <tt>anObject.SetPropertyString("''PropertyName''", "''new value''");</tt><br />
; name GetEnum (Object E, int i) [static] : Returns the i-th element of the given enumeration, as in <code>GetEnum(enum'MyEnum', 2)</code> or an empty name of the specified index exceeds the number of elements in the enumeration.<br />
; [[Legacy:Object (UT)|Object (UT)]] DynamicLoadObject (string ObjectName, Class ObjectClass, optional bool MayFail) [static] : Loads and returns the specified object. If <tt>bMayFail</tt> is true no error will be logged.<br />
; SaveConfig ( ) : Saves the current values of config and globalconfig variables of this object to the ini file and sets them as default values for the object's class.<br />
; StaticSaveConfig ( ) [static] : Saves the default values of config and globalconfig variables of this object's class to the ini file.<br />
; ResetConfig ( ) [static] : Resets the config and globalconfig variables of this object's class to the values stored in Default.ini or DefUser.ini.<br />
<br />
==Related Topics ==<br />
* [[Legacy:UnrealScript|UnrealScript]]<br />
** [[Legacy:Class Syntax|Class Syntax]]<br />
** [[Legacy:Function Syntax|Function Syntax]]<br />
** [[Legacy:Operators|Operators]]<br />
** [[Legacy:Object (UT)|Object class]]</div>Bc179129.bendcable.comhttps://wiki.beyondunreal.com/Legacy:Global_Function_(UT)?diff=3400&oldid=prevWormbo: better description for the string functions2006-02-01T17:53:57Z<p>better description for the string functions</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:53, 1 February 2006</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L81" >Line 81:</td>
<td colspan="2" class="diff-lineno">Line 81:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Operators|Operators]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Operators|Operators]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Object (UT)|Object class]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** [[Legacy:Object (UT)|Object class]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">==Discussion==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:'''Nobody:''' Do all the string functions count the first character of the passed string as 0? I know it says here that instr(...) does this, and I've updated mid(...) to show this, not sure of the others, if so needs clarified.</ins></div></td></tr>
</table>Wormbo