Changes between Version 3 and Version 4 of SavefileHowTo


Ignore:
Timestamp:
09/13/11 17:13:27 (6 years ago)
Author:
magnate
Comment:

Added mention of savefile.h - thanks fizzix

Legend:

Unmodified
Added
Removed
Modified
  • SavefileHowTo

    v3 v4  
    1717There are only three files you need to worry about: 
    1818 
    19 src/savefile.c[[BR]] 
     19src/savefile.[ch][[BR]] 
    2020src/save.c[[BR]] 
    2121src/load.c 
     
    3636 
    37374. Edit src/load.c and add your new function. This is usually best done by copying and pasting the previous version of the loader function for this block, and amending it to reflect the changes you made in step 2 above. Make sure you change the function name to match the one in step 3 though. 
     38 
     395. Edit src/savefile.h to add your new loader function here too. It should be obvious where it goes. 
    3840 
    3941When you've done that for all affected blocks, you're ready to build and test your changes.  
     
    63654. We then open src/load.c and duplicate the rd_monsters_6() function using copy & paste. We change the name of the copy to rd_monsters_7 and add a line {{{rd_u16b m_ptr->wibble;}}} at the point in the function corresponding to where we made the change in 2 above. It's important to ensure that the changes are made in the same place in the saver and loader functions, otherwise the wrong data will be loaded.  
    6466 
     675. We then open src/savefile.h and add the rd_monsters_7() function under the other six rd_monsters functions.  
     68 
    6569== A note about items == 
    6670