https://wiki.beyondunreal.com/w/index.php?action=history&feed=atomReplication block - Revision history2017-11-18T02:35:39ZRevision history for this page on the wikiMediaWiki 1.25.1https://wiki.beyondunreal.com/Replication_block?diff=44334&oldid=prevWormbo: more clarifications and details2011-03-07T13:35:30Z<p>more clarifications and details</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 13:35, 7 March 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L25" >Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</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>For variable replication there are also other useful actor properties, such as bNetInitial and bNetOwner, which further narrow down when to replicate the variable and who to replicate it to.</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>For variable replication there are also other useful actor properties, such as bNetInitial and bNetOwner, which further narrow down when to replicate the variable and who to replicate it to.</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 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>Unlike any other data type in UnrealScript, [[<del class="diffchange diffchange-inline">Dynamic_array|</del>dynamic arrays]] have absolutely no support for replication. Attempting to replicate a dynamic array variable will have no effect on the remote instance of that variable. Attempting to use a dynamic array as parameter of a [[replicated function]] will result in the parameter being empty when the function is executed on the remote side. <del class="diffchange diffchange-inline">'''Explain Why''' can loose sync! it is possible </del>to <del class="diffchange diffchange-inline">crosscheck </del>dynamic arrays <del class="diffchange diffchange-inline">but it would come at a cost</del>.</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>Unlike any other data type in UnrealScript, [[dynamic arrays]] have absolutely no support for replication <ins class="diffchange diffchange-inline">whatsoever</ins>. Attempting to replicate a dynamic array variable will have no effect on the remote instance of that variable. Attempting to use a dynamic array as parameter of a [[replicated function]] will result in the parameter being empty when the function is executed on the remote side. <ins class="diffchange diffchange-inline">Similar restrictions apply </ins>to dynamic arrays <ins class="diffchange diffchange-inline">within replicated struct values</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;"></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>==Exceptions==</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>==Exceptions==</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>For relatively obvious reasons, functions declared as ''static'', ''latent'' or ''iterator'' can't or shouldn't be replicated. Functions replicated to clients must be declared as ''simulated'' if you want them to be executable on ''ROLE_SimulatedProxy'' or ''ROLE_DumbProxy'' clients.</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>For relatively obvious reasons, functions declared as ''static'', ''latent'' or ''iterator'' can't or shouldn't be replicated. Functions replicated to clients must be declared as ''simulated'' if you want them to be executable on ''ROLE_SimulatedProxy'' or ''ROLE_DumbProxy'' clients<ins class="diffchange diffchange-inline">. Note that the UE3 [[Functions#Network modifiers|function modifiers]] ''client'' or ''demorecording'' already imply the ''simulated'' modifier, so you don't need to specify it again. The same goes for the ''native'' function modifier. Whether the similar [[DLLImport]] modifier implies ''simulated'' (or whether such functions support replication at all) is currently unknown, but then again you probably don't want to call such a function directly via replication</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;"></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="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>If a class is declared with the ''NativeReplication'' modifiers, the replication conditions in its replication block ignored for variables. Instead variable replication conditions are defined in native code. Function replication conditions are still specified in the replication block as usual. The reason these classes still contain replication conditions for variables is that UnrealScript coders should know when variables are actually replicated. The information may be inaccurate though, as the UT2004 [[UE2:Pickup (UT2004)|Pickup]] class shows. Its bOnlyReplicateHidden property turns off replication for all but the bHidden property.</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>If a class is declared with the ''NativeReplication'' modifiers, the replication conditions in its replication block <ins class="diffchange diffchange-inline">are </ins>ignored for variables. Instead variable replication conditions are defined in native code. Function replication conditions are still specified in the replication block <ins class="diffchange diffchange-inline">(or in UE3 via function modifiers) </ins>as usual. The reason these classes still contain replication conditions for variables is that UnrealScript coders should know when variables are actually replicated. The information may be inaccurate though, as the UT2004 [[UE2:Pickup (UT2004)|Pickup]] class shows. Its bOnlyReplicateHidden property turns off replication for all but the bHidden property.</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 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>Replicating variables declared as ''config'', ''globalconfig'' or ''localized'' may not have the desired effect as these variables may have different initial values on the server and the clients. The configured or localized values ''are'' the default values on the server and replication only kicks in if the values have changed.</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>Replicating variables declared as ''config'', ''globalconfig'' or ''localized'' may not have the desired effect as these variables may have different initial values on the server and the clients. The configured or localized values ''are'' the default values on the server and replication only kicks in if the values have changed.</div></td></tr>
</table>Wormbohttps://wiki.beyondunreal.com/Replication_block?diff=43596&oldid=prevEliot at 01:53, 3 July 20102010-07-03T01:53:32Z<p></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 01:53, 3 July 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L35" >Line 35:</td>
<td colspan="2" class="diff-lineno">Line 35:</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>{{navbox unrealscript}}</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>{{navbox unrealscript}}</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;">[[Category:Replication]]</ins></div></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Replication_block?diff=42959&oldid=prev00zX: /* Syntax */ - Added note on dynamic arrays2010-04-20T21:35:28Z<p><span dir="auto"><span class="autocomment">Syntax: </span> - Added note on dynamic arrays</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 21:35, 20 April 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L24" >Line 24:</td>
<td colspan="2" class="diff-lineno">Line 24:</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>For variable replication there are also other useful actor properties, such as bNetInitial and bNetOwner, which further narrow down when to replicate the variable and who to replicate it to.</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>For variable replication there are also other useful actor properties, such as bNetInitial and bNetOwner, which further narrow down when to replicate the variable and who to replicate it to.</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;">Unlike any other data type in UnrealScript, [[Dynamic_array|dynamic arrays]] have absolutely no support for replication. Attempting to replicate a dynamic array variable will have no effect on the remote instance of that variable. Attempting to use a dynamic array as parameter of a [[replicated function]] will result in the parameter being empty when the function is executed on the remote side. '''Explain Why''' can loose sync! it is possible to crosscheck dynamic arrays but it would come at a cost.</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;"></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>==Exceptions==</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>==Exceptions==</div></td></tr>
</table>00zXhttps://wiki.beyondunreal.com/Replication_block?diff=40328&oldid=prevWormbo: Created page with 'The '''replication''' block specifies conditions for replicating variables and prior to Unreal Engine 3 also for functions. It contains one or more replication condit…'2009-12-10T12:48:04Z<p>Created page with 'The '''replication''' block specifies conditions for replicating <a href="/Variables" title="Variables">variables</a> and prior to <a href="/Unreal_Engine_3" title="Unreal Engine 3">Unreal Engine 3</a> also for <a href="/Functions" title="Functions">functions</a>. It contains one or more replication condit…'</p>
<p><b>New page</b></p><div>The '''replication''' block specifies conditions for replicating [[variables]] and prior to [[Unreal Engine 3]] also for [[functions]]. It contains one or more replication conditions, each with one or more variable or function names to which the condition applies.<br />
<br />
==Syntax==<br />
The general syntax of the replication block looks as follows:<br />
'''replication'''<br />
'''{'''<br />
''condition 1''<br />
''condition 2''<br />
...<br />
'''}'''<br />
<br />
Replication conditions in [[Unreal Engine 1]] and [[Unreal Engine 2|2]] have the following syntax:<br />
['''un''']'''reliable if ('''''boolean expression''''')'''<br />
''variable or function name'' [''',''' ...] ''';'''<br />
The keyword '''reliable''' or '''unreliable''' only affects functions, but still must be specified for variables even though it doesn't make a difference there. Unreliably replicated [[function calls]] may be dropped due to bandwidth saturation, while reliably replicated function calls will be delayed in that case.<br />
<br />
[[Unreal Engine 3]] uses simplified replication conditions because function replication is specified via [[Functions#Network modifiers|function modifiers]]:<br />
'''if ('''''boolean expression''''')'''<br />
''variable name'' [''',''' ...] ''';'''<br />
<br />
Typically a replication condition tests the local value of the [[Role]] property, usually as <code>Role == ROLE_Authority</code> for server-to-client replication or <code>Role != ROLE_Authority</code> for client-to-server replication. For replicated functions this is usually the only condition.<br />
<br />
In Unreal Engine 1 variables can be replicated from the server to all clients, but also from the client owning the actor to the server, similar to replicated function calls. That's why Unreal engine 1 replication conditions always check the Role. In Unreal Engine 2 and 3 variables can only be replicated from the server to clients, so technically the Role doesn't need to be checked at all. Still even Epic code contains Role checks for replicated variables in many classes.<br />
<br />
For variable replication there are also other useful actor properties, such as bNetInitial and bNetOwner, which further narrow down when to replicate the variable and who to replicate it to.<br />
<br />
==Exceptions==<br />
For relatively obvious reasons, functions declared as ''static'', ''latent'' or ''iterator'' can't or shouldn't be replicated. Functions replicated to clients must be declared as ''simulated'' if you want them to be executable on ''ROLE_SimulatedProxy'' or ''ROLE_DumbProxy'' clients.<br />
<br />
If a class is declared with the ''NativeReplication'' modifiers, the replication conditions in its replication block ignored for variables. Instead variable replication conditions are defined in native code. Function replication conditions are still specified in the replication block as usual. The reason these classes still contain replication conditions for variables is that UnrealScript coders should know when variables are actually replicated. The information may be inaccurate though, as the UT2004 [[UE2:Pickup (UT2004)|Pickup]] class shows. Its bOnlyReplicateHidden property turns off replication for all but the bHidden property.<br />
<br />
Replicating variables declared as ''config'', ''globalconfig'' or ''localized'' may not have the desired effect as these variables may have different initial values on the server and the clients. The configured or localized values ''are'' the default values on the server and replication only kicks in if the values have changed.<br />
<br />
{{navbox unrealscript}}</div>Wormbo