Welcome to the Builder Academy

Question Zone Instancing

More
21 Apr 2020 00:57 #8646 by Gahan
Replied by Gahan on topic Zone Instancing
Just for the record, I haven't abandoned the conversation. I appreciate your input a lot. That said, I decided to take your advice and try to use existing infrastructure to do the copying into the new instanced area. I'm having a difficult time though because oasis_copy is handled a little differently. I'm testing right now having the do_oasis_copy command called within my instancing code, but having difficulty with overriding arguments at the moment. Will update you guys soon with some code, and maybe you can tell me how badly I've hacked it up. Ha! Thanks again for the chat, thomas!
The following user(s) said Thank You: lacrc

Please Log in or Create an account to join the conversation.

More
13 May 2020 12:54 #8703 by cunning
Replied by cunning on topic Zone Instancing
I have this solved:
Code:
diff -ruN srcbak/db.c src/db.c --- srcbak/db.c 2020-05-13 08:42:45.682527148 -0400 +++ src/db.c 2020-05-13 08:44:41.264195701 -0400 @@ -1155,9 +1155,7 @@ log("SYSERR: Format error after %s #%d", modes[mode], last); exit(1); } - if (nr >= 99999) - return; - else + switch (mode) { case DB_BOOT_WLD: parse_room(fl, nr); @@ -2111,7 +2109,7 @@ line_num += get_line(fl, buf); - if (sscanf(buf, "#%hd", &Z.number) != 1) { + if (sscanf(buf, "#%d", &Z.number) != 1) { log("SYSERR: Format error in %s, line %d", zname, line_num); exit(1); } @@ -2134,15 +2132,15 @@ line_num += get_line(fl, buf); /* Look for 10 items first (new tbaMUD), if not found, try 4 (old tbaMUD) */ - if (sscanf(buf, " %hd %hd %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan, + if (sscanf(buf, " %d %d %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode, zbuf1, zbuf2, zbuf3, zbuf4, &Z.min_level, &Z.max_level) != 10) { - if (sscanf(buf, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { + if (sscanf(buf, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { /* This may be due to the fact that the zone has no builder. So, we just * attempt to fix this by copying the previous 2 last reads into this * variable and the last one. */ log("SYSERR: Format error in numeric constant line of %s, attempting to fix.", zname); - if (sscanf(Z.name, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { + if (sscanf(Z.name, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { log("SYSERR: Could not fix previous error, aborting game."); exit(1); } else { diff -ruN srcbak/genzon.c src/genzon.c --- srcbak/genzon.c 2020-05-13 08:42:45.686527205 -0400 +++ src/genzon.c 2020-05-13 08:51:03.565715679 -0400 @@ -51,22 +51,20 @@ { FILE *fp; struct zone_data *zone; - int i, max_zone; + int i, max_zone = IDXTYPE_MAX / 100; zone_rnum rznum; char buf[MAX_STRING_LENGTH]; #if CIRCLE_UNSIGNED_INDEX - max_zone = 655; if (vzone_num == NOWHERE) { #else - max_zone = 327; if (vzone_num < 0) { #endif *error = "You can't make negative zones.\r\n"; return NOWHERE; } else if (vzone_num > max_zone) { #if CIRCLE_UNSIGNED_INDEX - *error = "New zone cannot be higher than 655.\r\n"; + *error = "New zone cannot be higher than 42949672.\r\n"; #else *error = "New zone cannot be higher than 327.\r\n"; #endif @@ -78,7 +76,7 @@ *error = "Bottom room cannot be less then 0.\r\n"; return NOWHERE; } else if (top >= IDXTYPE_MAX) { - *error = "Top greater than IDXTYPE_MAX. (Commonly 65535)\r\n"; + *error = "Top greater than IDXTYPE_MAX. (42949672).\r\n"; return NOWHERE; } diff -ruN srcbak/objsave.c src/objsave.c --- srcbak/objsave.c 2020-05-13 08:42:45.690527263 -0400 +++ src/objsave.c 2020-05-13 08:49:45.044581791 -0400 @@ -1026,7 +1026,7 @@ if (*line == '#') { /* check for false alarm. */ if (sscanf(line, "#%d", &nr) == 1) { - /* If we attempt to load an object with a legal VNUM 0-65534, that + /* If we attempt to load an object with a legal VNUM 0-42949671, that * does not exist, skip it. If the object has a VNUM of NOTHING or * 65535, then we assume it doesn't exist on purpose. (Custom Item, * Coins, Corpse, etc...) */ diff -ruN srcbak/structs.h src/structs.h --- srcbak/structs.h 2020-05-13 08:42:45.698527379 -0400 +++ src/structs.h 2020-05-13 08:50:26.429179405 -0400 @@ -28,14 +28,19 @@ * 0 = use signed indexes; 1 = use unsigned indexes */ #define CIRCLE_UNSIGNED_INDEX 1 +#ifdef UINT_MAX +#undef UINT_MAX +#define UINT_MAX 42949672 +#endif + #if CIRCLE_UNSIGNED_INDEX -# define IDXTYPE ush_int /**< Index types are unsigned short ints */ -# define IDXTYPE_MAX USHRT_MAX /**< Used for compatibility checks. */ -# define IDXTYPE_MIN 0 /**< Used for compatibility checks. */ -# define NOWHERE ((IDXTYPE)~0) /**< Sets to ush_int_MAX, or 65,535 */ -# define NOTHING ((IDXTYPE)~0) /**< Sets to ush_int_MAX, or 65,535 */ -# define NOBODY ((IDXTYPE)~0) /**< Sets to ush_int_MAX, or 65,535 */ -# define NOFLAG ((IDXTYPE)~0) /**< Sets to ush_int_MAX, or 65,535 */ +# define IDXTYPE unsigned int /**< Index types are unsigned short ints */ +# define IDXTYPE_MAX UINT_MAX /**< Used for compatibility checks. */ +# define IDXTYPE_MIN 0 /**< Used for compatibility checks. */ +# define NOWHERE ((IDXTYPE)~0) /**< Sets to u_int_MAX, or 42949672 */ +# define NOTHING ((IDXTYPE)~0) /**< Sets to u_int_MAX, or 42949672 */ +# define NOBODY ((IDXTYPE)~0) /**< Sets to u_int_MAX, or 42949672 */ +# define NOFLAG ((IDXTYPE)~0) /**< Sets to u_int_MAX, or 42949672 */ #else # define IDXTYPE sh_int /**< Index types are unsigned short ints */ # define IDXTYPE_MAX SHRT_MAX /**< Used for compatibility checks. */ @@ -714,7 +719,7 @@ struct extra_descr_data *ex_description; /**< List of extra descriptions */ struct char_data *carried_by; /**< Points to PC/NPC carrying, or NULL */ struct char_data *worn_by; /**< Points to PC/NPC wearing, or NULL */ - sh_int worn_on; /**< If the object can be worn, where can it be worn? */ + int worn_on; /**< If the object can be worn, where can it be worn? */ struct obj_data *in_obj; /**< Points to carrying object, or NULL */ struct obj_data *contains; /**< List of objects being carried, or NULL */

Please Log in or Create an account to join the conversation.

Time to create page: 0.177 seconds