<RetVar/IF> is script with prio <Var/Number> on stack

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> is script with prio <Var/Number> on stack

Post by mark_a_condren » Wed, 8. Sep 10, 12:40

[skip|else] if [not]|while [not]| <RetVar/IF> = is script with prio <Var/Number> on stack


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, will be TRUE (1) if condition passes or FALSE (0) if it fails.
<Var/Number> = Script priority to be checked

Determines if a script of a given priority is on the call stack.

The call stack is the list of scripts running in a Prio Used by given process.
Every time one script calls another, that script is added to the stack.
Scripts are also added to the stack during an interrupt or signal.

This instruction always runs on the current task – it cannot be used to determine if a script of a given priority is running under a different task ID.
Different script priorities are used for different functions.
Most notably, the different signals operate at different priorities.
This instruction is often used to determine if a particular signal has been received by a ship.
By checking to see if a script of priority 99 is on the stack, for example, a script can tell if the ship it is running on has been attacked and was in the process of fighting back against its attacker.

Table - Script Priorities:
  • 0 .............. All scripts by default
    50 ............ Flee response to SIGNAL_ATTACKED
    99 ............ Attack response to SIGNAL_ATTACKED
    100 .......... SIGNAL_ATTACKED
    150 .......... SIGNAL_LEADERNEEDSHELP
    ??? ........... SIGNAL_FOLLOWERNEEDSHELP
    200 .......... SIGNAL_FORMATIONLEADERCHANGED
    300 .......... SIGNAL_CAPTURED
    10000 ...... SIGNAL_KILLED

Command Location:

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

[TiP][49] 286454

Post by X2-Illuminatus » Tue, 10. May 11, 19:14

[skip|else] if [not]|while [not]| <RetVar/IF> = is script with prio <Var/Number> on stack


[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 1 im Erfolgs- und 0 im Fehlerfall enthalten.
<Var/Number> = Die Scriptpriorität, auf die gesprüft werden soll.

Findet heraus, ob ein Script mit gegebener Priorität sich auf dem "call stack" befindet.

Der call stack ist die Liste von Scripten, die mit einer gegebenen Priorität von einem Prozess genutzt werden.
Jedes Mal wenn ein Script ein anderes aufruft, wird dieses zum call stack hinzugefügt. Scripte werden auch während einer Unterbrechung (interrupt) oder eines Signals dem stack hinzugefügt.

Dieser Befehl läuft immer auf dem aktuellen Task – er kann nicht genutzt werden, um herauszufinden, ob ein Script mit einer gegebenen Priorität unter einer anderen task ID läuft. Verschiedene Scriptprioritäten werden für verschiedene Funktionen verwendet. Insbesondere arbeiten die unterschiedlichen Signale mit unterschiedlichen Prioritäten. Dieser Befehl wird oft verwendet, um herauszufinden, ob ein bestimmtes Signal von einem Schiff empfangen wurde.
Indem man überprüft, ob ein Script (z.B.) mit Priorität 99 auf dem stack ist, kann ein Script herausfinden, ob das Schiff, auf dem es läuft, angegriffen wurde und dabei war zurückzuschlagen.

Tabbelle der Scriptprioritäten:
  • 0 .............. Standardmäßig alle Scripts
    50 ............ Fluchtantwort auf SIGNAL_ATTACKED
    99 ............ Angriffsantwort auf SIGNAL_ATTACKED
    100 .......... SIGNAL_ATTACKED
    150 .......... SIGNAL_LEADERNEEDSHELP
    ??? ........... SIGNAL_FOLLOWERNEEDSHELP
    200 .......... SIGNAL_FORMATIONLEADERCHANGED
    300 .......... SIGNAL_CAPTURED
    10000 ...... SIGNAL_KILLED

Zu finden unter:

Locked

Return to “MSCI Reference”