<RetVar> = <RefObj> -> get distance to: array=<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: 48
Joined: Tue, 2. May 06, 18:58
x3tc

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

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

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

This command gets the distance between a specific object and a position array. The position array must be pre-generated.

<RetVar> = The returned distance in integer form stored in a 'variable'.
<RefObj> = The specific object that you want the distance from.
<Var/Array> = The 'variable' storing the position array.

Example :

* the player has a station in the sector
* get the first position
$Object1 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Input Station Please'

* get the stations position as an array
$Position1 = $Object1->get position as array

* use the [PLAYERSHIP] as the second position
$Distance = [PLAYERSHIP]->get distance to: position array=$Position1

* output to logbook
write to player logbook $Distance

return null

The logbook output is in this format : 29537

Related Commands :
<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>
<RefObj> ->get position as array

Command Location :

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

[TiP][49] 294931

Post by X2-Illuminatus » Thu, 27. Jan 11, 18:42

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

Dieser Befehl gibt die Entfernung zwischen einem gewählten Objekt und einem Postions-Array zurück. Das Positions-Array muss vorher erstellt werden.

<RetVar> = Die Variable, in der die zurückgegebene Entfernung als ganze Zahl gespeichert wird.
<RefObj> = Das Objekt, dessen Entfernung zum Positionsarray du ermitteln möchtest.
<Var/Array> = Die Variable, die das Postions-Array enthät.

Beispiel:

* Der Spieler besitzt eine Station im Sektor
* erhalte die erste Position
$Object1 = [THIS] get user input without sector: type={Var/Ship/Station owned by Player}, title='Input Station Please'

* erhalte die Stationsposition als Array
$Position1 = $Object1->get position as array

* Nutze das [PLAYERSHIP] (Spielerschiff) als zweite Position
$Distance = [PLAYERSHIP]->get distance to: position array=$Position1

* Ausgabe ins Logbuch
write to player logbook $Distance

return null

Die Logbuchausgabe ist im Format: 29537


Ähnliche Befehle:
<RetVar> = get distance: position array1=<Var/Array> array2=<Var/Array>
<RefObj> ->get position as array


Zu finden unter:

Locked

Return to “MSCI Reference”