<RetVar/IF> has <Value> been discovered

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
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24969
Joined: Sun, 2. Apr 06, 16:38
x4

<RetVar/IF> has <Value> been discovered

Post by X2-Illuminatus » Thu, 28. Jul 11, 14:42

[skip|else] if [not]|while [not]| <RetVar/IF> has <Value> been discovered


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Use a variable, if the command should return information. If a variable is used, it will contain '1' if the <Value> has been discovered and '0' if it hasn't.
<Value> = An object that exists in the game. Valid values are ships and stations (as well as their types), sectors and wares.


This command will check, if the as <Value> selected object has been discovered by the player. Whereby discovered mean that the object had to be in the scanner range of one of the player's assets.


Example:

$sector=[PLAYERSHIP] -> get sector
$station.arr=$sector -> get station array from sector
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|if not has $station been discovered
||$index= get index of $station in array $station.arr offset=-1 + 1
||remove element from array $station.arr at index $index
|end
end
return null

This will get all already discovered stations in the current player sector and save them in the $station.arr array.


Related Commands:

set discovered status: type=<Value> status=<Var/Boolean>


Command Location:

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

[TiP][49] 304906

Post by X2-Illuminatus » Sat, 1. Oct 11, 13:35

[skip|else] if [not]|while [not]| <RetVar/IF> has <Value> been discovered


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Nutze eine Variable, wenn der Befehl eine Information zurückgeben soll. Wenn eine Variable genutzt wird, wird sie '1' enthalten, wenn <Value> bereits entdeckt wurde, und '0' wenn nicht.
<Value> = Ein Objekt, das im Spiel existiert. Gültige Objekte sind Schiffe und Stationen (sowie ihre Typen), Sektoren und Waren.


Dieser Befehl überprüft, ob das als <Value> ausgewählte Objekt vom Spieler entdeckt wurde. Wobei entdeckt bedeutet, dass das Objekt in der Scannereichweite von einem der Spielerbesitztümer gewesen sein muss.


Beispiel:

$sector=[PLAYERSHIP] -> get sector
$station.arr=$sector -> get station array from sector
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|if not has $station been discovered
||$index= get index of $station in array $station.arr offset=-1 + 1
||remove element from array $station.arr at index $index
|end
end
return null

Mit diesem Beispiel erhält man alle bereits entdeckten Stationen im aktuellen Spielersektor. Die Stationen werden im Array $station.arr gespeichert.


Verwandte Befehle:

set discovered status: type=<Value> status=<Var/Boolean>


Zu finden unter:

Return to “MSCI Reference”