On the subject of unsigned scripts loading without enabling the editor
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
On the subject of unsigned scripts loading without enabling the editor
Hi everyone, we had some good discussion a while back in one of the script threads about whether or not unsigned setup and init scripts are loaded upon game load if the script editor has not been enabled.
I was under the impression that no unsigned script should be loaded if the script editor has not been activated. I was, of course, wrong .
Here is what is going on:
If you have any unsigned scripts that begin with a '!' they will be loaded regardless of whether they are signed or unsigned. Scripts that begin with a ! are special cases and will always be run, signed or not.
However, loading an unsigned script simply because it begins with a '!' will kick your game into running in *modified* mode. You can check the player stats at the bottom to verify this. This is exactly the same as if you had enabled the script editor to get your game into modified mode.
Once your game is running in modified mode, upon the next game load, all unsigned scripts will be run, since running in modified mode is equivalent to having activated the script editor.
Make sense?
So under normal circumstances, unless you have a script that begins with an !, unsigned setup/init scripts should not be running in an unmodified game. This is how it worked in X2 as well.
It is suggested that community modders do NOT EVER start a script with !.
Since it can cause a cascading effect, loading unsigned scripts into a game where the script editor has not been expressly activated.
Hope that clears things up.
Cheers.
I was under the impression that no unsigned script should be loaded if the script editor has not been activated. I was, of course, wrong .
Here is what is going on:
If you have any unsigned scripts that begin with a '!' they will be loaded regardless of whether they are signed or unsigned. Scripts that begin with a ! are special cases and will always be run, signed or not.
However, loading an unsigned script simply because it begins with a '!' will kick your game into running in *modified* mode. You can check the player stats at the bottom to verify this. This is exactly the same as if you had enabled the script editor to get your game into modified mode.
Once your game is running in modified mode, upon the next game load, all unsigned scripts will be run, since running in modified mode is equivalent to having activated the script editor.
Make sense?
So under normal circumstances, unless you have a script that begins with an !, unsigned setup/init scripts should not be running in an unmodified game. This is how it worked in X2 as well.
It is suggested that community modders do NOT EVER start a script with !.
Since it can cause a cascading effect, loading unsigned scripts into a game where the script editor has not been expressly activated.
Hope that clears things up.
Cheers.
"Nature's first green is gold" . . . stay golden.
-
- Posts: 417
- Joined: Thu, 23. Dec 04, 03:02
Phew, Only ref I can find
Apologies to Overworked Moderators for ressurecting a REALLY old thread.
However...
1. It's the only reference I can find to this.
2. It's really pertinent.
3. I feel the thread really hasn't yet answered all the parameters.
I undersand why we shouldn't start an unsigned setup script/init script with "!", however, I have an Unsigned Setup script which I wish to load and wondered how to go about it!
As I see it, I have 3 options.
1. Use the "!" - and have every Tom, Dick and Harry load with it!
2. Have it packed in with Cat/Dat in a Mod... well, not really for me
3. Load the Script Editor...- hmm - I don't like people to see all that info and some of them don't like this...
Soo, what's my solution - danged if I know. Please would someone assist
Thanks
However...
1. It's the only reference I can find to this.
2. It's really pertinent.
3. I feel the thread really hasn't yet answered all the parameters.
I undersand why we shouldn't start an unsigned setup script/init script with "!", however, I have an Unsigned Setup script which I wish to load and wondered how to go about it!
As I see it, I have 3 options.
1. Use the "!" - and have every Tom, Dick and Harry load with it!
2. Have it packed in with Cat/Dat in a Mod... well, not really for me
3. Load the Script Editor...- hmm - I don't like people to see all that info and some of them don't like this...
Soo, what's my solution - danged if I know. Please would someone assist
Thanks
Re: Phew, Only ref I can find
4. None of the above.Sirus5 wrote:As I see it, I have 3 options.
1. Use the "!" - and have every Tom, Dick and Harry load with it!
2. Have it packed in with Cat/Dat in a Mod... well, not really for me
3. Load the Script Editor...- hmm - I don't like people to see all that info and some of them don't like this...
There are special script names which are used to automatically load scripts. They are any scripts starting with setup., al.plugin., and init. They each work in somewhat different ways, and are used for different purposes.
For most scripts, they will use the setup type, and you won't need to look any further. Scripts of this type will be automatically run whenever you start a game or load a saved game, and so are perfect for setting up command-based scripts, which are the most common script type. If you aren't wanting to tie your script to a command, i.e. you want it to run on a regular basis without player interaction, then AL plugins are the way to go.
:EDIT: Note that these require the script editor to be enabled. This whole thread is really actually only about having scripts run without enabling the script editor.
- ninjitsumonk
- Posts: 1874
- Joined: Thu, 1. Mar 07, 09:21
not necessarily, I've seen a number of unsigned scripts run on a game.
It seems though that setup.xxxxx scripts are one of the types that aren't loaded *properly*[1] upon a new game starting.
al.plugin.xxxx scripts seem to run fine(may just be my experience of them) upon starting a new game.
[1]it would seem that there is something that prevents setup.xxxxx scripts from functioning properly.
The setup script in question, after testing&messing about with it registered the Tfile fine, allocated array size(3) and set it as a global variable.
It didn't, however, manage to run the plugin.plugman.getware script and set the appropraite addresses for the wares.
When I checked it(got the global variable) and printed it to the logbook it came up with:
ARRAY(null, null, null)
After enabling the script editor, saving and loading, then repeating the process, it came up with:
ARRAY(Nanite light, Nanight heavy, Nanite Military)
This suggests that setup scripts are limited in how they are allowed to work(possibly lower "setup" time?) in an unmodified game.
It seems though that setup.xxxxx scripts are one of the types that aren't loaded *properly*[1] upon a new game starting.
al.plugin.xxxx scripts seem to run fine(may just be my experience of them) upon starting a new game.
[1]it would seem that there is something that prevents setup.xxxxx scripts from functioning properly.
The setup script in question, after testing&messing about with it registered the Tfile fine, allocated array size(3) and set it as a global variable.
It didn't, however, manage to run the plugin.plugman.getware script and set the appropraite addresses for the wares.
When I checked it(got the global variable) and printed it to the logbook it came up with:
ARRAY(null, null, null)
After enabling the script editor, saving and loading, then repeating the process, it came up with:
ARRAY(Nanite light, Nanight heavy, Nanite Military)
This suggests that setup scripts are limited in how they are allowed to work(possibly lower "setup" time?) in an unmodified game.
Archeo Avis wrote:So what you're saying is, if you ignore everything that's different and focus only on the one thing that's the same, they're same.if you take out phrasing and root notes and just look at the notes, they are the same
Good God.
setup scripts wont run when you start a new game because new games aren't modified, so no unsigned scripts will run.ninjitsumonk wrote:not necessarily, I've seen a number of unsigned scripts run on a game.
It seems though that setup.xxxxx scripts are one of the types that aren't loaded *properly*[1] upon a new game starting.
al.plugin.xxxx scripts seem to run fine(may just be my experience of them) upon starting a new game.
if u prefix the script name with ! then it forces the game into modified mode, which means any game you start or load will automatically be modified without enabling the script editor.
init scripts should be avoided if possible.
setup scripts are run once the game has been loaded, ie, after the creation of the universe.
init scripts run before, which means if you try to do anythign in the universe in an init script it will have problems as the universe is not yet created.
al.plugin scripts are simlar to setup scripts, but they are run first and usually used to register the al plugins
It seems from what ninjitsu said, though, that this is not quite accurate - that certain commands put into a setup script will still run. And certainly, AL plugins also will run without enabling the script editor first (forcing the game into a *modified* state...) which is a case that Burianek didn't mention above, and one which deserves some pause for consideration...Cycrow wrote:setup scripts wont run when you start a new game because new games aren't modified, so no unsigned scripts will run.
the only ones that force modified mode is if they start with !.
any others shouldn't be run at all.
however, if your using a mod, ie have anything selected in the mod package, or have any kind of fake patch, then the game will also go into modified mode allowing some scripts to run.
if you dont have any of those and scripts are still forcing modified mode, then theres likly a problem somewhere
any others shouldn't be run at all.
however, if your using a mod, ie have anything selected in the mod package, or have any kind of fake patch, then the game will also go into modified mode allowing some scripts to run.
if you dont have any of those and scripts are still forcing modified mode, then theres likly a problem somewhere
Ah crap. Humble pie time.
For some reason, my vanilla install (which I keep vanilla precisely to test non-modded conditions,) had one minor fake patch. I must have been absent when I put that in.
Removed said fake patch, and amazingly enough, you're right. unsigned AL plugins are blocked. Apologies if I confused anyone.
For some reason, my vanilla install (which I keep vanilla precisely to test non-modded conditions,) had one minor fake patch. I must have been absent when I put that in.
Removed said fake patch, and amazingly enough, you're right. unsigned AL plugins are blocked. Apologies if I confused anyone.