The procedure for modifying characters, as we did in the last chapter is very similar to that of modifying all other data types in your adventure: objects, spells, monsters, text, and character class attributes. After we create some new objects, we will go ahead and give those objects to CALEB so that they show up in his inventory in the beginning of a new game.
1) Add new objects to game.Open up the file DB2ACK/Adventures/MyAdventure/lists/objects.txt in a text editor. Expand the window so that you can see as much of a row in your window as possible. Each non-comment row in this file represents a different object in "My Adventure". For a detailed explanation of the meaning of each field in the rows, see the documentationon objects.
It is extremely important to always maintain the integrity of the order and numbering of each row in your lists of data. If you insert or remove an object in the middle of the objects.txt file, then all objects after the change will require re-numbering, and everywhere you refer to those objects from somewhere else (such as in a map, or a character's inventory), you will have to modify the object number reference. For this reason, you must scroll to the bottom of the file before inserting our new objects.
Add the following lines to the end of the objects file. You may want to cut and paste from here into your text editor to simplify your work. Otherwise, you should probably spend some time lining up the fields of each object and comments row so you can see a description next to each field.
####New Objects########################################################################################################################################################## # Name tile# lev u drop ID buy sell find shop mask det req_attrib min bonus val type code Accur 403 "CALEB'S KEY" 156 0 1 0 0 0 0 0 0 0 0 strength 0 intelligence 0 Misc 1 0 # Name Tile Lev Uniq drop ID buy sell find shop mask det attrib val bonus val type phys fire magic special accuracy 404 "CALEB'S AXE*" 125 3 1 1 0 100 0 0 0 64 0 strength 20 strength 2 HandWeapon 10 0 0 0 1
When finished, save your changes and exit the text editor.
2) Add your new objects to CALEB's inventoryRe-open the file DB2ACK/Adventures/MyAdventure/lists/heroes.txt in your text editor and position your cursor at the end of CALEB's row. The last column in this table represents the number of objects in that character's inventory, and a list of those objects' reference numbers. Presently, CALEB does not begin the game with any objects in his posession, so the last number in the row is 0. Change the end of the line to give CALEB the objects above, so that CALEB's new row is as follows:
0 CALEB 11 him class1 30 5 9 0 0 3 1 - 25 10 14 20 400 2 403 404
Save and exit from heroes.txt.
3) Re-compile your pdb file, delete your old temporary save game, and install the new version of your adventure on your Palm.Refer to #2 - #4 of the previous chapter if you forgot how to do this. In the future, we will not detail the steps to recompile and install the new adventure, however we may note cases where you do or do not need to delete you temporary save game before testing your new version of My Adventure.
4) Run your adventure on the Palm, and view CALEB's new inventory.