<RetVar> = get station array: of race <Var/Race> class/type=<Value>

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> = get station array: of race <Var/Race> class/type=<Value>

Post by X2-Illuminatus » Thu, 28. Jul 11, 20:01

<RetVar> = get station array: of race <Var/Race> class/type=<Value>


<RetVar> = A variable where the requested information is stored in an array.
<Var/Race> = A race or a variable containing it.
<Value> = A station class / type or 'null'.


This will return all existing stations by the as <Var/Race> selected race of the as <Value> selected class / type. Entering 'null' as class / type value will return all stations of the selected race.


Example:

$i=0
$sector.arr= array alloc: size=0
$player.sector=[PLAYERSHIP] -> get sector
$station.arr= get station array: of race Argon class/type=Shipyard
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|skip if $i > 0
||$shipyard=$station
|$sector=$station -> get sector
|$jumps= get jumps from sector $player.sector to sector $sector
|skip if $i > 0
||$range=$jumps
|if $jumps < $range
||$range=$jumps
||$shipyard=$station
|end
|inc $i=
end
write to player logbook $shipyard
return null

This gets all Argon shipyards in an array and finds out the jump distance between the shipyard's and the player sector. Afterwards it writes the nearest shipyard to the player logbook.


Related Commands:

<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>
<RetVar> = get station array: resource=<Var/Ware> include empty=<Var/Boolean>


Command Location:

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

[TiP][49] 304926

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

<RetVar> = get station array: of race <Var/Race> class/type=<Value>


<RetVar> = Eine Variable, in der die geforderte Information gespeichert wird.
<Var/Race> = Ein Volk oder eine Variable, die eins enthält.
<Value> = Eine Stationsklasse, ein Stationstyp oder 'null'.


Dieser Befehl gibt alle existierenden Stationen des als <Var/Race> gewählten Volkes von der als <Value> gewählten Klasse oder Typs zurück. 'null' als Eingabe des "class / type"-Wertes wird alle Stationen eines Volkes zurückgeben.


Beispiel:

$i=0
$sector.arr= array alloc: size=0
$player.sector=[PLAYERSHIP] -> get sector
$station.arr= get station array: of race Argonen class/type=Schiffswerft
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|skip if $i > 0
||$shipyard=$station
|$sector=$station -> get sector
|$jumps= get jumps from sector $player.sector to sector $sector
|skip if $i > 0
||$range=$jumps
|if $jumps < $range
||$range=$jumps
||$shipyard=$station
|end
|inc $i=
end
write to player logbook $shipyard
return null

Dies findet alle argonischen Schiffswerften, ermittelt die Sprungentfernungen zum aktuellen Spielersektor und schreibt die nächste Schiffswerft ins Spielerlogbuch.


Verwandte Befehle:

<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>
<RetVar> = get station array: resource=<Var/Ware> include empty=<Var/Boolean>


Zu finden unter:

Return to “MSCI Reference”