QEDIT v0.10 Beta - Daggerfall Quest Editor - Copyright (c) 1996-Dave Humphrey  
===========================================================

QEdit is the start of hopefully a full TES: Daggerfall quest editor.  Right 
now it can only modify the QRC quest files which contain all the texts needed
for a quest.  It can't accurately determine the type of each text, although 
it tries to, since the format of the text type is not well understood at the
moment.  It is being released as a Beta program since I have only been able
to test it on a limited number of quest files and am not sure if it can load
all quest files (although it should).  I have tested some QRC files altered
with QEdit in Daggerfall and it appears as though it works correctly, but 
there's simply too many variables to say for sure.  Bugs, comments, and 
suggestions are gladly accepted at aj589@freenet.carleton.ca


   CONTENTS
===========================================================
	Features
	Installation Guide
	QEdit - USERS MANUAL
		Startup
		Loading a QRC File
		Save a QRC
		New Quest
		About QEdit
		Exiting QEdit
		Editing a QRC
	Text Editor - Users Manual
	A Few Notes about Editing Quest Text
	Errors - What to Do in Case Of
	Known Bugs
	Credits
	Sites
	Included Files
	Version Changes
	Programming Notes
	Legal Stuff
	APPENDIX A - Listing of %string Variables
	APPENDIX B - Listing of _string_ Variables
	APPENDIX C - Listing of =string_ Variables


   FEATURES
===========================================================
	- Load QRC files and change quest texts to your liking. Cannot yet
	  change the type of quest, simply the associated texts.
	- Displays all known quest type parameters such as guild, minimum
	  rank, character status, and quest type (sometimes).
	- Edit the quest texts in a simple built-in editor which displays
	  special quest variables and codes in different colors.
	- Change the various quest parameters which automatically builds most
	  of the quest filename for you.


   INSTALLATION GUIDE
===========================================================
QEdit should be installed in it's own directory to help organize files and
directories better.  I reccomend a directory in the DAGGER directory such
as \DAGGER\QEDIT\ but it is up to you.  QEdit initially looks for all files
in the current directory upon startup, but directories and drives can be 
specified when loading/saving files (elimating the need for a CFG file for
now).  


   QEdit - USERS MANUAL
===========================================================
	Editing quest files is not a simple task, even with an editing tool 
such as QEdit.  If something is not done quite right it is possible that
Daggerfall will crash when it attempts to use the modified quest.  The best
method, in my opinion, is to copy quest files I wish to modify into the QEdit 
dir and then copy them back into the ARENA2 dir when finished.  Thus, I can 
be sure the quest won't be used until I want it to.  Also, backups of modified 
quests should be create in case an 'Un-documented QEdit Feature' (read bug) 
ruins that quest file you took days to rewrite (remember, it's currently only 
a Beta version and is not thoroughly tested).
	QEdit requires that both the QRC and QBN files of a quest are present
in the same directory.  If you save a new QRC file QEdit will copy the
original QBN along with it, but only if the new QBN doesn't already exist.
Quest file names are also very important as they give information such as
which guild, minimum rank etc...  In general, the only characters in the
quest name which can be safely changed are the last two which are simply a
quest index number to differentiate files.  QEdit will automatically
generate the quest file name, except for the last two characters which can be
specified when you save.

   START-UP
	When you first start Q-Edit you should be presented with a colorful
text screen in 80x50 resolution (a standard VGA text mode which permits twice
as much information to be displayed at a time than the normal 80x25 mode).
The top center of the screen displays the current quest loaded, which at 
startup should be none, the new quest filename (in red).   The new quest 
filename is automatically built based on the quest parameters below on the 
page.  Thus you can save quest with the right name so that Daggerfall can 
correctly read the file.  
	Below this are several lines of quest information telling you various 
information about the current quest.  If you click on the little green arrows 
you will get a listing of possible values.  Changing these values will modify 
the new quest filename at the top of the screen.  The number in brackets to
the left of the quest text description represents the hexadecimal text type
loaded from the QRC file.  It is only useful if you are into determing more
of the format for quest files.
	The next section below this is a listing of quest texts.  Currently 
up to 32 different texts can be shown at a time, hopefully many more than 
you'll ever need (all quests I've seen have had less than 20 different texts).  
The quest text description, which is not currently 100% accurate, can be 
clicked to edit that text.  To the right of the description is a value 
'Yes/No'.  This represents if that text section has any text in it currently.  
	At the bottom of the QEdit screen are the buttons Load QRC, Save QRC, 
