AggregateResource¶
A ship can have many parts that contain resources (i.e. fuel, electric charge, etc). kOS has several tools for getting the summation of each resource.
This is the type returned as the elements of the list from LIST RESOURCES.
IN MyList <list command>
PRINT "THESE ARE ALL THE RESOURCES ON THE SHIP:".
LIST RESOURCES IN RESLIST.
FOR RES IN RESLIST {
PRINT "Resource " + RES:NAME.
PRINT " value = " + RES:AMOUNT.
PRINT " which is "
+ ROUND(100*RES:AMOUNT/RES:CAPACITY)
+ "% full.".
}.
This is also the type returned by STAGE:RESOURCES
PRINT "THESE ARE ALL THE RESOURCES active in this stage:".
SET RESLIST TO STAGE:RESOURCES.
FOR RES IN RESLIST {
PRINT "Resource " + RES:NAME.
PRINT " value = " + RES:AMOUNT.
PRINT " which is "
+ ROUND(100*RES:AMOUNT/RES:CAPACITY)
+ "% full.".
}.
- structure AggregateResource¶
Suffix
Type
Description
Resource name
Total amount remaining
Total amount when full
Density of this resource
Parts containing this resource
- AggregateResource:NAME¶
- Access
Get only
- Type
The name of the resource, i.e. “LIQUIDFUEL”, “ELECTRICCHARGE”, “MONOPROP”.
- AggregateResource:CAPACITY¶
- Access
Get only
- Type
What AMOUNT would be if the resource was filled to the top.
- AggregateResource:DENSITY¶
- Access
Get only
- Type
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.)