<RetVar/IF><RefObj> get warp gate: id=<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

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

<RetVar/IF><RefObj> get warp gate: id=<Var/Number>

Post by X2-Illuminatus » Tue, 2. Aug 11, 21:21

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> get warp gate: id=<Var/Number>


[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 a gate.
<RefObj> = A variable containing a sector.
<Var/Number> = A number or a variable containing one. Valid numbers are 0-5.


Returns the gate with the as <Var/Number> selected id in the as <RefObj> selected sector.

Each sector in the X-Universe can have a maximum of 6 gates. Each gate in a sector has a specific id, whereby the ids 0-3 are usually reserved for north (0), south (1), west (2) and east (3) gate. The ids 4 and 5 are free to use for additional gates, for example in the HUB or the Aldrin sector (after the Aldrin Expansion plot). Note, that it's also possible to create gates with different ids - possible ids are still 0-5, but for example you could use '1' as north gate - using the create gate[/color]-command.


Example:

$id = 6
while $id
|dec $id =
|if not $sector -> get warp gate: gate id=$id
||write to player logbook: printf: fmt='Gate id %s in sector %s is free to be used.', $id, $sector, null, null, null
|end
end
return null

Assuming the variable $sector contains a sector, this will check, which of the possible gate ids (0-5) are free to use and writes every available one with an appropriate message to the logbook.


Related Commands:

[url=http://forum.egosoft.com/viewtopic.php?t=305213]<RetVar> = <Var/Warpgate> get gate id



Command Location:

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

[TiP][49] 305211

Post by X2-Illuminatus » Mon, 3. Oct 11, 22:10

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> get warp gate: id=<Var/Number>


[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 ein Sprungtor enthalten.
<RefObj> = Eine Variable, die einen Sektor enthält.
<Var/Number> = Eine Ziffer oder eine Variable, die eine enthält. Gültige Zifferen sind 0-5.


Gibt das Tor mit der als <Var/Number> ausgewählten ID in dem als <RefObj> ausgewählten Sektor zurück.

In jedem Sektor im X-Universum können maximal 6 Sprungtore stehen. Jedes Tor hat eine eigene Identifikationsnummer (kurz ID). Die IDs 0-3 sind dabei normalerweise für Nord (0), Süd (1), West (2) und Ost (3) Tor reserviert. Die IDs 4 und 5 können für zusätzliche Tore genutzt werden, wie zum Beispiel im HUB-Sektor oder in Aldrin (nach dem Aldrin Plot). Beachte, dass es möglich ist, Tore mit unterschiedlichen IDs mithilfe des create gate[/color]-Befehls zu erstellen - die möglichen Ids gehen zwar immernoch von 0-5, aber man könnte bspw. 1 als ID für ein Nordtor nehmen.


Beispiel:

$id = 6
while $id
|dec $id =
|if not $sector -> get warp gate: gate id=$id
||write to player logbook: printf: fmt='Tor ID %s im Sektor %s wird nicht genutzt.', $id, $sector, null, null, null
|end
end
return null

Vorausgesetzt die Variable $sector enthält einen Sektor, wird dieses Beispiel überprüfen, welche der gültigen IDs (0-5) ungenutzt sind und schreibt jede ungenutzte ID mit einer entsprechenden Nachricht ins Logbuch.


Verwandte Befehle:

[url=http://forum.egosoft.com/viewtopic.php?t=305213]<RetVar> = <Var/Warpgate> get gate id



Zu finden unter:

Locked

Return to “MSCI Reference”