Resource

A single resource value a thing holds (i.e. fuel, electric charge, etc). This is the type returned by the Part:RESOURCES suffix

structure Resource
Suffix Type Description
NAME string Resource name
AMOUNT scalar Amount of this resource left
DENSITY scalar Density of this resource
CAPACITY scalar Maximum amount of this resource
TOGGLEABLE Boolean Can this tank be removed from the fuel flow
ENABLED Boolean Is this tank currently in the fuel flow
Resource:NAME
Access:Get only
Type:string

The name of the resource, i.e. “LIQUIDFUEL”, “ELECTRICCHARGE”, “MONOPROP”.

Resource:AMOUNT
Access:Get only
Type:scalar

The value of how much resource is left.

Resource:DENSITY
Access:Get only
Type:scalar

The density value of this resource, expressed in Megagrams f mass per Unit of resource. (i.e. a value of 0.005 would mean that each unit of this resource is 5 kilograms. Megagrams [metric tonnes] is the usual unit that most mass in the game is represented in.)

Resource:CAPACITY
Access:Get only
Type:scalar

What AMOUNT would be if the resource was filled to the top.

Resource:TOGGLEABLE
Access:Get only
Type:Boolean

Many, but not all, resources can be turned on and off, this removes them from the fuel flow.

Resource:ENABLED
Access:Get/Set
Type:Boolean

If the resource is TOGGLEABLE, setting this to false will prevent the resource from being taken out normally.