Type ResourceNode
Resource Node
Methods
| divertPowerTo( ent, multiplier ) | Diverts power to the given entity from this node based on a given multiplier value. |
| getDivertedPower( ent ) | Returns the current power divert multiplier from this node to the given entity. |
| getLinkedEntities() | Returns a list of all entities that are currently linked to this node. |
| getMaximumPowerToDivert() | Returns the maximum amount of power that can be diverted from this node in addition to its baseline load. |
| getPowerDivertMultiplierLimit() | Returns the minimum and maximum multiplier values that can be used to divert power from this node. |
| getRemainingPowerToDivert() | Returns the remaining amount of power that can be diverted to entities on this node. |
| isLinkAllowed( ent ) | Returns whether the given entity can be linked to this node. |
| isLinked( ent ) | Returns whether the given entity has been linked to this node. |
Methods
- ResourceNode:divertPowerTo( ent, multiplier )
-
Diverts power to the given entity from this node based on a given multiplier value.
Environment:
ServerParameters:
-
(Entity) ent: The entity to divert power to. -
(number) multiplier: The multiplier to use to divert power (within the limits returned by getPowerDivertMultiplierLimit()).
Return values:
-
(boolean)True if diverting power succeeded, false otherwise. -
(string | nil)If diverting failed, the reason why.
-
- ResourceNode:getDivertedPower( ent )
-
Returns the current power divert multiplier from this node to the given entity.
Environment:
ServerParameters:
-
(Entity) ent: The entity to get the power divert multiplier for.
Return value:
(number | nil)The current power divert multiplier for the given entity, or nil if no power has been diverted. -
- ResourceNode:getLinkedEntities()
-
Returns a list of all entities that are currently linked to this node.
Environment:
Server - ResourceNode:getMaximumPowerToDivert()
-
Returns the maximum amount of power that can be diverted from this node in addition to its baseline load. This may be less than the value returned by getRemainingPowerToDivert() if entities have had their power reduced.
Environment:
Server - ResourceNode:getPowerDivertMultiplierLimit()
-
Returns the minimum and maximum multiplier values that can be used to divert power from this node.
Environment:
ServerReturn values:
-
(number)The minimum multiplier value permitted. -
(number)The maximum multiplier value permitted.
-
- ResourceNode:getRemainingPowerToDivert()
-
Returns the remaining amount of power that can be diverted to entities on this node. Each entity that exceeds a multiplier of 1 will reduce this value, while every entity that has a multiplier less than 1 will increase it. For example, an entity with a multiplier of 1.25 will reduce this value by 0.25.
Environment:
Server - ResourceNode:isLinkAllowed( ent )
-
Returns whether the given entity can be linked to this node.
Environment:
ServerParameters:
-
(Entity) ent: The entity to check.
-
- ResourceNode:isLinked( ent )
-
Returns whether the given entity has been linked to this node.
Environment:
ServerParameters:
-
(Entity) ent: The entity to check.
-