<RetVar/IF/START> speak array: <Value> prio =<Var/Number>

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/START> speak array: <Value> prio =<Var/Number>

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

START | skip|else] if [not]|while [not]| <RetVar/IF/START> = speak array: <Value> prio = <Var/Number>


START | skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF/START> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, otherwise if you use a 'Variable', this variable will be TRUE / FALSE as an integer.
<Value> = The array containing the text you wish to be spoken.
<Var/Number> = The priority you wish to asign to this task.


This command is used to add all the items you want to speak into the array and it will speak them one after the other the same way it works internally in the game engine.

The array must have a specific structure however. This requires the array to first be created and then the required elements added to that array.

Basically the structure need to be 'page id' then 'text id' for what you want spoken.

Eg,

$speak.array = create new array, arguments = page.id, text.id, page.id, text.id, null
A detailed explanation of the required structure can be found here.


Example:

It should be noted that from testing done, particular care should be taken to ensure the 'name array' exsists before trying to use it. Failing to do this has resulted in unexpected script behaviour.

$this.object = get player tracking aim

If = $this.object get object name array
$object.name.array = $this.object get object name array
START = speak array: $object.name.array prio =100

end

The name array will first be retrieved for the player target and if it is a valid name array it will be inserted into the 'speak array' command and spoken by 'Betty'. Using START as the command prefix allows the script to continue on while the text is being spoken.


Command Location:

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

[TiP][49] 287642

Post by X2-Illuminatus » Tue, 10. May 11, 18:52

START | skip|else] if [not]|while [not]| <RetVar/IF/START> = speak array: <Value> prio = <Var/Number>


START | skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF/START> = 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.
<Value> = Das Array, das den Text enthält, den du gesprochen haben möchtest.
<Var/Number> = Die Priorität, die du dieser Aufgabe zuweisen möchtest.


Dieser Befehl wird genutzt, um alle Begriffe, die man man gesprochen haben möchte, in einem Array zusammenzufasssen. Die Begriffe werden dann nacheinander ausgesprochen, auf die gleiche Weise wie auch im Spiel.
Jedoch muss das Array eine gewisse Struktur haben. Es muss erst erstellt werden und anschließend mit Elementen gefüllt werden.
Die grundlegende Struktur ist 'page id' und dann 'text id' vom dem, was du gesprochen haben möchtest. Zum Beispiel

$speak.array = create new array, arguments = page.id, text.id, page.id, text.id, null
Eine genauere Erklärung der Struktur kann diesem Thema entnommen werden.


Beispiel:

Besonders achten sollte man darauf, dass das "Array der Namen" existiert, bevor man es nutzt. Sollte dies nicht der Fall sein, führt dies zu unerwartetem Scriptverhalten.

$this.object = get player tracking aim

If = $this.object get object name array
$object.name.array = $this.object get object name array
START = speak array: $object.name.array prio =100

end

Dies erhält das "Array der Namen" für das aktuelle Spielerziel und fügt es, falls es gültig ist, in den "speak array"-Befehl ein. Anschließend wird es von "Betty" ausgesprochen. Nutzt man START als Befehlsvorsilbe, erlaubt man das Fortfahren des Scriptes während der Text gesprochen wird.


Zu finden unter:

Locked

Return to “MSCI Reference”