EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
<RetVar/IF><RefObj> is sector known by the player
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: 19748 on topic

Thank you for registering your game
PostPosted: Mon, 1. Aug 11, 20:36    Post subject: <RetVar/IF><RefObj> is sector known by the player Reply with quote Print

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> is sector known by the player


[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 return '1' on success and '0' on failure.
<RefObj> = A variable containing a sector.


This check, if the as <RefObj> selected sector is known by the player (i.e. if it's visible on the sector map).


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
|||if not $sector -> is sector known by the player
||||$ship = create ship: type=Advanced Satellite owner=Player addto=$sector x=0 y=20000 z=0
|||end
||end
||inc $y =
|end
|inc $x =
end
return null


This will iterate through all sectors of the universe. Line 8 checks, if a sector exists and Line 9 if the sector is unknown ( = not known). In each unknown sector a player owned Advanced Satellite will be built.


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: 19748 on topic

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

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> is sector known by the player


[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' im Erfolgs- und '0' im Fehlerfall enthalten.
<RefObj> = Eine Variable, die einen Sektor enthält.


Dies überprüft, ob der als <RefObj> ausgewählte Sektor dem Spieler bekannt (d.h. sichtbar auf der Universumskarte) ist.


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
|||if not $sector -> is sector known by the player
||||$ship = create ship: type=Erweiterter Satellit owner=Player addto=$sector x=0 y=20000 z=0
|||end
||end
||inc $y =
|end
|inc $x =
end
return null


In diesem Beispiel werden alle Sektoren im Universum durchlaufen. Zeile 8 überprüft, ob ein Sektor existiert, und Zeile 9, ob der Sektor unbekannt ( = not known) ist. In jedem unbekannten Sektor wird ein Erweiterter Satellit gebaut.


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 Sat, 25. Mar 17, 19:30

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.28200 seconds, sql queries = 16