[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = RetVar is if you want to save the quantity to a variable. IF will check to see if the ware can go in the cargobay and return True / False.
<RefObj> = The 'Object' (Ship/Station) that the command is to be run on.
<Var/Ware> = What you want to know how much of will fit into the cargobay.
Use this command to check how much of an item will fit into the 'free' (available) space in the cargobay. This command will take into account the type of ware it is, eg a tradeable ware or a ship extension like engine tunings.
<RetVar/IF> will be rounded DOWN the the nearest whole number.
Example:
$target = get tracking aim
If $target is of class ship
| $free.amount = $target get free amount of ware Energy Cells in cargo bay
| IF $free.amount > 0
| | $message = sprintf: fmt='Free space for Energy Cells is %s', $free.amount, null, null, null, null
| | display subtitle text: text=$message duration=5000 ms
| end
end
This will get the players tracking aim and if it is a ship it will check to see if Energy Cells will fit into the cargobay. If Energy Cells will fit into the cargobay it will display the subtitle $message for 5 seconds. The $message will contain the amount of Energy Cells that will fit into the free space in the cargobay.
Command Location:
- »» Trade Commands
- »» for Ships and Stations
<RetVar/IF><RefObj> get free amount of ware <Var/Ware> in cargo bay
- »» for Ships and Stations