No idea what version this would be. I guess 3.0
This is has been sorely lacking on my part. This is a complete Re-write of Hedit. It is based off the player file and index system. This will change hedit/help as you know it. I have removed all legacy parts of the code. I would leave the old in and hand patch this. This way you can load the original help files, then write a script to save out the files in the new format. It is how I did it, and it took less then an hour. I will not write you a script, I do not have time to do that. Unique to this is the master/child record. I deal with tons of databases on top of my network engineering duties. It became clear that having duplicate entries for the same damn entry was pointless. So I made it so there was a master(parent) record, and a child record. The child has 2 lines to it, and points back to the master(parent) record. do_help is now different, it performs a search on the keyword you provide, which 1 exception. If you do help files manually, you can hedit "reload" and it will reload the help index for you. You can also delete a help entry, but this is done via hedit
do_help will call the keyword from the index, it will load it, if it see's this is a master record, it will load the help file then free the structure. If it see's the entry is a child record, it will immediately go to the child index keyword and look it up. It will continuously load the help entry, until it finds the master record. I recommend just give it the master right off the bat. I have run this through Valgrind, and the 2 mem leaks I had, are gone now.
I also put in find_help which was based off of the spell lookup function. I sped up the lookup by eliminating the word if it did not match the first 2 characters. Hence you cannot have a single character help entry.
Keep in mind, this completely changes your help files. If you just patch this file into your game, it will remove all old references to the old hedit system.
New items:
base dir>/lib/help/ =====> Where all the help files are now.
base dir>/lib/help/index ===> The index file. See below for format.
base dir>/lib/help/A-E ===> Help entries saved by first character
base dir>/lib/help/F-J
base dir>/lib/help/K-O
base dir>/lib/help/P-T
base dir>/lib/help/U-Z
base dir>/lib/help/ZZZ
Formats:
Index file: vi < base dir>/lib/help/index
ID#> < Last edit> < keywords>
~ ===> File must end with this.
A sample:
0 1303580069 midgaardmap
1 1303580173 map
2 1303580226 midgaard map
82 1303583358 dexterity
83 1303583377 dex
~
Master record:
A sample master record below. NONE is just a place holder, since a master record does not need an index keyword.
format :<1 = TRUE Master record><1 = Min Level>< Last person to edit file>< NONE>
< entry>
~ ====> Must end the entry with '~' for fread string.
$ ====> End of file.
1 1 Cunning NONE
Dexterity measures how agile a character is. It typically reduces the
delay and increases the chance of success for combat skills, as well as
modifying your armor class and affecting your rate of movement
regeneration.
~
$
Child record:
format: <0 - FALSE child record><1 = Min Level>< Last person to edit file>< Child index keywords>
A sample child record below:
Unique to this format is that it is a child record, which the 0 represents. It see this, and immediately goes to the child index keywords. There is a limit of on how many index keywords, it is what ever index is specified to be (mine is MAX_INPUT_LENGTH). It must be an active master help record, or it will not let you save it out. There are several safety features to keep the master/child relationship intact.
0 1 Cunning dexterity
$