<RetVar/IF> get text id: ware =<Var/Ware>

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

<RetVar/IF> get text id: ware =<Var/Ware>

Post by mark_a_condren » Sun, 26. Sep 10, 17:23

[skip|else] if [not]|while [not]| <RetVar/IF> = get text id: ware = <Var/Ware>


[skip|else] if [not]|while [not]| = Possible 'conditional' statements that can be used with this command.
<RetVar/IF> = Variable where the requested information is put
<Var/Ware> = The ware the text id is being retrieved for.


Each ware has a corresponding entry in page 17 of the games text files. This command returns the unique id number for this text entry.


Example:

$target = get player tracking aim
If $target is of class Ship
| $tradeable.ware.array = $target get tradeable ware array from ship
| $tradeable.ware.array.count size of array $tradeable.ware.array
| $counter = 0
| while $counter < $tradeable.ware.array.count
|| $ware = $tradeable.ware.array [ $counter ]
|| $t.id get text id: ware = $ware
|| $text = read text: page= 17 id = $t.id
|| write to logfile # 9999 append =[TRUE] value = $text
|| inc $counter =
| end
end

The above example would get the tradeable ware array from the player target if it is a ship. It would then cycle through that array getting the 'text id' for each ware. Then it would retrieve the information for that ware and write it to the specified log file.


Command Location:

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

[TiP][49] 287636

Post by X2-Illuminatus » Mon, 18. Oct 10, 10:39

[skip|else] if [not]|while [not]| <RetVar/IF> = get text id: ware = <Var/Ware>


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Variable, in der die geforderte Information gespeichert wird.
<Var/Ware> = Die Ware, deren Text id angefordert wird.


Jede Ware hat einen zugehörigen Eintrag auf Seite 17 der Spieltextdatei. Dieser Befehl gibt die einzigartige id Nummer für diesen Eintrag wieder.


Beispiel:

$target = get player tracking aim
If $target is of class Ship
| $tradeable.ware.array = $target get tradeable ware array from ship
| $tradeable.ware.array.count size of array $tradeable.ware.array
| $counter = 0
| while $counter < $tradeable.ware.array.count
|| $ware = $tradeable.ware.array [ $counter ]
|| $t.id get text id: ware = $ware
|| $text = read text: page= 17 id = $t.id
|| write to logfile # 9999 append =[TRUE] value = $text
|| inc $counter =
| end
end

Mit obigem Beispiel-Script würde man zunächst ein Array mit den handelbaren Waren des Ziels des Spielers (wenn es sich um ein Schiff handelt) erhalten.
Es würde dann das Array durchlaufen und für jede Ware die zugehörige "Text id" bekommen. Anschließend würde es die erhaltene Infomation jeder Ware in die gewählte Logdatei schreiben.


Zu finden unter:

Locked

Return to “MSCI Reference”