ProtoFlux:Field Hook: Difference between revisions

From Resonite Wiki
Added the Field Hook node page.
 
Clarify hooking
 
Line 19: Line 19:
|}}
|}}


The '''Field Hook''' node takes in a target [[Type:IField`1|field]] and the source field value, then returns if this field is [[Drive|driving]] or hooked, as well as allowing the [[User|user]] to start and stop driving this field. This node gives the user more control to programmatically drive fields directly using ProtoFlux.
The '''Field Hook''' node takes in a target [[Type:IField`1|field]] and the source field value, then returns if this field is [[Drive|driving]], as well as allowing the [[User|user]] to start and stop driving this field. This node gives the user more control to programmatically drive fields directly using ProtoFlux. This node hooks the given field, so whenever something external tries to write to it, it will receive a pulse from OnHook as well as the value it tried to write from HookedValue.


== Inputs ==
== Inputs ==
Line 51: Line 51:
=== OnHook ([[Impulses|Call]]) ===
=== OnHook ([[Impulses|Call]]) ===


Fires when the target field has finally hooked on.
Fires when something writes to the target field while it is being driven by this node.


=== IsDriving ([[Type:bool|bool]]) ===
=== IsDriving ([[Type:bool|bool]]) ===
Line 59: Line 59:
=== HookedValue (Generic) ===
=== HookedValue (Generic) ===


Returns the hooked field value.
Returns the value that was written by the OnHook call.


[[Category:ProtoFlux:Core]]
[[Category:ProtoFlux:Core]]

Latest revision as of 13:58, 13 February 2025

Field Hook
StartDrive
OnStartDrive
StopDrive
OnStopDrive
Target
OnHook
Source
IsDriving
HookedValue
Core

The Field Hook node takes in a target field and the source field value, then returns if this field is driving, as well as allowing the user to start and stop driving this field. This node gives the user more control to programmatically drive fields directly using ProtoFlux. This node hooks the given field, so whenever something external tries to write to it, it will receive a pulse from OnHook as well as the value it tried to write from HookedValue.

Inputs

StartDrive (Call)

Calls an impulse to start driving the target (hooking into it).

StopDrive (Call)

Calls an impulse to stop driving the target (unhooking it).

Target (IField`1)

The target field to drive.

Source (Generic)

The source to drive from.

Outputs

OnStartDrive (Continuation)

Fires when we started driving the target field.

OnStopDrive (Continuation)

Fires when we stopped driving the target field.

OnHook (Call)

Fires when something writes to the target field while it is being driven by this node.

IsDriving (bool)

Returns if the target field is being driven.

HookedValue (Generic)

Returns the value that was written by the OnHook call.