EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
<RetVar> = get max sectors in y direction
Post new topic This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic
Author Message
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 19993 on topic

Thank you for registering your game
PostPosted: Mon, 1. Aug 11, 18:14    Post subject: <RetVar> = get max sectors in y direction Reply with quote Print

<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:


Back to top
View user's profile Send private message Visit poster's website
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 19993 on topic

Thank you for registering your game
PostPosted: Sun, 2. Oct 11, 23:15    Post subject: [TiP][49] 305145 Reply with quote Print

<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:


Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic This topic is locked: you cannot edit posts or make replies.
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sun, 23. Jul 17, 00:47

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.30136 seconds, sql queries = 16