- Posts: 452
- Thank you received: 79
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Vatiken wrote: That looks about right but you will have issues loading your current npc files if they dont match up. Id recommend you just add the extra 2 variables to a previously established line and make it conditional. This way it will automatically upgrade any pretech npcs to your current file format. This is an example of how parse_object () handles it.
Code:if (!get_line(obj_f, line)) { log("SYSERR: Expecting third numeric line of %s, but file ended!", buf2); exit(1); } if ((retval = sscanf(line, "%d %d %d %d %d", t, t + 1, t + 2, t + 3, t + 4)) != 5) { if (retval == 3) { t[3] = 0; t[4] = 0; } else if (retval == 4) t[4] = 0; else { log("SYSERR: Format error in third numeric line (expecting 5 args, got %d), %s", retval, buf2); exit(1); } } GET_OBJ_WEIGHT(obj_proto + i) = t[0]; GET_OBJ_COST(obj_proto + i) = t[1]; GET_OBJ_RENT(obj_proto + i) = t[2]; GET_OBJ_LEVEL(obj_proto + i) = t[3]; GET_OBJ_TIMER(obj_proto + i) = t[4];
Please Log in or Create an account to join the conversation.
tbaMUD © 2024