https://wiki.beyondunreal.com/w/index.php?action=history&feed=atom UnrealScript - Revision history 2017-11-17T21:34:37Z Revision history for this page on the wiki MediaWiki 1.25.1 https://wiki.beyondunreal.com/UnrealScript?diff=43557&oldid=prev Eliot: start with a wp link 2010-06-29T23:11:26Z <p>start with a wp link</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:11, 29 June 2010</td> </tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td> <td colspan="2" class="diff-lineno">Line 1:</td></tr> <tr><td class='diff-marker'>&#160;</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>:''See [[UnrealScript overview]] for all Unreal Wiki topics about learning and using UnrealScript.''</div></td><td class='diff-marker'>&#160;</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>:''See [[UnrealScript overview]] for all Unreal Wiki topics about learning and using UnrealScript.''</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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="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 class="diffchange diffchange-inline">'''</del>UnrealScript<del class="diffchange diffchange-inline">''' </del>is the [[Unreal Engine]]'s [[wp:scripting language|scripting language]]. It is a [[wp:Type system#Static typing|staticly]]/[[wp:strongly-typed|strongly-typed]], [[wp:object-oriented|object-oriented]] and [[wp:Event-driven programming|event-driven]] programming language very similar to [[wp:Java (programming language)|Java]] and [[wp:C++|C++]], with some influences from [[wp:Visual Basic|Visual Basic]]. If you want to learn UnrealScript, you should make yourself familiar with the fundamental concepts of object-oriented programming. It definitely helps already to know another programming language, preferably one that is strongly-typed and object-oriented as well.</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><ins class="diffchange diffchange-inline">[[wp:</ins>UnrealScript<ins class="diffchange diffchange-inline">|UnrealScript]] </ins>is the [[Unreal Engine]]'s [[wp:scripting language|scripting language]]. It is a [[wp:Type system#Static typing|staticly]]/[[wp:strongly-typed|strongly-typed]], [[wp:object-oriented|object-oriented]] and [[wp:Event-driven programming|event-driven]] programming language very similar to [[wp:Java (programming language)|Java]] and [[wp:C++|C++]], with some influences from [[wp:Visual Basic|Visual Basic]]. If you want to learn UnrealScript, you should make yourself familiar with the fundamental concepts of object-oriented programming. It definitely helps already to know another programming language, preferably one that is strongly-typed and object-oriented as well.</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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'>&#160;</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>==Anatomy of an UnrealScript source file==</div></td><td class='diff-marker'>&#160;</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>==Anatomy of an UnrealScript source file==</div></td></tr> </table> Eliot https://wiki.beyondunreal.com/UnrealScript?diff=43376&oldid=prev Wormbo: also staticly typed and event-driven with influences from VB 2010-05-25T19:00:01Z <p>also staticly typed and event-driven with influences from VB</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 19:00, 25 May 2010</td> </tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td> <td colspan="2" class="diff-lineno">Line 1:</td></tr> <tr><td class='diff-marker'>&#160;</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>:''See [[UnrealScript overview]] for all Unreal Wiki topics about learning and using UnrealScript.''</div></td><td class='diff-marker'>&#160;</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>:''See [[UnrealScript overview]] for all Unreal Wiki topics about learning and using UnrealScript.''</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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="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>'''UnrealScript''' is the [[Unreal Engine]]'s [[wp:scripting language|scripting language]]. It is a [[wp:strongly-typed|strongly-typed]], [[wp:object-oriented|object-oriented]] programming language very similar to [[wp:Java (programming language)|Java]] and [[wp:C++|C++]]. If you want to learn UnrealScript, you should make yourself familiar with the fundamental concepts of object-oriented programming. It definitely helps already to know another programming language, preferably one that is strongly-typed and object-oriented as well.</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>'''UnrealScript''' is the [[Unreal Engine]]'s [[wp:scripting language|scripting language]]. It is a <ins class="diffchange diffchange-inline">[[wp:Type system#Static typing|staticly]]/</ins>[[wp:strongly-typed|strongly-typed]], [[wp:object-oriented|object-oriented<ins class="diffchange diffchange-inline">]] and [[wp:Event-driven programming|event-driven</ins>]] programming language very similar to [[wp:Java (programming language)|Java]] and [[wp:C++|C++<ins class="diffchange diffchange-inline">]], with some influences from [[wp:Visual Basic|Visual Basic</ins>]]. If you want to learn UnrealScript, you should make yourself familiar with the fundamental concepts of object-oriented programming. It definitely helps already to know another programming language, preferably one that is strongly-typed and object-oriented as well.</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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'>&#160;</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>==Anatomy of an UnrealScript source file==</div></td><td class='diff-marker'>&#160;</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>==Anatomy of an UnrealScript source file==</div></td></tr> </table> Wormbo https://wiki.beyondunreal.com/UnrealScript?diff=33960&oldid=prev GreatEmerald: 19, not 18 2009-01-20T17:48:42Z <p>19, not 18</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:48, 20 January 2009</td> </tr><tr><td colspan="2" class="diff-lineno" id="L57" >Line 57:</td> <td colspan="2" class="diff-lineno">Line 57:</td></tr> <tr><td class='diff-marker'>&#160;</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>* Line 16 assigns a value to the local variable &quot;GP&quot; so it no longer is empty. To determine the value, the function accesses the variable &quot;Level&quot;. This variable is not declared here, but in a parent class of DMRosterBeatTeam. The object referenced by &quot;Level&quot; has a variable of its own, called &quot;Game&quot;, whose contained object in turn has a variable called &quot;CurrentGameProfile&quot;. The content of that variable is assigned to our local &quot;GP&quot; variable.</div></td><td class='diff-marker'>&#160;</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>* Line 16 assigns a value to the local variable &quot;GP&quot; so it no longer is empty. To determine the value, the function accesses the variable &quot;Level&quot;. This variable is not declared here, but in a parent class of DMRosterBeatTeam. The object referenced by &quot;Level&quot; has a variable of its own, called &quot;Game&quot;, whose contained object in turn has a variable called &quot;CurrentGameProfile&quot;. The content of that variable is assigned to our local &quot;GP&quot; variable.</div></td></tr> <tr><td class='diff-marker'>&#160;</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>* On line 17 there's an [[If statement]] with a block of code that ends on line 20. That block of code is only executed if the expression in the parentheses following the keyword ''If'' returns the value ''True''. The ''If'' condition checks, whether the content of the local &quot;GP&quot; variable equals the special value ''None'', which simply means &quot;empty&quot;.</div></td><td class='diff-marker'>&#160;</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>* On line 17 there's an [[If statement]] with a block of code that ends on line 20. That block of code is only executed if the expression in the parentheses following the keyword ''If'' returns the value ''True''. The ''If'' condition checks, whether the content of the local &quot;GP&quot; variable equals the special value ''None'', which simply means &quot;empty&quot;.</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 class="diffchange diffchange-inline">Line </del>18 and <del class="diffchange diffchange-inline">18 </del>are only executed if the condition (here: &quot;GP is empty&quot;) is true. So, if GP is empty, first the function with the name &quot;Log&quot; is called to write a message to the log file, then the [[Return statement]] exits the function. In this case the code after the ''If'' block will not be executed. In other cases the ''If'' block might not contain a ''Return'' and code execution would continue after the ''If'' block.</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>* <ins class="diffchange diffchange-inline">Lines </ins>18 and <ins class="diffchange diffchange-inline">19 </ins>are only executed if the condition (here: &quot;GP is empty&quot;) is true. So, if GP is empty, first the function with the name &quot;Log&quot; is called to write a message to the log file, then the [[Return statement]] exits the function. In this case the code after the ''If'' block will not be executed. In other cases the ''If'' block might not contain a ''Return'' and code execution would continue after the ''If'' block.</div></td></tr> <tr><td class='diff-marker'>&#160;</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>* On line 23 there's a typical [[For loop]] that iterates over a [[dynamic array]]. The code on lines 25 to 27 is executed for each element of the &quot;PlayerTeam&quot; array in the object stored in the local &quot;GP&quot; variable. Notice how the ''If'' statement on line 17 ensured that &quot;GP&quot; actually contains an object.</div></td><td class='diff-marker'>&#160;</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>* On line 23 there's a typical [[For loop]] that iterates over a [[dynamic array]]. The code on lines 25 to 27 is executed for each element of the &quot;PlayerTeam&quot; array in the object stored in the local &quot;GP&quot; variable. Notice how the ''If'' statement on line 17 ensured that &quot;GP&quot; actually contains an object.</div></td></tr> <tr><td class='diff-marker'>&#160;</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>* Line 34 calls another version of the &quot;Initialize&quot; function, that was declared in a parent class of DMRosterBeatTeam, passing on the TeamBots parameter. This call tells us, that the &quot;Initialize&quot; function of the DMRosterBeatTeam class actually [[wp:Method overriding (programming)|overrides]] a function with the same name in its parent class xDMRoster or another parent class further up the class hierarchy.</div></td><td class='diff-marker'>&#160;</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>* Line 34 calls another version of the &quot;Initialize&quot; function, that was declared in a parent class of DMRosterBeatTeam, passing on the TeamBots parameter. This call tells us, that the &quot;Initialize&quot; function of the DMRosterBeatTeam class actually [[wp:Method overriding (programming)|overrides]] a function with the same name in its parent class xDMRoster or another parent class further up the class hierarchy.</div></td></tr> </table> GreatEmerald https://wiki.beyondunreal.com/UnrealScript?diff=11730&oldid=prev Azrael: /* Anatomy of an UnrealScript source file */ 2008-05-05T12:03:32Z <p>‎<span dir="auto"><span class="autocomment">Anatomy of an UnrealScript source file</span></span></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 12:03, 5 May 2008</td> </tr><tr><td colspan="2" class="diff-lineno" id="L4" >Line 4:</td> <td colspan="2" class="diff-lineno">Line 4:</td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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'>&#160;</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>==Anatomy of an UnrealScript source file==</div></td><td class='diff-marker'>&#160;</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>==Anatomy of an UnrealScript source file==</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>A typical UnrealScript source file might look similar to the following example from [[UT2004]]:</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>A typical UnrealScript source file might look similar to the following example from [[<ins class="diffchange diffchange-inline">Unreal Tournament 2004|</ins>UT2004]]:</div></td></tr> <tr><td class='diff-marker'>&#160;</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>&lt;uscript line&gt;</div></td><td class='diff-marker'>&#160;</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>&lt;uscript line&gt;</div></td></tr> <tr><td class='diff-marker'>&#160;</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 DMRosterBeatTeam extends xDMRoster;</div></td><td class='diff-marker'>&#160;</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 DMRosterBeatTeam extends xDMRoster;</div></td></tr> </table> Azrael https://wiki.beyondunreal.com/UnrealScript?diff=10970&oldid=prev Wormbo: New page: :''See UnrealScript overview for all Unreal Wiki topics about learning and using UnrealScript.'' '''UnrealScript''' is the Unreal Engine's wp:scripting language|. It is a [[wp... 2008-04-11T20:36:21Z <p>New page: :&#039;&#039;See <a href="/UnrealScript_overview" title="UnrealScript overview">UnrealScript overview</a> for all Unreal Wiki topics about learning and using UnrealScript.&#039;&#039; &#039;&#039;&#039;UnrealScript&#039;&#039;&#039; is the <a href="/Unreal_Engine" class="mw-redirect" title="Unreal Engine">Unreal Engine</a>&#039;s <a href="http://en.wikipedia.org/wiki/scripting_language" class="extiw" title="wp:scripting language">wp:scripting language</a>. It is a [[wp...</p> <p><b>New page</b></p><div>:''See [[UnrealScript overview]] for all Unreal Wiki topics about learning and using UnrealScript.''<br /> <br /> '''UnrealScript''' is the [[Unreal Engine]]'s [[wp:scripting language|scripting language]]. It is a [[wp:strongly-typed|strongly-typed]], [[wp:object-oriented|object-oriented]] programming language very similar to [[wp:Java (programming language)|Java]] and [[wp:C++|C++]]. If you want to learn UnrealScript, you should make yourself familiar with the fundamental concepts of object-oriented programming. It definitely helps already to know another programming language, preferably one that is strongly-typed and object-oriented as well.<br /> <br /> ==Anatomy of an UnrealScript source file==<br /> A typical UnrealScript source file might look similar to the following example from [[UT2004]]:<br /> &lt;uscript line&gt;<br /> class DMRosterBeatTeam extends xDMRoster;<br /> <br /> /*<br /> * Roster for deathmatch levels.<br /> * Each level has its own roster. <br /> * This special roster subclass is used to populate an enemy team with the<br /> * player's selected teammates.<br /> */<br /> <br /> // called immediately after spawning the roster class<br /> function Initialize(int TeamBots)<br /> {<br /> local GameProfile GP;<br /> local int i, j;<br /> <br /> GP = Level.Game.CurrentGameProfile;<br /> if ( GP == none ) {<br /> Log(&quot;DMRosterBeatTeam::Initialized() failed. GameProfile == none.&quot;);<br /> return;<br /> }<br /> <br /> // create roster entries for single player's teammates<br /> for ( i=0; i&lt;GP.PlayerTeam.Length; i++ )<br /> {<br /> j = Roster.Length;<br /> Roster.Length = Roster.Length + 1;<br /> Roster[j] = class'xRosterEntry'.Static.CreateRosterEntryCharacter(GP.PlayerTeam[i]);<br /> }<br /> <br /> // remaining team-specific info, might be used in menus at some point<br /> TeamName = GP.TeamName;<br /> TeamSymbolName = GP.TeamSymbolName;<br /> <br /> super.Initialize(TeamBots);<br /> }<br /> <br /> defaultproperties<br /> {<br /> TeamName=&quot;Death Match&quot;<br /> TeamSymbolName=&quot;TeamSymbols_UT2003.Sym01&quot;<br /> }<br /> &lt;/uscript&gt;<br /> As you can see, UnrealScript is a [[wp:curly brace programming language|curly brace programming language]]: blocks of code are enclosed in curly braces. Each code statement is either followed by a block or terminated by a semicolon.<br /> <br /> * Line 1 contains the mandatory [[class declaration]]. This file contains a class with the name [[UE2:DMRosterBeatTeam (UT2004)|DMRosterBeatTeam]]. The [[extends clause]] specifies that this class [[wp:Inheritance (computer science)|inherits]] attributes, methods and other class members from a class with the name [[UE2:xDMRoster (UT2004)|xDMRoster]], which is said to be the &quot;super class&quot; or &quot;parent class&quot; of DMRosterBeatTeam.<br /> * Lines 3 to 8 are an example for a [[Comments#Block comments|block comment]]. The important parts here are the characters &lt;code&gt;/*&lt;/code&gt; on line 3 and &lt;code&gt;*/&lt;/code&gt; on line 8. Everything between them is ignored by the UnrealScript compiler.<br /> * Line 10 contains another type of comment, an end-of-line comment or just [[Comments#Line comments|line comment]]. Outside of block comments this type of comment starts with the characters &lt;code&gt;//&lt;/code&gt; and continues to the end of the same line. As with block comments, everything on the line following the double slashes is ignored by the compiler.<br /> * Line 11 contains a [[Function declarations|declaration]] for an [[instance function]]. The function's name is specified to be &quot;Initialize&quot; and the function has one parameter of type [[types#int|int]] called &quot;TeamBots&quot;. The block of code on lines 12 to 35 is the function's &quot;body&quot;. Some functions do not have a body. The declaration of those functions is terminated by a semicolon instead.<br /> * The line 13 declares a local variable of [[Types#Object|type]] [[UE2:GameProfile (UT2004)|GameProfile]], a class defined elsewhere, and gives it the name &quot;GP&quot;. The variable is initially empty.<br /> * Line 16 assigns a value to the local variable &quot;GP&quot; so it no longer is empty. To determine the value, the function accesses the variable &quot;Level&quot;. This variable is not declared here, but in a parent class of DMRosterBeatTeam. The object referenced by &quot;Level&quot; has a variable of its own, called &quot;Game&quot;, whose contained object in turn has a variable called &quot;CurrentGameProfile&quot;. The content of that variable is assigned to our local &quot;GP&quot; variable.<br /> * On line 17 there's an [[If statement]] with a block of code that ends on line 20. That block of code is only executed if the expression in the parentheses following the keyword ''If'' returns the value ''True''. The ''If'' condition checks, whether the content of the local &quot;GP&quot; variable equals the special value ''None'', which simply means &quot;empty&quot;.<br /> * Line 18 and 18 are only executed if the condition (here: &quot;GP is empty&quot;) is true. So, if GP is empty, first the function with the name &quot;Log&quot; is called to write a message to the log file, then the [[Return statement]] exits the function. In this case the code after the ''If'' block will not be executed. In other cases the ''If'' block might not contain a ''Return'' and code execution would continue after the ''If'' block.<br /> * On line 23 there's a typical [[For loop]] that iterates over a [[dynamic array]]. The code on lines 25 to 27 is executed for each element of the &quot;PlayerTeam&quot; array in the object stored in the local &quot;GP&quot; variable. Notice how the ''If'' statement on line 17 ensured that &quot;GP&quot; actually contains an object.<br /> * Line 34 calls another version of the &quot;Initialize&quot; function, that was declared in a parent class of DMRosterBeatTeam, passing on the TeamBots parameter. This call tells us, that the &quot;Initialize&quot; function of the DMRosterBeatTeam class actually [[wp:Method overriding (programming)|overrides]] a function with the same name in its parent class xDMRoster or another parent class further up the class hierarchy.<br /> * Lines 37 to 41 are the [[defaultproperties]] block. This block defines default values for class variables. Both &quot;TeamName&quot; and &quot;TeamSymbolName&quot; are inherited from a parent class.<br /> <br /> {{navbox unrealscript}}</div> Wormbo