add encyclopedia custom article: History, id=<Var/String>, title page=...

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

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

add encyclopedia custom article: History, id=<Var/String>, title page=...

Post by X2-Illuminatus » Wed, 27. Jul 11, 19:50

add encyclopedia custom article: History, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>


<Var/String> = A string containing alphanumerical values (letters and/or numbers) or a variable containing the string.
<Var/Number> = The page id of the article's title.
<Var/Number> = The text id of the article's title.
<Var/Number> = The page id of the article's text title.
<Var/Number> = The text id of the article's text.
<Var/Number> = A positive numerical value in seconds or 'null'.


This command adds text with a title, listed under the specified page and text ids in a text file, to the encylopedia "History"-section of the custom category "Additional articles".

The custom category "Additional articles" as well as its sections "News", "Information", "History" and "Stories" can be used by scripters and modders to add own articles to the encylopedia. These sections aren't used in the Vanilla game. To change the names of these sections simply rename their entries in the main text file under page id 350037.
The article's id is important in order to be able to remove an article after it was added. You cannot find out an article's id with any command, so you should save it somewhere. For example directly in your t-file your in a global variable. Note that you cannot use the same id with more than one article at the same time. If you add an article with an already used id, this article will replace the article that currently uses that id. Also be aware of the fact that the order of the articles in a section is not determined by their ids. The article will be sorted alphanumerical (numbers take precedence over letters) by their titles.
Under timeout you can specifiy a timeframe in seconds, after which the article will be removed automatically from the encyclopedia. If you enter '0' or 'null' the article will stay there forever or until it's manually removed with the remove article-command.


Example:

add encyclopedia custom article: History, id='test', title page=7, title id=1020101, text page=19, text id=1030101, timeout=null
return null

This will add the sector description of Kingdom End (with "Kingdom End" as title) to the "History"-section of the "Additional articles"-category of the encyclopedia.


Note: There is a limit of characters (including spaces) you can use in one article. If your article has more than 6017 characters the game will crash, when you try to open it.
Also, if you're using an own textfile, you have to load it with the load text: id-command before, the SE can read text from it. Otherwise, the SE will take the text from the main textfile(s) or, if these page / text ids don't exist, simply display Readtext errors.


Related Commands:

add encyclopedia custom article: News, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
add encyclopedia custom article: Information, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
add encyclopedia custom article: Stories, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
remove encyclopedia custom article: id=<Var/String>


Command Location:
  • »» Other
    add encyclopedia custom article: History, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>

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

[TiP][49] 304851

Post by X2-Illuminatus » Sat, 1. Oct 11, 12:49

add encyclopedia custom article: History, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>


<Var/String> = Eine Zeichenkette mit alphanumerischen Werten (Buchstaben und Zahlen) oder eine Variable, die diese enthält.
<Var/Number> = Die page id vom Titel des Artikels.
<Var/Number> = Die text id vom Titel des Artikels.
<Var/Number> = Die page id vom Titel des Artikeltextes.
<Var/Number> = Die text id vom Text des Artikels.
<Var/Number> = Ein positiver numerischer Wert in Sekunden oder 'null'.


Dieser Befehl fügt Text samt Titel zu finden unter den angegebenen page und text ids in einer Textdatei zur "Verlauf"-Sektion der "Zusätzlichen Artikel" in der Enzyklopädie hinzu.

Die benutzerdefinierte Kategorie "Zusätzliche Artikel" sowie ihre Untersektionen "Neuigkeiten", "Informationen", "Verlauf" und "Stories" können von Scriptern und Moddern genutzt werden, um eigene Artikel der Enzyklopädie hinzuzufügen. Dieser Teil der Enzyklopädie wird nicht im Vanilla Spiel genutzt. Um die Namen der Sektionen zu ändern, muss man nur ihre entsprechenden Einträge in der Haupttextdatei unter page id 350037 ändern.
Die id des Artikels ist wichtig, um ihn später wieder entfernen zu können. Die id lässt sich nicht per Befehl herausfinden. Insofern empfiehlt es sich, sie direkt irgendwo abzuspeichern. Zum Beispiel in der Textdatei oder in einer globalen Variable. Beachte, dass die gleiche id nicht gleichzeitig mit mehreren Artikeln genutzt werden kann. Wird ein Artikel mit einer id hinzugefügt, die bereits für einen anderen Artikel genutzt wird, so wird der neue den alten Artikel überschrieben. Beachte zudem, dass die Artikel nicht nach ihren ids sondern nach ihren Titeln geordnet werden. Die Ordnung erfolgt alphanumerisch (Zahlen haben eine höhere Priorität als Buchstaben).
Unter timeout kann eine Zeitdauer in Sekunden angegeben werden, nach der der Artikel automatisch wieder aus der Enzyklopädie entfernt wird. Die Eingaben '0' oder 'null' führen dazu, dass der Artikel solange in der Enzyklopädie bleibt, bis er mithilfe des remove article-Befehls entfernt wird.


Beispiel:

add encyclopedia custom article: History, id='test', title page=7, title id=1020101, text page=19, text id=1030101, timeout=null
return null

Dies wird die Sektorbeschreibung des Sektors "Königstal" (mit "Königstal" als Titel) zur "Verlauf"-Sektion in der "Zusätzlichen Artikel"-Kategorie der Enzyklopädie hinzufügen.


Anmerkung: Es ist nur möglich eine bestimmte Anzahl an Zeichen (einschließlich Leerzeichen) zu nutzen. Wenn ein Artikel mehr als 6017 Zeichen enthält, wird das Spiel abstürzen, wenn man versucht, diesen Artikel zu öffnen.
Außerdem muss eine eigene Textdatei zunächst mit dem load text: id-Befehl geladen werden, ehe der Script Editor Text aus diesem lesen kann. Andernfalls wird er Text aus der Haupttextdatei lesen oder, falls die angegebenen page / text ids nicht existieren, Readtext-Fehler anzeigen.


Verwandte Befehle:

add encyclopedia custom article: News, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
add encyclopedia custom article: Information, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
add encyclopedia custom article: Stories, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>
remove encyclopedia custom article: id=<Var/String>


Zu finden unter:
  • »» Other
    add encyclopedia custom article: History, id=<Var/String>, title page=<Var/Number>, title id=<Var/Number>, text page=<Var/Number>, text id=<Var/Number>, timeout=<Var/Number>

Locked

Return to “MSCI Reference”