Instructions/Get from Component: Difference between revisions

From Desynced Wiki
(Created page with "{{Instruction_Top}} ==== Description ==== ==== Uses ==== ==== Similar Instructions ==== {{Instruction_Bottom}}")
 
(informational)
Line 5: Line 5:


==== Uses ====
==== Uses ====
Can typically be used to get the target of a Turret, Repair Component, Deconstructor or Miner.


0 and 1 are both treated as index 1.


A component seldom has multiple registers, but for the few that exist, any number from 1 - n can be used to specify what index to read data from.
In its most dynamic usage, it can be used to read directly from the parameters of another Behavior Controller, which can have a theoretically infinite amount of parameters.


==== Similar Instructions ====
==== Similar Instructions ====


 
[[Instructions/Set to Component|Set to Component]]
{{Instruction_Bottom}}
{{Instruction_Bottom}}

Revision as of 05:17, 17 September 2023


Get from Component
     
     Reads a value from a component register
Lua ID get_comp_reg
Category Math
Icon Set Component Reg.png
Argument One: Type Input
Argument One: Name From
Argument One: Description Component and register number to get
Argument One: Data Type comp_num
Argument Two: Type Output
Argument Two: Name Value
Argument Two: Description Value of Register
Argument Three: Type Input
Argument Three: Name Component Index
Argument Three: Description Component index if multiple are equipped
Argument Three: Data Type num



Description

Uses

Can typically be used to get the target of a Turret, Repair Component, Deconstructor or Miner.

0 and 1 are both treated as index 1.

A component seldom has multiple registers, but for the few that exist, any number from 1 - n can be used to specify what index to read data from.

In its most dynamic usage, it can be used to read directly from the parameters of another Behavior Controller, which can have a theoretically infinite amount of parameters.

Similar Instructions

Set to Component