<RetVar/IF><RefObj> get free amount of ware <Var/Ware> in cargo bay

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

<RetVar/IF><RefObj> get free amount of ware <Var/Ware> in cargo bay

Post by mark_a_condren » Wed, 10. Nov 10, 16:14

[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> get free amount of ware <Var/Ware> in cargo bay


[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

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24967
Joined: Sun, 2. Apr 06, 16:38
x4

[TiP][49] 291043

Post by X2-Illuminatus » Fri, 26. Nov 10, 22:29

[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> get free amount of ware <Var/Ware> in cargo bay


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Nutze RetVar, wenn du die Anzahl in einer Variable speichern möchtest. IF hingegen wird überprüfen, ob eine Ware in den Frachtraum passt und TRUE / FALSE (wahr / falsch) zurückgeben.
<RefObj> = Das 'Objekt' (Schiff / Station), auf dem der Befehl ausgeführt werden soll.
<Var/Ware> = Die Ware, von der du die Anzahl, die in den Frachtraum passt, ermitteln möchtest.


Nutze diesen Befehl, um zu überprüfen, welche Menge einer Ware in den freien (verfügbaren) Laderaum passt. Dieser Befehl wird dabei den Warentyp berücksichtigen, also ob es sich um eine handelbare Ware oder um eine Schiffserweiterung wie Triebwerks-Tunings handelt.


<RetVar/IF> wird zur nächsten ganzen Zahl abgerundet.


Beispiel:

$target = get tracking aim
If $target is of class ship
| $free.amount = $target get free amount of ware Energiezellen in cargo bay
| IF $free.amount > 0
| | $Nachricht = sprintf: fmt='Freier Raum für Energiezellen ist %s', $free.amount, null, null, null, null
| | display subtitle text: text=$Nachricht duration=5000 ms
| end
end

Dies wird überprüfen, ob in den Laderaum des Ziels des Spielers (wenn es ein Schiff ist) Energziezellen passen. Wenn sie hinein passen, wird der Untertitel $Nachricht für 5 Sekunden angezeigt. Die $Nachricht enthält die Menge an Energiezellen, die in den freien Laderaum passen.

Zu finden unter:
  • »» Trade Commands
    • »» for Ships and Stations
      <RetVar/IF><RefObj> get free amount of ware <Var/Ware> in cargo bay

Return to “MSCI Reference”