Creating Libraries

TM123
Is there some trick to making a library?
I made one with some functions with no problem, but when I tried to put in a command, I would get a "reference not set to an instance of an object error" when I tried to load. I tried copying commands from other libraries that loaded ok into mine and got the same error. I took out the functions, leaving just a command and got the error. I destroyed everything and started over.
Now I'm not getting that error. Now the functions work, but it completely ignores the commands, as if they weren't there.

(LATER) OK, it is like walking on eggshells:
no comments
no blank lines
If you modify the library it won't work in the game anymore, you get false error messages. You have to delete the game and create a new one.

Pertex
Make sure that you save your library in UTF-8

The Pixie
What are you using to edit the library? Try NotePad (or even better download Notepad++). As Pertex alludes to, it is likely your editor is adding dubious characters, and that is what Quest stumbles over. It should be possible to add blank lines, comments (including XML comments), commands, etc.

TM123
I'm using Notepad++
I think it was set to "Encode in UTF-8 without BOM"

Seems better now.
I didn't notice that it copies the library into the game folder. That caused some confusion.

NO, I spoke too soon. I got a "that isn't a library" error trying to load after a modification. Created a new game, the library loads fine.

The Pixie
TM123 wrote:I'm using Notepad++
I think it was set to "Encode in UTF-8 without BOM"

Me too, so that is not the problem.

What happens if you change the extension to .xml and try to open it up in your browser? If it says something like "XML Parsing Error" then you have messed up the XML somehow.

Could you upload an example that fails so we could take a look?

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums