<RetVar> = get max sectors in y direction

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> = get max sectors in y direction

Post by X2-Illuminatus » Mon, 1. Aug 11, 18:14

<RetVar> = get max sectors in y direction


<RetVar> = A variable where the requested information is stored.


This command returns the maximum number of sectors in the y direction.

The sectors on the universe map are arranged in a coordinate system. The point of origin is Kingdom End with the coordinates x = 0, y = 0, short form: (0|0). Starting from Kingdom End the x-coordinates go rightwards and the y-coordinates downwards. So each sector has own coordinates.
Note that this command returns the maximum number of sectors and not the maximum y-coordinate. The return value of this command is '20'. Based on the fact that '0' is a valid coordinate the maximum y-coordinate is '19'.


Example:

$max.x = get max sectors in x direction
$max.y = get max sectors in y direction
$x = 0
while $x < $max.x
|$y = 0
|while $y < $max.y
||$sector = get sector from universe index: x=$x, y=$y
||if $sector -> exists
|||$ship = create ship: type=Advanced Satellite owner=Player addto=$sector x=0 y=20000 z=0
||end
||inc $y =
|end
inc $x =
end
return null

This is an easy way to iterate through all existing sectors of the universe. That way you can do or check something in every sector. In this case a player owned Advanced satellite is built in each sector.


Related Commands:

<RetVar> = get max sectors in x direction


Command Location:

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

[TiP][49] 305145

Post by X2-Illuminatus » Sun, 2. Oct 11, 23:15

<RetVar> = get max sectors in y direction


<RetVar> = Eine Variable, in der die geforderte Information gespeichert wird.


Dieser Befehl gibt die maximale Anzahl an Sektoren in y-Richtung zurück.

Die Sektoren in der Universumkarte sind in einem Koordinatensystem angeordnet, dessen Ursprung in Königstal mit den Koordinaten x = 0, y = 0 Kurzform (0|0) liegt. Ausgehend von Königstal gehen die x-Koordinaten nach rechts und die y-Koordinaten nach unten. Somit hat jeder Sektor seine eigenen Koordinaten.
Beachte, dass dieser Befehl die maximale Anzahl an Sektoren und nicht die größtmögliche y-Koordinate zurückgibt. Der Rückgabewert dieses Befehls ist 20. Da 0 eine gültige Koordinate ist, ist die größtmögliche y-Koordinate 19.


Beispiel:

$max.x = get max sectors in x direction
$max.y = get max sectors in y direction
$x = 0
while $x < $max.x
|$y = 0
|while $y < $max.y
||$sector = get sector from universe index: x=$x, y=$y
||if $sector -> exists
|||$ship = create ship: type=Erweiterter Satellit owner=Spieler addto=$sector x=0 y=20000 z=0
||end
||inc $y =
|end
inc $x =
end
return null

Das Beispiel zeigt einen einfachen Weg, um alle Sektoren des Universums durchzugehen. Auf diese Weise kann man etwas in jedem Sektor überprüfen oder tun. In diesem Fall wird ein Erweiterter Satellit in jedem Sektor gebaut.


Verwandte Befehle:

<RetVar> = get max sectors in x direction


Zu finden unter:

Locked

Return to “MSCI Reference”