<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
corbinbird
Posts: 49
Joined: Tue, 2. May 06, 18:58
x3tc

<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>

Post by corbinbird » Tue, 11. Jan 11, 02:07

<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>

This command gets the distance between two position arrays.

<RetVar> = The 'variable' storing the returned integer.
<Var/Array> = The 'variable' storing the position array. Since two are used they must both use different variable names.

Example :

* the player has two stations in the same sector
* get the first 'Object' position array
$Object1 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Station 1'
$Position1 = $Object1->get position as array

* get the second 'Object' position array
$Object2 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Station 2'
$Position2 = $Object2->get position as array

* get the distance between the two
$Distance = get distance: position array1=$Position1 array2=$Position2

* output Distance to player logbook
write to player logbook $Distance

return null

The logbook output is in this format : 34745

Related Commands :

<RefObj> ->get distance to: array=<Var/Array>
<RefObj> ->get position as array

Command Location :

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

[TiP][49] 294933

Post by X2-Illuminatus » Thu, 27. Jan 11, 17:50

<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>

Dieser Befehl gibt die Entfernung zwischen zwei Positions-Arrays zurück.

<RetVar> = Die Variable, in der die Entfernung als ganze Zahl gespeichert wird.
<Var/Array> = Die Variable, in der das Positions-Array gespeichert ist. Da zwei Variablen genutzt werden, müssen beide unterschiedliche Variablennamen verwenden.

Beispiel:

* Der Spieler besitzt zwei Stationen im selbem Sektor
* erhalte das Positions-Array des ersten Objekts
$Object1 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Station 1'
$Position1 = $Object1->get position as array

* erhalte das Positions-Array des zweiten Objekts
$Object2 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Station 2'
$Position2 = $Object2->get position as array

* erhalte die Entfernung zwischen beiden
$Distance = get distance: position array1=$Position1 array2=$Position2

* Ausgabe der Entfernung ins Spielerlogbuch
write to player logbook $Distance

return null

Die Logbuchausgabe ist im Format : 34745


Ähnliche Befehle:

<RefObj> ->get distance to: array=<Var/Array>
<RefObj> ->get position as array


Zu finden unter:
Last edited by X2-Illuminatus on Thu, 27. Jan 11, 23:15, edited 1 time in total.

Locked

Return to “MSCI Reference”