Phillip, You seem to be on the right track. Please notice how the code counts the number of records, then CREATE()'s the entire array in one big chunk, and then reads the file again to fill this array. If I were you I would go see what the CREATE() macro is. The answer to you question is, ALWAY use CREATE() or RECREATE(). You should add a section to index_boot to handle this empire stuff for you that will then call init_empire() --Angus Phillip A Ames <kirk47@JUNO.COM> on 03/05/99 06:15:02 PM Heya all... I've got a problem/question/something.... I'm coding an empire system to put into my MUD, similar to clans. I'm going to parse them from a file similar to a world file. Now, I've written the function to load them, but I'm confused as to what I need to do now :) From what I've seen, the world files, mob files, obj files, etc. all use the CREATE macro. I want to be able to access the empires by using something similar to an array, such as emp[GET_EMP(ch)].treasury to access the treasury of the characters empire(that's assuming I put a struct empire_data *emp; at the top of the function). The empire they're in is stored as an 'int' in the pfile, and I've defined the empires as follows: #define EMP_FED 0 #define EMP_VUL 1 #define EMP_ROM 2 #define EMP_KLI 3 #define EMP_CRD 4 #define EMP_JEM 5 #define EMP_BJR 6 #define EMP_BRG 7 #define EMP_FER 8 #define NUM_EMPS 9 How am I going to be able to access the fields of the empires similar to how I stated above? Am I going to need to use CREATE(), malloc(), or calloc()? I've been told no by a few people, but I just don't see how I'm going to be able to access them. If anyone can tell me, I'd appreciate it, and if you'd like, when I finish, I'll send it your way. Thanks, -Phillip +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST