Let's say you have two scripts, an FFC script and an item script. These scripts are in separate files, ffc.z and item.z.
You import the ffc script, and put it in FFC slot 1. Then, you test it, and it works in game.
Next, you import the item script, and put it in item slot 1, assigning it to a new custom item. You test it, and it works in game. But, when you test the FFC script again, it doesn't work! You have to re-import it!
So, you re-import it. And, voila, the FFC works again. But, now, the item script doesn't! :scared:
The bug, of course, is that other scripts die when you import a script. I haven't tested to see if importing an FFC script kills other FFC scripts, or just item scripts, because I only have two right now in my game.
That's intentional. The ZScript buffer is saved along with the quest, so you can only have one ZScript buffer active at a time in your quest.
You want to add
import "ffc.z"
at the top of item.z (or vice versa).
It would be nice to eventually be able to edit multiple ZScript source files from within ZQ, but that will need to wait until post-2.5.
Huh. That's... inconvenient. I thought they would've been stored in the quest separately.
It means that you basically have to have all your scripts in one source... bah.
Yea, just export the script when you want to add to it.
Helps you remember to save backups too.
Well, I don't edit in the built in text box anyway, I use an external editor, and import it. Oh well, it's not that big of a problem, I just hope that the buffer doesn't grow too big for my scripts 😊
The only limit on the size of the ZScript buffer is your computer's RAM. However, there is a maximum length a ZASM script can be, which might cause problems if you have a single *huge* script.
What is that limit, by the way?
So far, I haven't hit the limit, even with fairly complicated custom bosses. Should I be worried?
65,536 lines of ZASM. If this limit becomes a problem, it can easily be raised.