Write Latch (LogiX node)
Write Latch | ||
---|---|---|
![]() | ||
Inputs | ||
Impulse | Set | |
Impulse | Reset | |
dummy | SetValue | |
dummy | ResetValue | |
Outputs | ||
IValue`1 | Target | |
Impulse | OnSet | |
Impulse | OnReset |
The Write Latch node node overwrites the referenced Target
value with the input SetValue
or ResetValue
when an impulse is received at Set
or Reset
respectively.
Usage
When spawned from the node browser, the SetValue
and ResetValue
inputs have a dummy datatype. This will overload to match the input data type when a valid input is connected. The type of these two inputs and that of the referenced Target
must match.
The OnSet
output fires an impulse after an impulse is received at Set
. This occurs regardless of whether there is a valid Target
or whether any Target
was actually written to. This continues the impulse chain which arrived at Set
.
The OnReset
output fires an impulse after an impulse is received at Reset
. This occurs regardless of whether there is a valid Target
or whether any Target
was actually written to. This continues the impulse chain which arrived at Reset
.
Changing the value of a Variable node, Component field etc. via a Write Latch 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.
Examples
These two images illustrate comparable LogiX setups using either one Write Latch node or two Write nodes. Note that the presence of the OnFail
impulse output and different behaviour of OnDone
and OnFail
compared with OnSet
and OnReset
means that the two setups are not exactly identical.
Node Menu
Actions | ||||||
---|---|---|---|---|---|---|
Back | -- | ++ | Drive | Drive Playback | Tween | Write |
Write Latch | Write Ref | Write Ref Latch |