<RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

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

<RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors

Post by mark_a_condren » Mon, 29. Nov 10, 16:03

[skip|else] if [not]|while [not]|<RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = RetVar is if you want to save the return to a variable. IF will check to see if the ware is illegal in the specified races sectors and return True / False.
<Var/Ware> = The ware that you want to check to see if it is illegal or not.
<Var/Race> = The Race who's sectors you wish to check for legality.


This command will check to see if a particular ware is illegal in the specified races sectors.


Example:

You may wish to create a script something like this and asign it to a hotkey to be able to run a quick check on your target / personal ships cargo.

(assuming you already have the array $all.ships.cargo created somewhere else)



$target = get player tracking aim

if not $target is of class Ship
| $target = [PLAYERSHIP]
end

$sector = $target get sector

$sector.owner = $sector get owner race

(get the array $all.ships.cargo created somewhere else)

$size size of array $all.ships.cargo

$counter = 0
while $counter < $size
| $ware = $all.ships.cargo [$counter]
| |
| if is ware $ware illegal in $sector.owner sectors
| | $message = sprintf: fmt='%s is illegal in %s sectors.', $ware, $sector.owner, <Value>, <Value>, <Value>
| | display subtitle text: text=$message duration=3000 ms
| | @ wait 3000 ms
| end
| |
| @ wait 100 ms
| inc $counter
end

This will check all the wares in $all.ships.cargo and if any are illegal in your current sector you will get the subtitle message telling you.


Command Location:

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

[TiP][49] 292304

Post by X2-Illuminatus » Thu, 2. Dec 10, 16:24

[skip|else] if [not]|while [not]|<RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Nutze RetVar, wenn du den Rückgabewert in einer Variable speichern möchtest. IF wird überprüfen, ob die Ware in den Sektoren des gewählten Volkes illegal ist und True / False (wahr / falsch) zurückgeben.
<Var/Ware> = Die Ware, die du auf ihre Illegalität überprüfen möchtest.
<Var/Race> = Das Volk, dessen Sektoren du zwecks Illegalität der Ware überprüfen möchtest.


Dieser Befehl wird überprüfen, ob eine bestimmte Ware in den Sektoren der gewählten Rasse illegal ist.


Beispiel:

Du möchtest vielleicht ein Script wie dieses hier schreiben und es an einen Hotkey binden, um in der Lage zu sein, möglichst schnell den Laderaum deines Zielschiffes oder deines persönlichen Schiffes überprüfen zu können.

(vorausgesetzt du hast das Array $all.ships.cargo bereits irgendwo anders erstellt)



$target = get player tracking aim

if not $target is of class Ship
| $target = [PLAYERSHIP]
end

$sector = $target get sector

$sector.owner = $sector get owner race

(erhalte das zuvor irgendwo anders erstellte Array $all.ships.cargo)

$size size of array $all.ships.cargo

$counter = 0
while $counter < $size
| $ware = $all.ships.cargo [$counter]
| |
| if is ware $ware illegal in $sector.owner sectors
| | $Nachricht = sprintf: fmt='%s ist illegal in %s Sejtoren.', $ware, $sector.owner, <Value>, <Value>, <Value>
| | display subtitle text: text=$Nachricht duration=3000 ms
| | @ wait 3000 ms
| end
| |
| @ wait 100 ms
| inc $counter
end

Dies wird alle Waren in $all.ships.cargo überprüfen und wenn irgendeine illegal in deinem aktuellen Sektor ist, die entsprechende Nachricht als Untertitel anzeigen.


Zu finden unter:

Return to “MSCI Reference”