<RetVar> = get ware from maintype <Var/Number> and subtype <Var/Number>

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> = get ware from maintype <Var/Number> and subtype <Var/Number>

Post by mark_a_condren » Fri, 3. Dec 10, 11:22

<RetVar> = get ware from maintype <Var/Number> and subtype <Var/Number>


<RetVar> = The command return will be stored in this variable.
<Var/Number> = The maintype number of the ware you wish to get.
<Var/Number> = The subtype number of the ware of the maintype.


Each ware belongs to a main and sub-category called maintype and subtype.
This instruction returns the ware specified by the numerical 'maintype' and 'subtype' as entered in the command.

If a 'subtype' is specified that does not exist, the number is greater than the amount of subtypes for that maintype, this will result in a return of 'null'. This can be avoided by getting the number of 'subtypes' first using the '<RetVar> = get number of subtypes of maintype <Var/Number>' command.


Example:

$ware = get ware from maintype 8 and subtype 5

The $ware returned will be of 'maintype' 8 and 'subtype' 5. In this case, $ware will be Fragmentation Bomb Launcher


Additional Information:

A list of Maintypes and their Subtypes can be found here.


Command Location:

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

[TiP][49] 292549

Post by X2-Illuminatus » Thu, 16. Dec 10, 23:30

<RetVar> = get ware from maintype <Var/Number> and subtype <Var/Number>


<RetVar> = Der Rückgabewert des Befehls wird in dieser Variable gespeichert.
<Var/Number> = Die Nummer des Maintypes der Ware, die du ermitteln möchtest.
<Var/Number> = Die Nummer des Subtypes vom gewählten Maintype der Ware.


Jede Ware und jedes Objekt gehören zu einer Haupt- und einer Unterkategorie, die "Maintype" und "Subtype" genannt werden.
Dieser Befehl gibt die Ware, die zum ausgewählten Maintype und Subtype gehört, zurück.

Wenn ein Subtype ausgewählt wird, der nicht existiert (die gewählte Nummer höher als die Anzahl der Subtypes des gewählten Maintypes ist), wird 'null' zurückgegeben. Dies kann verhindert werden, indem man zunächst die Anzahl der Subtypes mithilfe des Befehls '<RetVar> = get number of subtypes of maintype <Var/Number>' ermittelt.


Beispiel:

$Ware = get ware from maintype 8 and subtype 5

Die zurückgegeben $Ware wird aus dem Maintype 8 und dem Subtype 5 sein. In diesem Fall wird $Ware der Splitterbombenwerfer sein.


Zusätzliche Information:

Eine Liste der Maintypes und Subtypes findet sich hier.


Zu finden unter:

Return to “MSCI Reference”