[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 exists in the cargobay and is taking up room (cargo units) 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 there is of.
Use this command to check how much of the room a ware is taking up in a cargobay as a percentage of the max cargo space. This command will NOT find wares that are 'Installed' on a ship, eg: guns, shields or 'Built In' components.
Example:
$target = get tracking aim
If $target is of class ship
| $store.percentage = $target get ware storage percentage: ware Energy Cells in cargo bay
| IF $store.percentage > 0
| | $message = sprintf: fmt='Storage space used by Energy Cells is %s%', $store.percentage, 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 are present in the cargobay and if so, how much room they are taking up as a percentage of the total storage space. If Energy Cells are present in the cargobay it will display the subtitle $message for 5 seconds. The $message will contain the percentage of room taken up by Energy Cells in the cargobay.
Command Location:
- »» Trade Commands
- »» for Ships and Stations
<RetVar/IF><RefObj> get ware storage percentage: ware <Var/Ware> in cargo bay
- »» for Ships and Stations