Character Limit: There is a limit of the maximum number of characters per script. It is somewhere around 30000 characters (the true limit is most likely 32767, which is the max value for a 16-bit signed integer, which is how script length is stored in the .esp).
Line Limit: there also is reportedly a maximum line limit. This seems to vary and reports on the forum range between 900-and 1500 lines of code. It's probably rather a limit of the compiled script than the actual lines of text, so empty lines and comments don't count. This is reported by an error message upon saving the script.
If-elseif limit: There is a limit on the maximum number of if-elseif conditions that can be used per script. I am not sure of the absolute number (I heard both 127 and 256). Also there is a maximum depth of nested if commands, it's reportedly 10 (Note: Error message for exceeding the maximum depth of nested if's is "Max nesting of 10 exceeded on line XXX" - in this case, you'll need to break it up somehow.)
Instruction Limit: An If-block or While-block is limited to 255 compiled commands (per block, not per script). The limit is not on the number of lines (each line may end up as several commands when compiled), and blank lines and comments don't count towards this total.
Script Name Limit: TunaandCheese reported a limit to the length of the scriptname:
Your script's name should never go over 31 characters in length.
Line Limit: there also is reportedly a maximum line limit. This seems to vary and reports on the forum range between 900-and 1500 lines of code. It's probably rather a limit of the compiled script than the actual lines of text, so empty lines and comments don't count. This is reported by an error message upon saving the script.
If-elseif limit: There is a limit on the maximum number of if-elseif conditions that can be used per script. I am not sure of the absolute number (I heard both 127 and 256). Also there is a maximum depth of nested if commands, it's reportedly 10 (Note: Error message for exceeding the maximum depth of nested if's is "Max nesting of 10 exceeded on line XXX" - in this case, you'll need to break it up somehow.)
Instruction Limit: An If-block or While-block is limited to 255 compiled commands (per block, not per script). The limit is not on the number of lines (each line may end up as several commands when compiled), and blank lines and comments don't count towards this total.
Script Name Limit: TunaandCheese reported a limit to the length of the scriptname:
Your script's name should never go over 31 characters in length.
I'm currently making a mod that has, admittedly, a fairly large global script - in fact I have just now split it into 2 smaller scripts, but still I'm having this problem: I get an "EXPRESSION" error when I try to start a new game, with only my mod loaded. As far as I can tell there is nothing wrong with the script, and if I take any section out, it works, so I can only conclude that the problem I'm having is because of some sort of built-in limitation that I'm reaching.
However, I have less than 7000 characters and 300 lines - way less than the limits mentioned in MWSFD (and I'm not getting any errors when saving the script so it can't be a line limit - nor can it be a maximum depth nested if-statement, or a script name limit (the script name is 22 characters)). I have 50 if-else-statements, tops, and none of the if-blocks are particularly big.
I'm reluctant to post the script because I want aspects of the mod to be a surprise (lame, I know), but I was just wondering if anyone had any new information relating to limits of the script editor?
Thanks,
- Danjb