Eyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy! Nice to see some older faces returning to the ZQuest scene.
To import ZScripts, you go to Quest->Scripts->Compile ZScript... (or just press Y as a shortcut). You'll get a window with five buttons: Edit, Import, Export, Compile, Cancel.
- Edit: Lets you directly edit the ZQuest script buffer. This is where all the code inevitably ends up, although pasting all your scripts directly in here is not ideal, so we'll be handling most of that with import commands. All the scripts used in your quest must be directly in or imported in the buffer in order to correctly compile. If you remove one and then compile, the slot that script occupied will retain its name, but act as if the script is blank.
- Import/Export: This imports from a text file into the buffer or exports out to a text file. These are not the same as the import command used in the buffer, they will overwrite it completely. Generally this isn't used unless you for some reason want your scripts to be kept in the buffer.
- Compile: You hit this to load your scripts into slots once you're done editing. Scripts that share names with ones already in slots will automatically overwrite them, so you don't need to re-add those.
Some of that probably sounded like a load of gobbledygook, just remember to use edit to edit your imports and compile when you're done making changes. Now on to the actual steps:
Step 1: Create a script text file - First you want to create a plain text (.txt) file to put all your scripts in. You want the script file to be in the same folder as ZQuest or a folder contained within. ZScript file paths start from the ZQuest folder. Usually we rename the file extension as .z to mark it as ZScript, but the compiler doesn't care so do what works for you. Now open the file in a plain text editor such as Notepad or Notepad++. In it you want to paste all of your scripts one after another with some line breaks in between so you can see where they start and end. Some scripts will have constants (marked by const int followed by a name in all caps) that they may want you to change the number values of, so do that as instructed in each individual script. If you have multiple globals, there's some more complex work to be done, but for now we're done with the script file. So save it as the name of your quest and move on to the next step.
Step 2: Edit the buffer to import the script file - Now you open the buffer in ZQuest (Quest->Scripts->Compile ZScript...->Edit). You should see an import "std.zh" at the top. This is importing the std.zh script header that you can find in your ZQuest folder. We'll be using this method to import our scripts and any additional headers they might require. A header (.zh) file is like a ZScript file but typically does not contain any scripts, only functions and variables used for them. So now we import our script using its file path. Here's an example of what your buffer might look like.
import "std.zh" //Default header for all scripts
import "ffcscript.zh" //Header used for calling FFC scripts with other scripts
import "MyQuest/MyQuest.z"; //Here's the line importing the script file, looking in the folder "MyQuest"
(Everything after a // until the next line is a comment. The compiler ignores these.)
Step 3: Compile and pray - After closing and saving the buffer, hit compile and hopefully it won't spit out an error. If it does, the most likely cause is you're missing a header required for a script or you typed in a file path wrong. In the three you linked the only extra required header is ffcscript.zh. If you run into a compiler error you can't figure out, you can post it here and I'll try to find the cause. Anyways, assuming it compiled you'll be presented with a menu with numbered script slots on the left and script names on the right. You'll want to copy each of the scripts on the right into an empty slot on the left. And do this for all three tabs. In the global tab, the slots aren't numbered but 99% of the time you'll only be using the Active slot.
Step 4: Set up scripts in ZQuest - This step varies widely from script to script. Hopefully the script's setup instructions will be clear enough to get you through it.
For FFC scripts you usually need to place an FFC on the screen with right click->Place + Edit FFC. It uses a combo which in most case you want to be invisible and has a script drop down at the bottom of the Data tab. In the Arguments tab there are arguments D0-D7 which are used by most FFC scripts.
For item scripts, you set them in the item editor under the Scripts tab. These too have the D0-D7 arguments. They also have two possible script slots, one used for when the item is picked up and one for when the item is used.
So hopefully this helped somewhat. Here's some old tutorials that might help as well.
Plissken's tutorial on importing ZScript
Beefster on organizing script imports
Joe123's guide to combining global scripts
P.S. I'd totally be down for trading ZScripts for MIDI sometime. He who holds the music degree holds the power on this site.