Difference between revisions of "Write (LogiX node)/ja"

From Neos Wiki
Jump to navigation Jump to search
(Created page with "== 一例 == 600px|Writeの使い方一例")
(Updating to match new version of source page)
Line 1: Line 1:
 
<languages></languages>
 
<languages></languages>
 +
<div class="mw-translate-fuzzy">
 
Writeノードは、インパルスを受信すると、参照されたターゲット値を入力値で上書きします。
 
Writeノードは、インパルスを受信すると、参照されたターゲット値を入力値で上書きします。
 +
</div>
  
 +
<div class="mw-translate-fuzzy">
 
<!--[[File:|border|256px|right]]-->
 
<!--[[File:|border|256px|right]]-->
 +
</div>
  
 +
<div class="mw-translate-fuzzy">
 
== Inputs & Outputs ==
 
== Inputs & Outputs ==
 
{| class="wikitable"
 
{| class="wikitable"
Line 20: Line 25:
 
| [[:Category:Types:Dummy| (dummy)]]
 
| [[:Category:Types:Dummy| (dummy)]]
 
|}
 
|}
 +
</div>
  
 +
 +
The <code>OnDone</code> output fires an impulse when the <code>Target</code> value has been successfully overwritten after an impulse was received at <code>Write</code> '''or''' the <code>Target</code> value is driven by a system which allows an attempted written variable to be hooked (e.g. [[Drive (LogiX node)|Drive]] node, [[ValueCopy (Component)|ValueCopy]] component, etc.). This impulse continues the impulse chain which arrived at <code>Write</code>.
 +
 +
 +
The <code>OnFail</code> output fires an impulse when the <code>Target</code> value could not be set, e.g. if the <code>Target</code> value is driven from another source which does not allow hooking of the written value, or if there is no valid <code>Target</code>. This impulse continues the impulse chain which arrived at <code>Write</code>.
 +
 +
 +
Changing the value of a Variable node, Component field etc. via a Write node results in a datamodel change which will then be synchronised to other users in the session. Note that changes are only synchronised at the end of every update so, if multiple writes to the same target are performed by a single client within an update, only the final value will be sent. Additionally, no changes will be broadcast if the value is reset to the value it held at the beginning of an update. Due to this synchronisation process, it is inadvisable to write to a value very regularly (e.g. every update) unless absolutely necessary. It is generally better to use the [[drive|Drive]] system instead for continuously changing values to avoid unnecessary network traffic. [https://github.com/Neos-Metaverse/NeosPublic/issues/2590#issuecomment-874788205 Source].
 +
 +
Generally, with a Write/Write Latch node, one can only write to component or slot fields which are value-typed (e.g. bools, ints, strings, floats), whereas reference-typed fields (e.g. slot, user, IAssetProvider<AudioClip> etc.) require [[Write Ref (LogiX node)|Write Ref]]. However, it ''is'' possible to write to reference-typed LogiX variable nodes using a Write/Write Latch node where it ''isn't'' possible to do so with Write Ref. It is also possible to write to reference-typed fields using Write/Write Latch if the input <code>SetValue</code> and <code>ResetValue</code> are RefIDs, rather than reference datatypes - it is generally not recommended to work with raw RefIDs though.
 +
 +
<div class="mw-translate-fuzzy">
 
{| class="wikitable"
 
{| class="wikitable"
 
|+Outputs
 
|+Outputs
Line 40: Line 58:
 
| [[:LogiX:Impulses|Impulse]]
 
| [[:LogiX:Impulses|Impulse]]
 
|}
 
|}
 +
</div>
  
 +
<div class="mw-translate-fuzzy">
 
== 使用方法 ==
 
== 使用方法 ==
 
ノード・ブラウザからスポーンされた場合、値の入力にはダミー(または未決定)の型が入っています。入力データ型と参照されるターゲットのデータ型は一致しなければなりません。
 
ノード・ブラウザからスポーンされた場合、値の入力にはダミー(または未決定)の型が入っています。入力データ型と参照されるターゲットのデータ型は一致しなければなりません。
 
+
</div>
Writeノードで値を書き込むと、ワールド内のすべてのユーザ間で値が同期されます。したがって、このノードが動作するたびに、ユーザー間のネットワークを介していくつかの情報が渡されなければなりません。通常、これは無視できないほどのものではありません(絶対的に巨大な文字列を書かない限り)。しかし、大量の書き込みが発生している場合は、ネットワークに大きな負荷がかかり、ラグが発生する可能性があります。LogiXのセットアップで値が非常に急速に変化したり、連続的に変化したりする必要がある場合は、新しい値を書き込むのではなく、直接値を上書きすることを検討してください。
 
 
 
== 一例 ==
 
[[File:LogiX.Actions.Write Example1.jpg|600px|Writeの使い方一例]]
 
 
 
== Node Menu ==
 
  
 
[[Category:LogiX{{#translation:}}|Write]]
 
[[Category:LogiX{{#translation:}}|Write]]
[[Category:LogiX: Actions{{#translation:}}|Write]]
+
[[Category:LogiX:Actions{{#translation:}}|Write]]
{{:NodeMenu-Actions{{#translation:}}}}
+
{{NodeMenu-Actions{{#translation:}}}}

Revision as of 05:04, 12 October 2021

Other languages:
English • ‎日本語 • ‎한국어

Writeノードは、インパルスを受信すると、参照されたターゲット値を入力値で上書きします。

Inputs & Outputs

Inputs
Color Label Type
Write Impulse
Value (dummy)


The OnDone output fires an impulse when the Target value has been successfully overwritten after an impulse was received at Write or the Target value is driven by a system which allows an attempted written variable to be hooked (e.g. Drive node, ValueCopy component, etc.). This impulse continues the impulse chain which arrived at Write.


The OnFail output fires an impulse when the Target value could not be set, e.g. if the Target value is driven from another source which does not allow hooking of the written value, or if there is no valid Target. This impulse continues the impulse chain which arrived at Write.


Changing the value of a Variable node, Component field etc. via a Write node results in a datamodel change which will then be synchronised to other users in the session. Note that changes are only synchronised at the end of every update so, if multiple writes to the same target are performed by a single client within an update, only the final value will be sent. Additionally, no changes will be broadcast if the value is reset to the value it held at the beginning of an update. Due to this synchronisation process, it is inadvisable to write to a value very regularly (e.g. every update) unless absolutely necessary. It is generally better to use the Drive system instead for continuously changing values to avoid unnecessary network traffic. Source.

Generally, with a Write/Write Latch node, one can only write to component or slot fields which are value-typed (e.g. bools, ints, strings, floats), whereas reference-typed fields (e.g. slot, user, IAssetProvider<AudioClip> etc.) require Write Ref. However, it is possible to write to reference-typed LogiX variable nodes using a Write/Write Latch node where it isn't possible to do so with Write Ref. It is also possible to write to reference-typed fields using Write/Write Latch if the input SetValue and ResetValue are RefIDs, rather than reference datatypes - it is generally not recommended to work with raw RefIDs though.

Outputs
Color Label Type
Target IValue<T>
OnDone Impulse
OnFail Impulse

使用方法

ノード・ブラウザからスポーンされた場合、値の入力にはダミー(または未決定)の型が入っています。入力データ型と参照されるターゲットのデータ型は一致しなければなりません。

Actions
Back -- ++ Drive Drive Playback Tween Write
Write Latch Write Ref Write Ref Latch