<RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> inc

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/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> inc

Post by X2-Illuminatus » Thu, 28. Jul 11, 12:45

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> include shipyards=<Var/Number> include docks=<Var/Number>


[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 contain an array filled with the wares that can be bought in the selected sector.
<RefObj> = A variable containing a sector.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.


Returns all buyable wares in an array in the as <RefObj> selected sector. It can be specified, which wares the array should contain. By setting the additional values to TRUE, the wares array will contain products from player factories ( include playerfacts ), ships and stations ( include shipyards ) as well as wares from docks including softwares ( include docks ).

This command however just checks, which products are listed in the sector's stations. It will neither check, if the player can buy them (credits / rank / transport class requirements) nor if there are any wares currently in stock.


Example:

$ware=Energy Cells
$sector=[PLAYERSHIP] -> get sector
$buyable.wares.arr=$sector -> get buyable wares in sector: include playerfacs=[TRUE] include shipyards=[FALSE] include docks=[TRUE]
if find $ware in array: $buyable.wares.arr
|write to player logbook: printf: fmt='%s can be bought in sector %s.', $ware, $sector, null, null, null
end
return null

This will check, if Energy Cells are buyable in the current player sector and write an appropriate message to the logbook, if it's the case.


Command Location:
  • »» Universe and Sector Commands
    <RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> include shipyards=<Var/Number> include docks=<Var/Number>

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

[TiP][49] 304901

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

[skip|else] if [not]|while [not]| <RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> include shipyards=<Var/Number> include docks=<Var/Number>


[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 ein Array enthalten, das mit den Waren, die in diesem Sektor gekauft werden können, gefüllt ist.
<RefObj> = Eine Variable, die einen Sektor enthält.
<Var/Number> = Ein TRUE (wahr) oder FALSE (falsch) Wert oder seine entsprechende Ziffer 1 oder 0.
<Var/Number> = Ein TRUE (wahr) oder FALSE (falsch) Wert oder seine entsprechende Ziffer 1 oder 0.
<Var/Number> = Ein TRUE (wahr) oder FALSE (falsch) Wert oder seine entsprechende Ziffer 1 oder 0.


Dieser Befehl gibt alle Waren in einem Array zurück, die im als <RefObj> ausgewählten Sektor gekauft werden können. Es kann auch genauer angegeben werden, welche Waren im Array enthalten sein sollen. Indem man die zusätzlichen Eingaben auf TRUE setzt, wird das Warenarray Produkte von Spielerfabriken ( include playerfacts ), Schiffe und Stationen ( include shipyards ) sowie Waren (einschließlich Software) von Docks ( include docks ) enthalten.

Jedoch prüft dieser Befehl nur, welche Waren in den Stationen des Sektors gelistet sind. Er wird weder überprüfen, ob der Spieler sie kaufen kann (abhängig von Credits / Rang / Transportklasse), noch ob zurzeit überhaupt Waren auf Lager sind.


Beispiel:

$ware=Energiezellen
$sector=[PLAYERSHIP] -> get sector
$kaufbare.waren.arr=$sector -> get buyable wares in sector: include playerfacs=[TRUE] include shipyards=[FALSE] include docks=[TRUE]
if find $ware in array: $kaufbare.waren.arr
|write to player logbook: printf: fmt='%s können im Sektor %s gekauft werden.', $ware, $sector, null, null, null
end
return null

Dies überprüft, ob im aktuellen Spielersektor Energiezellen gekauft werden können, und schreibt eine entsprechende Nachricht ins Spielerlogbuch, wenn dies der Fall ist.


Zu finden unter:
  • »» Universe and Sector Commands
    <RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> include shipyards=<Var/Number> include docks=<Var/Number>

Return to “MSCI Reference”