basic modding tutorial for toee

Discussion in 'Tech Guides and Help Threads' started by sir_toejam, Jun 15, 2004.

Remove all ads!
Thread Status:
Not open for further replies.
  1. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    i was asked to post a copy of what i posted over at atari forums here. so here 'tis. there is some basic info to get folks started here. if there is interest, i will add more.



    1st off let me say that while it may sound complicated at first, you will quickly get a feel for this stuff as it is not difficult.

    how bout i do it in parts...

    part one, tools.

    These are the tools you will need to do all of the editing and hacking you could want:

    1. The .dat extractor (Zane's) and protos editor (phalzyr's tab file editor) from the Co8 website:

    Zane's ToEE Extract

    Phalzyr's Proto Editor:

    BTW Phalzyr has posted a good description of all the fields in the file; it is the very first link on the co8 forums/general modifications and i won't reproduce it here.

    2. A good text/hex editor ( i like ultraedit-32, but there are lots around)

    3. something that you can use to convert decimal values to hex and vice-versa (the scientific mode of the windows calculator will do this nicely)

    4. Ferro's character editor (note: USE THIS ONLY TO VIEW YOUR CHARS, DON'T USE IT TO MOD) available here:

    there are other useful items here too.

    Ok I will pause while ya all get yer tools.

    OK. part 2. extracting files and deleting what you don't need.

    Before I say anything else, let me say that most of what i write here has been stated elsewhere on this forum (mostly by tpigeon) or the Co8 mod forums so you can also search here or there for more detailed information and other experiments). Also, feel free to paste the info here anywhere you wish. i don't need kudos or creds or anything. Just hoping this will get more folks modding this game; the engine and tactical combat modes have lots of possibilities; more than any other game i have ever seen. It is just a bit "unfinished" in it's current state. I expect Steve Moret would have liked to release a dev toolset for this game if he had the time, maybe it will still happen someday (maybe any expansions will even be fan based!)

    I assume you now have the program TOEEextract.exe? you will need to open a command window (dos box) to run this. put the file in your main toee directory and from the command window type:

    toeextract toee3.dat toee3dat

    this will extract toee3.dat into its component files and directories and put them all in the directory toee3dat (in a subdirectory called toee3). BE WARNED! this will take a lot of hard drive space (couple hundred mbs at least). For our purposes, you don't need to extract the other dat files, though later you might want to play with the animations and meshes in dat1.

    ok that should take a couple minutes at least (lots o files!). once done, you can delete everything in toee3 except for the following directories:


    that should cut down the size to around 7mb, much more manageable

    ok now, check your main toee directory and make sure there is a data subdirectory. there should be, if you installed the Co8 fan patch (I highly recommend installing this 1st to aid your efforts)

    In that data directory, make sure the same subdirectories exist like the above ones we saved in toee3 (again, the appropriate subdirectories should be there if u installed the Co8 patch)

    ok now that the prelims are out of the way, we can get started.

    Here are the important files and their functions, so you can get a quick start if u want (of course, make sure to back these up before tinkering):

    located in the data\rules directory :

    this is a tab delimited "spreadsheet" style file containing most of the information controlling pc's, npc's, items, doors, and other things. It is the primary file you will be editing in order to change how the game functions. Use Phalzyr's tab file editor on this baby. the field descriptions can be found in the co8 forums area under general modifications (first link posted by phalzyr) and would be too long to reproduce here.


    standard ascii file containing the id numbers, descriptions, and usages of items that can be created "in game" using scribe scroll, craft wand, craft wonderous item, etc.


    standard ascii file containing the inventory lists for all of the chars and stores in the game. edit this to change the inventory items that any character has on them, or any store sells. Note that line numbers here correspond the the inventory numbers in the file, so you can create new line items here and then change the inventory number in the file to correspond to your new item list.


    er, pretty self explanatory. the items are listed for each char that they will have on spawn. the numbers correspond to the line numbers in the file, so you can look up what they are there. you can have your new char start off with any item listed in the file (including ones you made yourself!)


    contains the short description of items listed in the file. you can change the description of any item in the game here, or add new descriptions for your new items. Note, I think you also have to save changes to this file in the modules\ToEE\rules directory of you main toee directory. Not sure why(?) maybe someone else can chime in here.

    located in the data\dlg directory:

    these are the dialogue files that npc's use when you speak with them. you can edit these with a standard text editor, or try out the dialogue editor on co8 site (i haven't tried that out yet). You can change how npc's interact with you and what they say (at least text-wise). pretty straight forward; just look at the line reference numbers at the end of each line to see where each line will take you next, then modify as needed.

    located in the modules\ToEE directory:

    \save directory

    obviously, this contains all of your saved games. u can id your savegame by the handy iconic picture saved along with it.

    the files you will edit are all called slotxxxx.tfaf

    you will need to use your hex editor here.

    \players directory

    this is where your newly created PC chars are saved.

    the files you will edit are all called Charname.ToEEPC

    again, hex edit OR you can try one of the char editors out there (kharmakazies seems to work OK; find it at the same place as Ferros)

    OK. these are the primary files to play with. take a look at them in your various editors to familiarize yourself.

    Last edited by a moderator: Aug 15, 2006
  2. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    Part 3 - so, you want to be a god (or at least play one on TV)?

    Well, sorry for the delay for those of you looking for the tab editor. Hopefully you have it (or another) now. I'm gonna go ahead and post an example that will make full use of most of the files listed above.

    Let's say your feeling a little demonic today; maybe you'd like to be a glabrezu... naw too much like a lobster. A hezrou? naw don't care for amphibians too much. I think i wanna fly! yeah that's the ticket. Flying demon! Okees, then you wanna be a Vrock! your wish is granted.

    Step 1 (in which you find a body for your Vrock demon to posess):

    The first step is pretty simple; you have done it before, I'm sure. You need to create a new character. Once you have decided what alignment to play the game as, the only other thing that really matters is the sex of your character (mostly for gameplay and what voice to use) and that the stats are at least the minimum for the class u wanna play as; for simplicity, make your new char a human male (we'll change the race later ). I picked sorc for my Vrock, which seemed to complement his natural talents quite well, tho you may wanna play a cleric and have him rebuke other critters as servants (always fun). let's say you do decide to make him a cleric, and let's also say you made him with fire and earth domains (yeah baby: earth elemental and salamanders as slaves!!). ok, now that we have created our new "human male" (let's call him "Jack") we are done with step one. exit the game.

    step 2 (in which we summon our vrock from his current plane of existence, and decide how powerfull a vrock he will be)

    Ok, now we get to the meat and taters. you will need your protos editor for this. use your editor to load up the file "" located in the data\rules directory (i recommend backing up the entire directory before starting). If u are using phalzyr's editor, set your options (under the options menu at the top) to:

    auto size
    auto load protos
    allow add/delete rows (this is a must)

    now then, we need to know what makes a human male, if we are going to stick a demon in him! To do this, do a search for the entry "human male" by clicking on "edit" and then "find" and type in "human male". note: if you are not at the beginning of the file, scrolll to the top and click in one of the rows, the search function will not search backwards, only forwards. hit F3 (find next) if nothing happens.

    You should have come to column 0 "13000", which will have "human male" listed in column 2. congrats, we have our subject! now all we need from this row is simply the number that represents the human male, which, as you saw, is 13000 (note that more properly, the id for the char in this row is listed in column 23, but as of now, all column 0 and column 23 agree with each other). write that number down somewhere, or just remember it. we won't be changing this entry in the protos file, but in the character file you made earlier.

    Ok now we have to summon our Vrock! First, find the plane the Vrocks live on in the same way you found your human: search for "Vrock". it might take a couple F3's cause there are also items that can summon vrocks. we want the column 0 where "Vrock" is listed in column 2. In my file, that reads as 14258. Write that number down.

    now, left click on the 14258 (cell 0) and it should highlight the whole row in blue; in any case, you want the whole row selected.
    With the row highlighted, right click on any cell in the row (except cell 0) and a menu should pop up. in that menu, select the option "copy this row" and bingo, you are now the proud parent of a Vrock clone, ready to modify for your needs. you should now see an exact duplicate of row 14258 right below the original (or you just copied the row using another editor). You could just edit the original row if u want, but remember that will change all Vrocks everywhere in the universe. we just wanna give birth to a new Vrock, not change the universe!

    1st, we need to give our Vrock clone a new ID#, or we will cause problems! the gods at Troika allowed for the addition of new monsters/npcs to the game, so we need to find out where to put our clone. the best way, IMO is to find the end of the block of numbers that define PCs/NPCs. To do this, note in column1 that our Vrock is defined as "obj_t_npc" scroll down past the Vrock entry until you run out of "obj_t_npc" in column 1 and you should see that obj_t_npc ends at column 0: 14451 with "legendary rat" as the entry. the next row should list 16000 as the next entry (a backpack). so, that means we can insert new npc's between 14451 and 16000. plenty o room. Note: you could probably just find the highest number column 0 and stick it after that, but this keeps things better organized, IMO.

    Scroll back up to your new Vrock entry. Change the number in row 0 (double click on it) to 14452. scroll over to column 23 and change the number there to 14452 as well; and also change it in column 128. Congrats, you have now made a new Vrock that has it's own unique identity! Woot!

    Er wait... starting the game as a full-grown, full-powered Vrock might be just a tad unbalanced eh? well, i suppose if u want to, you certainly can, but i prefer to start with a "fledgling" Vrock that is on his way to becoming... so, we will need to "tone down" our Vrock a bit.

    check out the column descriptions for your new vrock and you will see a lot of obvious things relating to his powers and abilities; unfortunately for us, not all of these things will apply when we 1st insert our Vrock into our human. Indeed, all of the stats, alignment, feats, skills, domains, npc flags, natural armor levels, hitpoints, sex, and creature types will be overwritten by the host's (human male) stats, so we will have to manually edit those later. The powers (spells) that your Vrock starts with can be changed in the protos file ONLY before we posess our human (in other words, once you start the game, these things can't be changed unless you hex edit the savegame), so you best decide what spell-like abilities you want him to have now. Natural attack abilities and effects can be edited in the protos file at any time and will affect your character in his current game once you restart toee so the changed protos file will be loaded.

    ok then, let's start with his spell abilities. scroll over to column 312, which is where the "spells" start. You should see:

    'Vrock Spores (INTERNAL)' domain_water 0

    listed there. Vrock spores is the name of the spell, internal means that it is internal to this character (not a standard spell) after is listed the domain it comes from (sorc, cleric, domain, etc) and finally the level of the spell (0, in this case). This all means that you will see this spell appear as a domain spell on the radial spell menu in game, as a level 0 spell. i don't know if setting the domain to water makes it do double dam to fire critters, i haven't experimented much with this feature. I recommend leaving the domains as they are. if u find changing the domain makes the spell misfunction.. well you get the idea.

    ok now another issue comes in here. since we decided to make our Vrock a fire/earth cleric (when you created your human host) domain spells like this can interfere with the normal domain spells you can cast as a cleric. if u leave all your special domain spells listed here at level "0" (as it already is) they will all appear at level 0 and will not interfere with your normal cleric domain spells.

    ok now you will see several duplicates of the vrock spore spell in the following columns. each one represents a single cast of the spell per day, so if there are 4 columns with that spell, you can cast it 4 times per day. I decided to remove a couple to tweak him down, so i deleted the entries from two of the columns; now my Vrock can cast his spores spell 2x per day. I did the same with the screech spell; he now can cast that 2x per day at level 0.

    ok, now i have 2x screeches and 2x spores. I have 14 spell slots left i can edit with the protos file (that's right, you can only add up to 18 spell abilities as there are only 18 columns - maybe someone knows a way around this?). now i decide i want to add a new ability for my Vrock, the ability to cast mirror image once per day, so in the next available spell column (316) i am going to put:

    'Mirror Image' domain_special 0

    A side note here, spells set at level 0 will still get more powerfull as your char gains levels. the power goes up one level for each char level gained. spells set at level 2 will start at level 2 power, etc. so if i had set my mirror image spell like this:

    'Mirror Image' domain_special 2

    it would start at level 2 power (more images, or more duration; i forget which)

    ok i figure that's enough extra spell abilities for my Vrock; you don't have to stop tho - you can add any spell ability you want here and they will all appear on your radial menu. remember that if u use something like:

    'Slow' class_wizard 3

    this will appear under the wizard spell radial menu. Also, since you are a cleric, I don't think the power level will increase as you level (haven't experimented with this) which is why i keep my special spell abilities as domain specials.

  3. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    ok now on to the other things we can change for our Vrock, the natural attack abilities. these are the attacks the vrock uses while unarmed. Listing for these attacks starts at column 132. 1st off is the number of attacks for this attack type. I think 2 is listed here, and i will leave it at that. You could change it to 1 to tone it down, or hell, 4 if u want to beef it up. Next is the damage this attack can do. i think it is listed as 2d6+8. I thought this to be a bit overpowered for a claw attack, so i lowered it to 1d8+4 (50% decrease). Next is the type of attack (Claw) changing this value will change what type of physical damage is done (piercing, slashing, etc.). finally is the to hit chance, which I lowered to 12 after experimenting a bit. that may still be a bit too high, you may want to set it even lower (try 10), or set it at 30 if u don't want to ever miss!

    several other attack types and damages are listed after that. i deleted all of them except the bite attack, and set that one at 2d6+4 with a single attack at 13 to hit. so now my vrock has 3 unarmed attacks, 2 claw and one bite. I'm not done there though. I decided a blue sparkly Vrock should do that kind of damage as well! sooo... on to the bonus round!!

    ok now the last thing to mod on our Vrock are his special bonus abilities. These include things like resistances/immunities, damage reduction, and damage multipliers on attacks. Note that these abilities (many of them anyway) can be added on equipabble items as well, for future reference.

    scroll over to column 168 and you will see the bonus types listed as "bonus type #" then "Param 1" then "Param 2" . same sequence for each bonus type.

    the first bonus type listed for our vrock is "Monster DR Holy" and Param 1 is "10". This of course means that the first 10 points of holy damage our vrock is struck by are ignored. Eh, how many times is our vrock gonna be hit by holy weaps? not many. so, i figure this is pretty worthless. On the other hand, it might be good if our Vrock was immune to his own sonic screams and poison spells. so, i changed the 1st entry to:

    Monster Energy Immunity

    and Param 1 to:


    so now my vrock is immune to sonic energy attacks and spells.

    Vrocks also have spell resistance, which you will see an entry for, and i toned this down to 12. I'm pretty sure it works just like armor class, but for magic.

    you will note that some bonus types (like the above) use one parameter, others use none, like the variable "monster untripable", which i added as a bonus type because, er, well, Vrocks fly damnit! other bonus types use two params like the other i added:

    Monster Bonus Damage

    which uses param 1 (the type of damage) in this case:


    and param 2 (the amount of bonus damage added)


    so now whenever my Vrock connects on an unarmed attack, he will do an extra 1d6 cold damage as well. You can change the damage type to holy, unholy, axiomatic, electricity, fire, etc.

    ok you get the idea; scroll around protos tab and look at other monster bonus types to see if u want any of them. then add as u wish.

    Note that all bonus and attack types can be edited in the protos file any time you wish, and they will change on your character (or items) in game as soon as you load toee with the changed protos file. this is nice if u find u need to tweek your characters power up or down a bit as you play thru the game.

    *whew* we are done with what we can do here to make our new Vrock. One last thing: go to column 123 and write down the number you see there (should be 4190). this is the portrait of our Vrock.

    OK, now just to test, start up toee and make sure everything is working ok.

    Now it's on to:

    STEP 3 (where we posess our pitiful human with our newly created Vrock)

    ok, now you will find out how easy it is to hex edit a file.

    open your hex editor (whatever it may be, in my case i use ultraedit - 32, so i will be describing the following using that proggy). Now you need to load the character file you created in step one. Go to the directory: modules\ToEE\players in your main toee directory. Find the file: Jack.ToEEPC and open it with your hex editor (make a backup copy first).

    If u have never used a hex editor before, you might check out some of the numerous websites devoted to this topic first, or some of the posts in the atari or co8 forums for usefull info. However, even a first timer can get thru this.

    assuming you are, you will first see a column with several zeros followed by numbers and letters. then you will see a bunch of columns with 2 digit entries in them (e.g., 00 or 1A), and finally the last column on the right will look like a bunch of gobbledegook, with occassional words you might recognize (Jack being one of them most likely). You can safely ignore both the first and last columns, you are only interested in the two digit columns.

    ok now that you have all this in front of you, what does it all mean? well, it's kinda like code for the DNA of Jack! Changing the two digit codes changes jack in big ways.

    All we are going to do today is make Jack into our Vrock and give him the right picture. tommorrow we will change his stats and skills, and a few other things.

    now then, open whatever you use to covert hex numbers to decimal and vice versa (i use the scientific mode of the windows calculator, but there are numerous free ways and websites that will do the same). Remember when i told you to write down the decimal number for "human male" from the protos file? It is 13000 in case you forgot. enter that number in the decimal mode of your calculator and then click on the hex button to convert it to hex mode. you now see:


    this is hex for 13000; it is really composed of a pair of values: 32 and C8.

    ok now then, in our hex editor with the jack player file loaded, we need to find the entry for "human male" we know in hex it is:

    32 C8.

    but not so fast bunky; we need to reverse the number pairs to actually track it down in the file:

    C8 32

    you need to reverse the hex value pairs for any entry you are searching for in the file, best you remember that!

    ok now do a search for the exact string: C8 32

    a few lines down in the file, it should take you to that value pair. Whee! we now have found Jack's primary race value!

    We now can posses Jack with our demon Vrock! did you write down the decimal number for the new Vrock you made in the protos file? should have been 14452. Enter that value in your calculator in decimal mode and then convert to hex. you get:


    so now reverse the hex value pair like we did before:

    74 38

    this is what we need to change Jack's race to. so change the entry C8 32 to 74 38. Presto! Now Jack is a Vrock. not just any Vrock, but the Vrock YOU made. Woot!

    now we want to change jack's face too, so his portait looks like a Vrock as well as his body. This is a bit more complicated, as there isn't a listing for every portrait you could have picked from the char creation screen (you may have even selected a custom portrait). the way i found the entry controlling this was to create another char, just like jack in EVERY way, but changed the name to ted. then looked to see what value pairs had changed in the file (it should be just the values for the name). then i created yet another duplicate but then i changed what portrait i used. bingo, i could see where the values changed and now knew approximately what to look for. It turns out that there is a pattern to the file where big blocks of info (like the stats listings, skills values, etc.) end with the base pair:

    01 04

    and the value for the portrait is just before the last (or rarely, the next to last) 01 04 entry. Also, values are separated by a pair of 00 (00 00 ; really these are just unused values, since there aren't millions of portraits, but for simplicity, i will just called it a "separator"). so... search for the exact string 01 04. keep going until you find the very last 01 04 entry in the file (should be a few lines from the bottom). now before that entry you will see 00 00 and the value pair before that is, you guessed it, the portrait value.

    so it might look like this:

    0F 1A 00 00 01 04 where 0F 1A is the portrait value, 00 00 is the separator, and 01 04 ends this value block.

    and you only want to change the 0F 1A part (note that it could be any value pair, not just 0F 1A- it's the location of the pair that's important).

    from earlier i asked you to write down the pic number for a vrock, which is 4190. do the usual, covert to hex and reverse pairs and you get:

    5E 10

    so change the portrait value to that.

    now it would look like this:

    5E 10 00 00 01 04

    save your file.

    now if all is right with the world, when you start toee and start a new game of alignment compatible with the jack's, you will still see jack listed as a potential character to use. don't be alarmed if his portait still looks the same in the list. now add him to the party and if all is right, his portrait should change to that of a Vrock! presto! you have possesed a human with a Vrock. If all did not go right, one of the following will happen:

    1. toee will CTD before you even get to the character screen.

    2. jack will no longer be listed as a character

    3. jack will have some very strange stats, skill values or other that you did not expect (like 24000 strength or 40000 for concentration skill.

    4. the game will CTD when you try to begin.

  4. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    if any of these occur restore your backup jack character file and all will be ok again. go back into the hex editor and try again. assuming you did everything exactly as i told ya, it is one of those exceptional files where the last 01 04 is NOT the right block ender for the portrait value. *sigh* if that is the case, move ONE 01 04 entry earlier (not the last 01 04, but the one before the last) and repeat the portrait changing instructions above. now it will work fine. don't forget to change the race value to your vrock race again.

    Congratulations! you are now the proud owner of a fledgling Vrock!

    Tommorrow, i will tell you why your new Vrock can't move around inside of buildings too well. (and how to fix that easily). And, we will edit some equipment and give it to our Vrock to start off with.

    PART 4 (In which we enhance our Vrock possesed human a bit more, and give him some usefull items to start with)

    Ok assuming you have had a chance to give your new Vrock a road test, you may have run into some interesting things. One is, if you went into the inn in Hommlett you will have noticed that you get stuck; or you may have tried another building and couldn't go through the doors. There is a good reason for this. You are a Vrock. Vrocks are large, hulking demons things; not meant for indoor play. Ahhh. but this is easy to fix.

    What we need to do is go back into the protos file.

    find the entry for the Vrock we made earlier (14452). Scroll over to column 24 (size). note that the Vrock's size is set at size_large. change that to size_medium. Voila! problem fixed. you can now go into buildings with no problem. Note that different models are affected by the size variable differently; if u used a different model than the Vrock, you may need to experiment with the size class a bit. Aslo, size class affects reach and whether you can handle dual wielding two handers or not.

    As long as we are here, you may have decided that your Vrock should start off with some usefull equipment (scale armor and a xbow or sword is not too usefull to a Vrock). Maybe you think he should have a better armor class to start? or maybe start with a nice belt? anywho, this is where we can make and/or modify items just like we did with the characters!

    I decided that normal armor simply would not work on a feather covered beastie like a Vrock, so i wanted him to start off with some good armored bracers.

    do a search for "bracers" you will find several entries. i decided i wanted only the best (bracers +5) which shows up as 6115 in column 0. so, write that number down.

    hmm. i also decided he should have a belt that does something as well. "but wait, you can't wear belts!" i hear you say. Wrong! with our handy dandy editor we can fix all that.

    do a search on "belt". I ran into Oolgrist's emerald belt 1st (12014). Now knowing this is a unique item, and that there wouldn't be tons of instances of this item in game, i get lazy and decide i will just mod this item instead of copying the row and creating a whole new item. However, if u are a stickler for detail, you can do the same thing as with the Vrock; copy the row, find the end of the item lists, and change the number of the new row to one that is not used.

    ok, now that i have Oohlgrist's belt highlighted, 1st off I of course want to make it so that i can even equip the thing! just like batman, i think belts hold "tools" so i think, "why not make belts useable where you would use lockpicks?" ok... sroll across to column 61 (equip slot flags). it's blank huh. well there's your problem! The game never defined that belts could be worn ANYWHERE! *sigh* ok we need to fix this so that we can wear it where lockpicks (thieves' tools) are "worn". search for "thieves' tools" and you should find the row where thieves' tools are defined (12012). hey! convenient, it's just two rows above our belt. ok scroll over to column 61 and note that the flag here is set to "OIF_WEAR_LOCKPICKS" this defines the paper doll slot where you can equip this item.

    note: the "O" the entry starts off with is an ascii seperator that starts an entry. for multiple fields, you will see the next field have a O and a square in front. just follow the patterns you see around the rest of the file.

    ok so copy this flag from the thieves' tools entry and paste it into the same column for our belt. now we can equip this belt in the tools slot! whee. Now we have a pretty green belt we can wear. unfortunately, it's pretty worthless as it has no benefits to wearing it!

    let's add some powers for this belt. hmm. green denotes "acid" in my mind, so let's add acid resistance to this belt. now remember that we added "bonus types" to our Vrock? Same thing here. Scroll over to the 1st bonus type column (168). If you search around the protos file in the bonus types areas, you will see entries for "elemental resistance" which is what we want. so use that tag in column 168: Elemental Resistance.
    In the param1 (col 169) we define the type of resistance: Acid. and then in the 2nd param (col 170) we define the amount. 10 is good for me. so the 1st three columns in the bonus type area (168, 169, 170) should now look like:

    Elemental Resistance

    now we have a belt of acid resistance! whee! let's do more! I like wearing rings that do things other than just give me a deflection bonus, so let's add a deflection bonus to our belt. col 171 starts the next bonus type. we want a defelection bonus (like a ring of protection provides; you can look up the ring to see for yourself). so enter "Defelection Bonus" in col 171. this only has one param, which defines the amount of bonus. i picked 3 (same as ring of prot +3). so put "3" in 172 and you can leave 173 blank.

    Now we have a belt of acid resistance and deflection. Damn, but i am greedy. I want more! I want my Vrock to be able to call on his belt to cast special powers as well! Ok. no prob. I looked up an item that i knew had unlimited charges, and could be used once per day. hmm. the fungus figurine comes to mind! so do a search on "fungus" (no puns on my handle here, plz) and you hit number 12024 - the fungus figurine. Ok, now we need to figure out what makes the object have unlimited charges 1st. scroll over to col. 59 and note the entry there is -1. this is common in many scripts to define unlimited numbers as -1, and this is what it means here too. if it said 10, it would mean the item has ten charges. check out a wand to see what limited charges looks like.

    ok so now we know we need to put -1 in col 59 for our belt. Next, we need to figure out how many times per day we can cast the spell. now this is a bit more complicated. the protos file can use two values to define this, and these are defined as bonus types, just like elemental resistance or deflection bonus:

    Useable Item X Times Per Day


    useableitem (note there are no spaces here)

    the 1st means the item can be use a certain number of time per day, and the second means it can have unlimited usage per day.

    to follow our fungus figuring example, you will see that after Useable Item X Times Per Day param 1 is "0" and param 2 is "1". this means the item is useable 1 time per day. if it was "0" and "5" it would mean the item is useable 5 x per day, etc.

    now if we wanted unlimted useage per day, we would use "useableitem" instead as a bonus type, and enter 0 and 1 as the two params.

    ok, since we want to use our belt once per day, we will use:

    Useable Item X Times Per Day

    ok good. now we have 3 bonus types defined:

    Elemental Resistance

    Defelection Bonus

    Useable Item X Times Per Day

    now we have to decide what the thing will cast when we use it. this is exactly like defining the spell powers our vrock has, except you can only choose 1 spell power for an item (at least i have had problems defining more). so, scroll over to the 1st spells column (312). hmm. lets stick to our "acid" theme for the belt. what spells seem to fit here? how bout "acid splash" . yeah ok, wimpy spell, I know, but somehow spraying a stream of acid from my belt area... well you get the idea. so then, search around the spell area for "acid"; i find the scroll item that casts that spell, and the spell is defined as:

    'Acid Splash' class_sorcerer 0

    so i copy this and put it into column 312 for our belt.

    ok i'm done. now we have a belt that does several nice things for our Vrock, and is wearable in the tools area. Whee!

  5. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    Now it is time to give these items to our new Vrock. It is difficult to hack these items in after the fact, so it is best to start the game with them already in your char's possesion. doing this is quite simple. remember to write down the id numbers of all the items (including the belt we just made) that you want your character to start with. The quick and dirty way to do this is to now edit the file:


    which is located in the data\rules directory. you can use any standard ascii text editor to edit this file. when you open it, you will see a list of all the playable character classes in the game (divided by groups of size class). Jack was a medium sized, human male cleric as you recall. so find the entry for cleric in the medium sized races area. right under the listing for cleric, you will see a bracketed list of numbers. these are the items (by id number) that a cleric normally starts with. you can look up what the items are by searching the protos file for these ID numbers, and delete those you don't want from start_equipment.mes, or just leave em and drop/sell them once you start the game (easier). in any case, add the numbers for our belt and the other items you want to this list. now Jack will start the game with these items. note that so will every other cleric, so change the file back to it's orginal state after you save the game with jack in it unless you want all your clerics to start with these items.

    You may have already deduced something else as well, that there may be a way to define a new race with seperate items. Hmm. could be. I'll leave it to you to figure that one out.

    restart the game with your now even more modified "Jack" and have fun with your new toys!

    tommorrow i will show you how to modify Jack's stats, hitpoints, skill values, and feats.


    part 5 (Taking the randomness out of life)

    ok this is all about hex editing. everything i tell you here can also be done within a standard save game file, tho the values are much harder to find.

    a usefull tool here is Ferro's character editor, so you can see the values for skills, feats, and stats easily.

    open Jack back up in your hex editor, and in Ferro's editor. Again, the character editor is still in beta mode, and if u use it to edit ur char., it will most likely cause a game ctd. so just use it to view your char.

    ok now with both open, let's edit Jack's stats first. you can easily see the values for Jacks primary stats in the char editor. now pick a few of them, three say. I used int, wis, and charisma. 1st is int (8 for me) and then covert that to hex. comes up as "8" in hex, but we know we need a two value pair for that in our char file, so what we are really looking for is

    08 00.

    ok now then, stats are defined in a block of values like the above. i convert the next two from which i see the wis score is 17 (11 00) and 13 for charisma (0D 00), so if i put all three values together i get:

    08 00 11 00 0D 00

    oops, i forgot; as i mentioned a while back all values are separated in the file by unused values (00 00) so we need to do this here too:

    08 00 00 00 11 00 00 00 0D 00 00 00

    this would be the exact string that represents those three stats for jack in the char file. The reason i said to use 3 as opposed to just one is that it makes finding it much easier (especially later, in the savegame file).

    ok now that we have a string to look for... go to your hex editor and find it in Jack's char file. Now you have found the block where all of jack's stats are defined. just count back in the file to find the other stats, and edit them to whatever values you wish (just enter the value you want in decimal (like 22 for wisdom) in your calc, convert to hex (16 00), and then change it to that in the char file (so i changed 11 00 to 16 00).

    whee! now we have transmogrified Jack's stats to values we like better. Now let's work on his hps. this is a bit more obtuse; remember we want the REAL hp value, not the one modded by con value (which is the hps displayed when you view the char in game). fortunately, Ferro's char editor will show the real value in your char file, but if you are trying to find it in your savegame file instead, remember to subtract any bonuses due to con or other when you look at your hps in game.

    ok a level 1 cleric starts with 8 hitpoints (1d8 per level) so that's what we are looking for (08 00). unfortunately there are lot's of 08 00 listings in the file. It took some time, but i figured out that the hitpoints value is listed right after the block:

    60 00 90

    so if u find that exact string, you will see 08 00 listed right after it:

    60 00 90 08 00

    change the 08 00 value to whatever floats yer boat. I personally felt that a demon should start with more hps than 8, so i changed it to 40 (28 00) so that string now looks like:

    60 00 90 28 00

    and that finishes off jack's stats.

    let's look at skills. I don't know how you decided to spread your skill points out when you made Jack, but i recommend spreading them as thin as possible (preferably as many skills as you can, make them "1" or higher). the reason i say this is you cannot edit skill values that dont exist, and inserting new values seems to cause problems. However, you can always edit up any skill value of 1 or more. half values seem to be rounded down, FYI.

    so then, you should have a bunch of skill values at "1" so look for a bunch of 01 00 00 00 all strung together in your char file, and you will have found your skill values to edit up. e.g., look for:

    01 00 00 00 01 00 00 00 01 00 00 00

    provided you have at least 3 skills right next to each other with values of one. get it? if u didn't spread you skill values out, you can still search for individual skill values the same way you did for stats; just try to search for any skill values that are right next to each other in your file to find the whole block. For example, you might have concentration and diplomacy (right next to it) both set at 8, so you would look for:

    08 00 00 00 08 00 00 00

    makes it real easy to find. edit the values to whatever u want. remember that non-trained skills for that char (cleric) will show up with effectively half of whatever values you enter here, so if u want an effective value of "12" for a skill that is untrained (shows as yellow in the skill list) then you need to change the value in your char file to "24" (18 00).

    ok, so much for skills. on to feats. well, here we run into some problems. you can always change what feats you have by editing your char file or savegame (in case you made a mistake when you picked your feats) and to do this, Ferro's char editor will give you the decimal number of all the feats listed in his drop down menu, which you can then convert to hex and look for in your savegame or char file, then modify as you wish. however, ADDING new feats seems to always cause instability for some reason which i have as yet been unable to ken. so pretty much out of luck there.

    Well aside from ending on a down note, we have created our uber monster PC! we are gods! muwahahahaaha!!

    enjoy playing your new and bizarre PC.!

    tommorrow i will start in on editing and fixing script files like .mes and the dlg files.

    ~ pause ~
  6. sir_toejam

    sir_toejam Member

    Apr 27, 2004
    Likes Received:

    Hope you are having fun creating and modding items and characters. Now, I'm going to take a look at editing scripts.

    TOEE uses multiple scripts in order to interact with items and characters. the ones i commonly modify are those relating to dialogue between chars (.dlg files) or files relating to items and descriptions (.mes files). both of these are standard ascii files, and you can edit them with simple text editors. However, .dlg files are constructed (and really best edited) using Python or the nice little dlg editor available here:

    There are some things i won't be able to cover here (like defining and using global variables in dlg scripts), but there are lots of obvious things that can be done. To get a list of variables go here:

    I think they may also be included in the editor i posted the link to above.

    I'll do an example of a dlg file today.

    I played a chaotic neutral game (gold gold gold, must have more gold!!!) and after i rescued Prince Thrommel i expected my reward of cash, rings, knighting and SCATHER. Imagine my shock when i finally got the reward guys to spawn, but NO scather. Grrrr. Ok what happened? Welp, dialogue files control all interactions between your chars and npc's so i decided to look at the .dlg file that controls that reward interaction. it took a bit of time to find, but the file in the dlg directory (note, this is the original, extracted from the ToEE3.dat file, as explained earlier in the tutorial) was found to be:


    (i just looked in all the likely files until i saw thromel's name)

    this event is triggered when you rescue Thrommel (either by letting him find his own way out, or escorting him). Anyway, looking in this file you will see a bunch of lines numbered with brackets:


    these are reference lines for the script (not line numbers); at the end of some of the linesfor example {2}, you will see something like:




    the two lines simply differ in what intelligence level your char is at (if you have a dumb char - int less than 7 - , mod the {-7} lines, if not, mod the {8} lines. for the rest of this example, i'm going to refer to the normal speech lines {8}.

    The only number that is important for us at the moment is the {10} number as that refers to the reference line in the script that this line points to. So whatever happens in line {2} will carry to {10}. in this case, it's simply a question/answer thing. If you go to line {10} you see another question/answer session, and in line {11} we go to line {20} .

    {20} is an explanation of who the caller is. note the end of this line has no reference lines mentioned:


    all blank, so that means whatever we do will continue until another line is referenced. line {21} references to line {30}, so let's go there now. Nothing interesting yet, and line {31} goes to line {40} so let's go there.

    ok line {40} is where the speaker mentions our 1st reward, and the line ends with a routine:


    which means you are given the items defined in the line (to both your PC and npc followers) using the above routine. If at this point, you decided you didn't want to have the items distributed, you could delete everything between the brackets, and just leave them blank:


    leave the brackets tho.

    ok now it starts to get interesting. the following lines introduce other varables that affect which lines we go to next.

    notice in line {41} you see:

    {anyone( pc.group_list(), "item_find", 3014 )}

    this means the game searches anyone in your party for item 3014 (which in this case is the amulet thromel gives you if you let him find his own way out of the dungeon). If it finds it, then you go to line {70}. if not, you go to the next line {43}

    SIDE NOTE: grrr. there is some inconsistency here i can't explain, in that item 3014 in the file is NOT the amulet prince thromel gives you (in mine it's 6116), but it seems to work in any case??

    Line {70} asks you which item you want as a reward as the holder of the amulet, then gives a list of options. let's take {72} as an example:

    {}{8}{}{80}{npc.item_transfer_to_by_proto( pc, 6127)}

    ok what this means is that the game will use a routine (npc.item_transfer_to_by_proto) to give a pc character (not npc) in your party an item defined by number 6127 in the file, and then send you to line {80}. if you look up 6127 in your protos file you will see it is "prayer beads" (just like it says). Now you could, of course, change 6127 to any item in your protos file and he would give u that instead. if u do, for roleplaying sake, you might want to also change what he says he is giving you

    ok let's pretend we made our choice, so we go to line {80} which just sets up {81} where the game now checks to see if u are of good alignment:

    {}{8}{((game.party_alignment == LAWFUL_GOOD) or (game.party_alignment == NEUTRAL_GOOD) or (game.party_alignment == CHAOTIC_GOOD))}{90}{}

    and if your party alignment (the alignment you chose to play as) is any of these, you go to {90}

    {90} sets up {91} where we again have an alignment check, this time against the specific PC who is being talked to (the one who is highlighted - usually (always?) the 1st PC in your party).

    {}{8}{(pc.stat_level_get(stat_alignment) == LAWFUL_GOOD) or (pc.stat_level_get(stat_alignment) == NEUTRAL_GOOD) or (pc.stat_level_get(stat_alignment) == CHAOTIC_GOOD)}{100}{}

    and if your PC fits one of these alignments, we go to {100}

    {100} is where we FINALLY see reference to what we have been looking for: scather!

    {}{}{}{npc.item_transfer_to_by_proto( pc, 4016)}

    so if your party is good aligned, and your char is good aligned, then you can get scather as a reward.

    Note, if you rescued thrommel by escorting him out, and don't have the amulet, then we would start at {43}, which, if u met all the alignment checks listed here, would also send you to {90} to be knighted, then {100} and a scather reward.

    *whew* what a bother. but what if i want Scather no matter what my alignment?. well, assuming you went the extra mile and walked thromel out of the dungeon, we would want to modify line {43}

    since i played Chaotic neutral, i have to add this as a party alignment here:

    {}{8}{(not anyone( pc.group_list(), "item_find", 3014 )) and ((game.party_alignment == LAWFUL_GOOD) or (game.party_alignment == NEUTRAL_GOOD) or (game.party_alignment == CHAOTIC_GOOD) or
    (game.party_alignment == CHAOTIC_NEUTRAL))}{90}{}

    and make the same adjustment in {91} for my specific PC:

    {}{8}{(pc.stat_level_get(stat_alignment) == LAWFUL_GOOD) or (pc.stat_level_get(stat_alignment) == NEUTRAL_GOOD) or (pc.stat_level_get(stat_alignment) == CHAOTIC_GOOD) or (pc.stat_level_get(stat_alignment) == CHAOTIC_NEUTRAL)}{100}{}

    which now would give me scather as a chaotic neutral char, and still get me knighted as well.

    alternatively, you may not care about being knighted, in which case leave {43} alone and modify {45} to add your alignments instead, and you will be taken straight to {100}.

    or, you could even simply remove the alignment checks all together, and mod {43} to just send you to {100}:


    quick and dirty.

    By now, you should be seeing the patterns here. this file serves as a good example dlg file, but most are even simpler than this one (no item transfers, for example).

    I haven't messed around with Python yet, but I imagine it's even easier to mod these files using that.
Thread Status:
Not open for further replies.
Our Host!