PDA

View Full Version : Using Multiple Scripts?



Imprisoned
12-15-2007, 02:33 PM
I'm having some sort of a weird problem in 693:
--I have two scripts, I load the first one, and assign it to a slot and put it to a FFC or something else, and when I test it, it
--works fine, then then I load the second one, assign it to a slot, and put it to a FFC or something else, test it, it works
--fine, but the first script doesn't work anymore! They're both in the slots I assigned them to, but the first script
--isn't on the right side box in the Compile menu, but the second is?

I have the script "Person" (Press A to talk to a FFC)
and a script which makes a string appear when I pick up an item. I checked them both and they work if only one script is activated...

Man I'm bad explaining things...

Russ
12-15-2007, 02:53 PM
You need to have all of the scripts in one .z file. Only one file. Not two. One. And only one. Sorry for the repeating, but this is important. There is a bug that makes it where only scripts that are in the compiler work. So all of your scripts must be on one file.

pkmnfrk
12-16-2007, 12:11 AM
Clarification of russadwan's answer:

When you import and compile a script (say foo.z), a nice big chunk of data is created and stored in your quest. Then, when it gets to the part where you assign the scripts, you are essentially assigning parts of that chunk to the nice friendly numbers that you use elsewhere.

Then, if you import and compile another script (we'll call it bar.z), a new chunk of data is created. It's stored in your quest- oops! There's already a chunk here! The old chunk gets overwritten by the new one. The old numbers now point to nothing at all, but the names from the old scripts still stick around (since they're copied elsewhere). They give the appearance of working, but they don't actually work.

Imprisoned
12-16-2007, 05:25 AM
Oh how silly of me. Of course. Thanks.

EDIT: Okay new problem. I put them all into one chunk just after each other and it says there are compilation errors. How do I evade this?

EDIT2: Solved, I accidentally put import std.zh in the beginning of all the scripts... Now I have only one and they work.