PDA

View Full Version : Quest specific header



pkmnfrk
08-01-2008, 03:31 PM
In another project I am active on (http://hamsterrepublic.com/ohrrpgce), the game creator is given the option to create a custom script header with constants that refer to the names they've given to things in their game.

I think ZScript should have that option as well. Instead of putting NPC_WHATEVER, etc in std.zh, let us save a "mygame.zh" file with customized constants. This is particularly useful with the advent of new items that don't have constants.

You don't have to include all constants in mygame.zh, but anyone that can be changed. So, DIR_UP still belongs in std.zh, but I_MAGNAGLOVES belongs in mygame.zh.

Anyone else think this would be a good idea?

Elmensajero
08-01-2008, 08:37 PM
Well, as far as I know you can have other header files, at least it works in 2.5b819. Now, of course you have to write it using another program such as Notepad (personally, I use jEdit), but all you have to do is save that file with whatever name, for example "mygame.zh", and then in your script call it the same way you would with std.zh (for example, import "mygame.zh"). You can import as many header files as you want, and you don't even have to import std.zh as well. Now, as far as adding a feature to write, save, and open header files inside ZQuest itself, I don't think that is really necessary, but then again I write all of my ZScripts outside of ZQuest and just import them in when I am ready.

Gleeok
08-01-2008, 11:49 PM
You can already do this. In my quest I have a CONST.z file which contains, you guessed it, nothing but const int for new SFX, enemies, combos, etc.

pkmnfrk
08-02-2008, 12:02 AM
... I know that it's possible to have multiple headers. In fact, this is what my script files look like:


include "thisscript.z"
include "thatotherscript.z"
include "widget.z"

My suggestion was for ZQuest to make one for you.

_L_
08-02-2008, 03:44 AM
Make one... for you? Explain why this is necessary.

pkmnfrk
08-02-2008, 04:28 AM
Convenience, mostly. Ease of maintenance for everybody. You don't break your quest if you shuffle around your items, and forget to update a constant (a bug that could potentially go unnoticed for quite some time).

And, in the future, when 2.5 is released and the masses are using it, I'm sure someone is going to experiment with turfing all the existing items, and replacing them with fully scripted ones (like, say, Zodiac). Then, the std.zh constants would be useless.

Etc.