Instructions/Get from Component: Difference between revisions

From Desynced Wiki
(informational)
No edit summary
Line 3: Line 3:
==== Description ====
==== Description ====


 
Get the value and number from a specified index of a component register.
==== Uses ====
==== Uses ====
Can typically be used to get the target of a Turret, Repair Component, Deconstructor or Miner.
Can typically be used to get the target of a Turret, Repair Component, Deconstructor or Miner.

Revision as of 05:18, 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

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

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