Execution speed won’t be affected, but if you’re doing everything in your script serially (eg, run line 1, then 2, then 3…), it may take a while before you reach the end of the script.
For scale, some of the big games (that I will not name) have, or used to have, somewhere about 200,000 lines of code in a single script.
It won’t, it just affects your experience with WRITING the script.
Syntax highlighting (local and function is no longer displayed in red, etc.).
Linting (the red or orange underlines you see when you make a mistake in your code).
No linting also means goodbye to typechecking if strict typing is what you’re into.
If it weren’t for intellisense, this makes it no better than writing your code on Notepad.
Scripts do have a limit of 200 local variables and functions (upvalues). Keep that in mind.
Likewise for functions - 200 local variables per function, not shared with the script’s upvalues limit, or preceding functions’ limits (if you’re nesting functions within functions).
Also, ultimately you should make your script READABLE. Read up on techniques on how to shorten your scripts for brevity.
Thats just great. I was going to keep all of my functions in one script but now I guess I have to break them up anyway? I’m hesistant because I swear I read somewhere that requiring multiple module scripts slows down a script, is that true?
That is false - at least not in the way you think. I’d almost find this fact misleading.
Requiring modules really don’t take as long as you think it does. If it did, most games would have a problem with load times. There are games that have massive libraries containing an obscene amount of modules, imagine that.
Typically you’d require modules only at the beginning of a script’s lifetime - which is also the time which a player first joins, and your game first loads in. As long as you’re not repeatedly requiring a module, you’re fine.
Not exactly. Intellisense isn’t affected by that feature per say, since that doesn’t rely on reading through every single character in your script for it to work - unlike linting and highlighting.
If it does slow down, it’s simply because of the sheer amount of text your system has to keep in memory and display to you - but then at that point, you must have a really outdated system, your script is just that massive, or your settings are messed up.
You’d have bigger problems than a slow IDE if that were the case.
I forgot to add on; this also includes adding/removing new characters in your script, both of which must be done if you rely on intellisense. It’s not intellisense’s fault on its own, it’s just that your system just can’t keep up with all those characters.
You may want a new PC for that - but then: can it run Crysis? /j