New QRC, and Exit which should be self-explanatory and are described in more
detail below.  

   LOADING a QRC FILE
	To load a QRC file click the LOAD button at the bottom of the screen
(eventually text shortcut keys will be assigned to everything).  A new window
will appear on the screen listing files, directories and drives.  When QEdit
is first started, this list is the current directory but on subsequent saves
and loads it will remember where you left it.  Use the mouse, TAB, and cursor
keys to select a directory or QRC file.  Wildcards are accepted in the file 
name box (default is *.QRC).  When a QRC file a wish to edit is found, press
the ENTER key or click the OK button, otherwise ESC or CANCEL will exit the
window. The QRC file should now be loaded.  The main QEdit screen will be 
changed to the new file.  Unless you are particularily lucky however, many
of the quest texts will be labled as 'Unknown'.  This is because the type of
quest seems to affect how the texts are labelled in the QRC file and the 
quest type in the QBN file is not understood.  Likewise, the quest type box
at the top of the screen will probably not be correct at the moment either.
I have programmed it to find the closest matched quest type but only a handful
of types are programmed into the program (did I mention the quest type in the
QBN file isn't understood?).  No worries though, you can still edit 'Unknown'
text types although you'll have edit the text to see what it contains.

   SAVING a QRC FILE
	Saving a QRC file is much the same as loading.  Simply click the SAVE
button and enter a new or existing filename.  If the file already exists you
will be asked if you wish to overwrite or not.  If you save to a new QRC file
you will need to copy the appropiate QBN file to the new name as well, since
both Daggerfall and QEdit require both QRC and QBN files for loading quests.
The new quest filename based on current quest parameters will be the default
filename.  All that's needed is to add a two digit index and save. 

   NEW QUEST
	This simply clears the contents of the window.  Will be more useful
when you can create quests from scratch.

   ABOUT QEdit
	This button displays a window listing information about QEdit and the
current environment.

   EXITING QEdit
	You can quit QEdit by either pressing the EXIT button or by the ESC
key when in the main QEdit window.  You will be asked if you trully want to
exit but it won't currently tell you of unsaved files.

   EDITING a QRC TEXT
	To edit a qrc text simply click on the text description (even if it
says 'Unknown').  This will bring up another window with allowing you to
Edit, Delete, or Cancel.  Deleting the text will clear it from memory and the
text section will be omitted if you save the file.  This might cause problems
in Daggerfall if it needs that text for the quest (deleting the quest 
description and then saving is asking for diastor).  If edit is selected you
will be brought to the text editor which looks much like the DOS edit program,
although much simpler (see the TEXT EDITOR MANUAL below for more information).
Here you can edit text, load new text, or save text for later.  When you load
or save text, you are loading normal text files, nothing related to the QRC
file.  Special quest variables and codes are displayed in different colors.
Help can be found by pressing F1 or ALT-H and the file menu can be activated
by mouse or ALT-F.  The text editor's code appears to be quite solid and I
have yet to have it crash, although loading to large a file or binary files
might cause undefined behaviour.  When you quit the text editor, any changes
in the text are automatically recorded although you still need to save the
QRC file.  If you delete all text by the 'NEW' command, QEdit assumes you
don't want the text section and 'turns it off'.


   TEXT EDITOR - USERS MANUAL
===========================================================
	The built in text editor in QEdit is a simpler one, much like the
EDIT program found in DOS.  The mouse can be used to move around the screen
and activate the File and Help menus. Keyboard commands can be found below.

	ALT+F / Mouse - Activate File Menu         
	ALT+Q - Quit Text Editor
	F1 / ALT+H - This help Screen
	F2 - Save Text to TXT file (not to QRC!)
	F3 - Load TXT file                         
	CTRL+Y - Delete Current Line

Special quest variables and codes are displayed in different colors and are
explained in the edit help screen (F1 or ALT+H).  The text editor's code 
appears to be quite solid and I have yet to have it crash, although loading 
to large a file or binary files might cause undefined behaviour.  The header
at the top of the screen also displays what type of text you are editing
(although this is currently quite inaccurate...have I mentioned the quest
type in the QBN file is not known?).
	The text editor assumes that TAB's in loaded text files are 5 spaces.
It saves TABS as spaces and currently doesn't accept the key TAB as input.  
The editor has many shortcoming in combining lines with deleted or added 
text since lines are currently limited to 78 characters or less (you can't
scroll left or right).


   A FEW NOTES about EDITING QUEST TEXT
===========================================================
	Editing quest text is relatively straight forward, just like in any
text editor, but there are a few things you should be aware of listed below.

   - The end-of-line characters '|' and '<' are important.  Whenever one
     of these characters is found, a new line is started.  If you truly
     _have_ to use one of these characters as normal text....you can't.
     I chose these as they seemed the more obscure and lesser used. If these
     characters aren't found at the end of a line, the '<' is assumed to
     be there.
   - Be aware of the line length.  Don't use too long of lines as these must
     be displayed in Daggerfall.  The average line length is about 40 
     characters, or about half the width of the screen.  Also remember that
     various variables can be very long so make lines with variables on them
     appropiately shorter. Examples: The '_house_' variable is only 7 
     characters long, but it can represent a string like 'Hearthborne 
     Residence' or 'The Resolution of Zenithar' which must fit on the current
     line.  Daggerfall may or may not wrap text, although I do know it fits
     the quest box to the text.
   - In general, the %string variables can be used in any quest text, but
     other variables (such as the _string_ and =string_ ones) depend on the
     quest type.  In general, if you don't find a variable in the original
     text, assume that it can't be added.  If you do added a variable not
     supported by the quest type you will simply get a 'BLANK' (which I'm
     sure we've _all_ seen at one time or another).  A partial listing of
     variables can be found in the appendices at the end of this document.


   ERRORS - WHAT TO DO IN CASE OF
===========================================================
	I programmed QEdit to exit and notify the user when an error occurs.
If QEdit exits suddenly with the message 'BUG:...' you should record the
displayed information along with what you were doing at the time of the crash
(what files were you editing) along with a brief description of your system
(OS, memory, type, etc...).  You than may e-mail aj589@freenet.carleton.ca
with the resultant bug report.  Likewise, if the program crashes but doesn't
give a BUG message, record what you can and send it in.  These types of
crashes are more serious as there is no detection for them in the program.
Remember, only if I receive proper bug reports can I fix them.
	In the QEdit's about window (and in the exit messages) there is a
line giving the far heap's status.  Now, without going into too much
technical stuff, the heap is related to the memory available to the program
for loading files and for variables (i.e., very important).  The status of
the heap _should_ return OK at all times.  If the heap is corrupted it may
result in crashes and data loss in QEdit (the heap is corrupted usually by
some bug in the program or some option which was overlooked).  If, when
exiting or checking the About window, the heap status returns corrupted you
should immediately exit the program, reboot and send in a bug report.  The
reboot is probably not nessecary, but better to be safe (during debugging I
used to get a corrupt heap every 5 minutes and only rarely did the system
lock-up after exiting the program).  If you wish to save the current quest,
do so in a different file name as it may or may not be corrupted.  If the
program crashes (or other wierd stuff) when you load it, the save file is
corrupt and should be deleted.
	Occasionally QEdit will not be able to free up all the memory
allocated while it was running.  This is a less serious bug but still should
be reported.  Include the difference between initial and final memory.


   KNOWN BUGS
===========================================================
  - Paths and filename lengths must be less than 80 characters.  Any more
    than this and the program will notify you.  This shouldn't be a problem
    for most people, however if you find this objectionable talk to me.
    It shouldn't crash the program, however you won't be able to load/save
    any filenames in those long paths.
  - There may be problems related to accesing disks in the floppy drives. (or
    more specifically, floppy drives with no disks in them).  I rewrote the
    DOS error handler to better handle it and it appears to work...but no
    promises.


   CREDITS
===========================================================
	A number of people have contributed invaluable information concerning
the format of quest files.  Many thanks go to the following...

	 Peggy S Hanks (df4@juno.com)
	 Lord Phoenix (gozer@esoterica.pt)

This program also uses 3rd party keyboard and mouse routines which have saved
me much time from writing and debugging them myself.

	INT9 (IRQ1) keyboard handler #9 by Patch (hamell@cs.pdx.edu)
	MOUSE Routines by  Michael Chen  (mchen@groucho.cs.psu.edu)



   SITES
===========================================================
To contact the creator of QEdit E-Mail 
	Dave Humphrey at aj589@freenet.carleton.ca

For latest version updates of QEdit The ESP: Daggerfall Files
	http://www.newforce.ca/~jackel/esp/files/

For the Quest Editing Guide The ESP: Quest Editing Guide
	http://www.newforce.ca/~jackel/esp/dagqfaq.html

If there's any other sites you think should be included here, feel free to 
suggest them.


   INCLUDED FILES
===========================================================
	QEDIT.EXE - Main Executable
	GUILDS.DAT - Contains listing of guilds/factions
	QEDIT.TXT - Program documentation
	QEDIT.HTM - Program documentation in WWW format

	Source Code -  Is not included in archive due to size, but is 
		       available if you want it.
		    

   VERSION CHANGES
===========================================================
   v0.10 Beta - Current Version
	- First release - 12 December 1996
   Future Versions
	- Change more quest parameters (monster type, item type, quest
	  location, house/dungeon type, etc...)


   PROGRAMMING NOTES
===========================================================
	This program is considerable larger and more complicated than the
other Daggerfall utilities I've released (DAGPIC and DAGREFL). It uses 
several source files and some old code I've used for a while (like the 
text editor base I created about a year ago).  It also uses 3rd party
keyboard and mouse routines which have saved me much time from writing and
debugging them myself.

	INT9 (IRQ1) keyboard handler #9 by Patch (hamell@cs.pdx.edu)
	MOUSE Routines by  Michael Chen  (mchen@groucho.cs.psu.edu)


   LEGAL STUFF
===========================================================
Although this program has not ever caused any sort of damage to my computer
(short of the odd lock-up/reboot) in the many hours of testing and debugging,
there is no guarentee that it won't.  I cannot be held responsible for any
software or hardware damage incurred through the use of this program. 

I am in no way connect with BETHESDA, the computer gaming company who created
TES: Daggerfall.  This is completely a third party hack of the quest files.

All files in the above file list are free domain software and can be copied,
duplicated, at will.  If you wish to use the source for a project of your
own, I would consider it a curteousy to tell me and give credit somewhere.


APPENDIX A - Listing of %string Variables
======================================================
		Variable        Description
	       ===========    ===============
		%pcf            character's full name
		%pcn            character's first name
		%pct            character's last name)
		%ra             character's race
		%oth            an oath (listed in TEXT.RSC)
		%god            some god (listed in TEXT.RSC)
		%di             some direction
		%g              pronoun (he, she)
		%g2             pronoun (him, her)
		%g3             pronoun (his, hers)
		%qdt            current date
		%reg            the region the quest takes place in


APPENDIX B - Listing of _string_ Variables
======================================================
		ITEM Variable           Description
	       ===============        ===================
		_artifact1_             some artifact
		_artifact2_             some artifact
		_artifact3_             some artifact
		_artifact4_             some artifact
		_artifact5_             some artifact?
		_magicitem_             name of magical item
		_item_                  name of item
		_jewelry_               some jewelry
		_key_                   name of key
		_reward_                some gold
		_goldgoth_              some gold
		_gold_                  some gold
		_bribe_                 some bribery gold
		_scarab_                a scarab

	      Location Variable         Description
	     ===================      ===================
		__magesguild_           city of guild
		_tavern_                tavern name
		___keydung_             key dungeon name
		_safehouse_             name of safehouse
		_dispatcher_            dispatcher's name
		_contact_               contact's name
		_casfort_               a castle or fort name
		_temple_                temple name
		_newplace_              dungeon name
		___newplace_            dungeon name?
		___itemdung_            name of item dungeon
		_palace_                name of palace
		___crypt_               name of crypt
		___mondung_             monster infested dungeon name
		_myndung_               money dungeon name
		___myndung_             money dungeon name
		_agentplace_            place to find agent
		_ukcrypt_               Underkings's Crypt name
		___ukcrypt_             Underking's Crypt place
		_brother_               my brother
		_messenger_             name of messenger
		_necs_                  a necromancer?
		_foil_                  name of someone1?
		_agentuk_               Underking's agent name
		_queen_                 name of queen
		_traitor_               name of traitor
		_contact1_              name of contact #1
		_rebel_                 name of rebel
		_2myndung_              so many days to dungeon
		_monster_               monster type
		_qgfriend_              name of questgiver's friend
		__qgfriend_             building questgiver's friend is in
		___qgfriend_            city questgiver's friend is in
		_dummy_                 name mentioned in letter (not real)
		_npc1_                  ditto
		_npc2_                  ditto
		_npc3_                  ditto
		_house_                 name of a residence
		_meetingplace_          name of a meeting place



APPENDIX C - Listing of =string_ Variables
======================================================
		  Variable              Description
	       ===============        ===================
		=contact_               type of person?
		=queston_               so many days
		=itemindung_            so many days
		=towertime_             so many days
		=2myndung_              so many days
		=2palace_               so many days
		=1stparton_             so many days
		=2mondung_              so many days
		=reward_                some gold
		=2shedungent_           so many days
		=executiondelay_        so many days
		=keytime_               so many days
		=guards_                some guards?
		=atronach_              name of atronach servant

Document Last Modified the 11 December 1996
