Hi ALl,
THis distinction is probably covered somewhere in the forums, but I can't find an answer after some searching. What exactly is different between an init.* script and a setup.* script? When should you use one or the other? I see some instructions say explicitly to not use an init script, but they don't really explain why.
Any info would be greatly appreciated.
Init vs Setup scripts
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Re: Init vs Setup scripts
!init.* scripts are used by vanilla scripts to initiate things.
setup.* are automatically run by the game when started.
You want setup.* scripts.
setup.* are automatically run by the game when started.
You want setup.* scripts.
-
- Posts: 94
- Joined: Wed, 16. Jan 19, 20:23
Re: Init vs Setup scripts
Thanks.
I was just wondering because in this thread, it's suggested I use an init script. Should I just rename it to "setup" and carry on?
I was just wondering because in this thread, it's suggested I use an init script. Should I just rename it to "setup" and carry on?
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24965
- Joined: Sun, 2. Apr 06, 16:38
Re: Init vs Setup scripts
No, using an init script in your case is fine. The main difference between init and setup scripts is when they are loaded. init scripts are loaded first, even before other assets in the universe are set up properly. Thus, init scripts can be used to register command slots or hotkeys and the like. If, however, you want to set up anything regarding assets, for example add a specific ware to stations for sale, you would rather use a setup script. Additionally, init scripts are loaded automatically on gamestart or game load. It does not matter whether they are signed (through Egosoft) or not. In contrast, unsigned setup scripts are only loaded in a modified game.
Most of this basic knowledge about scripting is explained in the MSCI Handbook, which you can find in our downloads section here.
Most of this basic knowledge about scripting is explained in the MSCI Handbook, which you can find in our downloads section here.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Re: Init vs Setup scripts
I lack basic knowledge then