Instructions/Get from Component: Difference between revisions

From Desynced Wiki
No edit summary
No edit summary
 
Line 10: Line 10:


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.
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.
[[File:ExampleComponentIndex.PNG]]


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.
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.

Latest revision as of 06:15, 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[edit | edit source]

Get the value and number from a specified index of a component register.

Uses[edit | edit source]

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[edit | edit source]

Set to Component