Power (PowerComponent, ActorStreamingPowerNode) - yozozchomutova/AstroModdingKit GitHub Wiki

Power Component

Component, that allows you to store, consume or produce power in power network. If you have power slots, check Actor Streaming Power Node Component.

Component parameters:

  • Enabled - If component is enabled (if Net Power Output will actually contribute in power network)
  • Storage Capacity - How many units of power can item store.
  • Discharge Rate - Maximum amount of units of power, it can DISCHARGE at the time. (per second)
  • Charge Rate - Maximum amount of units of power, it can CHARGE at the time. (per second)
  • Current Carge Rate - ? Do not set in editor, you can change it in runtime. Tells how much power it charges per second. ?
  • Net Actual Load - How many units of power item actually contributes to power network (When item draws -5 U/s, but there is only 3 U/s being generated, then NetActualLoad will be -3 U/s)
  • ...
  • Discrete Delta - Every <value> units of power charged/discharged will result in notify/ping/beep sound. (Example: Your item has Storage Capacity 500 and Discrete Delta 50. You let it fully charge. It will beep/notify 10 times, at: 50, 100, 150, 200, 250, 300, 350, 400, 450, 500)
  • ...
  • Net Power Output - How item contributes to power network. For power generators write there positive value. For power loads (machines) write there negative value.

Actor Streaming Power Node

Component, that takes and redistributes power to all other power slots. Use this component if you are using power slots in your physical item.

You must also add component in EntityLinkComponent (Inheried) like this:

image

Item drawing power (e.g. machine)

You will have to use Net Power Output, Enabled, Net Actual Load variables here. Write some negative value (negative, because it takes power) in Net Power Output variable. Then you control if machine is working/using power or not by Enabled boolean variable. Net Actual Load can be used to control speed of machine.
Here is example scheme of how you can know, if machine is properly powered:

image

Example: If Net Power Output is -10 and there are 2 RTGS (producing 8 U/s in total), then output from this scheme will be 0,8. Net Actual Load would be -8 here.

⚠️ **GitHub.com Fallback** ⚠️