<RetVar/IF> <RefObj> is of class <Var/Class>

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

<RetVar/IF> <RefObj> is of class <Var/Class>

Post by Serial Kicked » Tue, 7. Sep 10, 22:00

[skip|else] if [not]|while [not]|<RetVar/IF> = <RefObj> -> if of class <Var/Class>


[skip|else] if [not]|while [not]| = The possible 'conditional' statements that can be used with this command.
<RetVar/IF> = variable where the requested information is put.
<RefObj> = The object you want to check.
<Var/Class> = An object class.


This function check if the object is of the specified class. It will return [TRUE] if <RefObj> belongs to the <Var/Class> or any children of this class. Otherwise, or if the object doesn't exist, it will return null.


Example:

if [PLAYERSHIP] -> is of class Freighter
| write to logbook "you are flying a trading ship"
else
| write to logbook "you are flying a combat ship"
end


Related Commands:

<RetVar/IF> = <RefObj> -> get object class


Additional Information:

List of Ingame Object Classes.


Command Location:

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

[TiP][49] 286422

Post by X2-Illuminatus » Mon, 31. Jan 11, 16:58

[skip|else] if [not]|while [not]|<RetVar/IF> = <RefObj> -> if of class <Var/Class>


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Variable, in der die geforderte Information gespeichert wird.
<RefObj> = Das Objekt, das überprüft werden soll.
<Var/Class> = Eine Objektklasse.


Dieser Befehl überprüft, ob das gewählte Objekt die gewählte Klasse hat. Es gibt [TRUE] (wahr) zurück, wenn das <RefObj> zur <Var/Class> oder zu einer Unterklasse gehört. Andernfalls, oder wenn das Objekt nicht existiert, wird null zurückgegeben.


Beispiel:

if [PLAYERSHIP] -> is of class Frachter
| write to logbook "Du fliegst ein Handelsschiff"
else
| write to logbook "Du fliegst ein Kampfschiff"
end


Ähnliche Befehle:

<RetVar/IF> = <RefObj> -> get object class


Zusätzliche Information:

Liste der spielinternen Objektklassen.


Zu finden unter:

Return to “MSCI Reference”