Welcome to the Builder Academy

Question Can this be done, zone restrictions based on character level.

More
28 Oct 2026 20:57 #11052 by thomas
I can't see the place you are initializing the value to -1?

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

More
28 Oct 2026 21:13 - 28 Oct 2026 21:16 #11053 by wlessard1
In genzon.c about line 195... I followed the format of the min and max level settings.

  zone = &zone_table[rznum];

  /* Ok, insert the new zone here. */
  zone->name = strdup("New Zone");
  zone->number = vzone_num;
  zone->builders = strdup("None");
  zone->bot = bottom;
  zone->top = top;
  zone->lifespan = 30;
  zone->age = 0;
  zone->reset_mode = 2;
  zone->min_level = -1;
  zone->max_level = -1;
  zone->zrlevel = -1;  <

also in db.c

about line 2160
Code:
  line_num += get_line(fl, buf);   /* Look for 11 items first (new tbaMUD), if not found, try 4 (old tbaMUD) */   if  (sscanf(buf, " %hd %hd %d %d %s %s %s %s %d %d %d",               &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode,               zbuf1, zbuf2, zbuf3, zbuf4,               &Z.min_level, &Z.max_level, &Z.zrlevel) != 11)   {     if (sscanf(buf, " %hd %hd %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) {         log("SYSERR: Could not fix previous error, aborting game.");         exit(1);       } else {         free(Z.name);         Z.name = strdup(Z.builders);         free(Z.builders);         Z.builders = strdup("None.");         zone_fix = TRUE;       }     }     /* We only found 4 values, so set 'defaults' for the ones not found */     Z.min_level = -1;     Z.max_level = -1;     Z.zrlevel = -1; <-----

Just a guy coding a mud at home for no reason but the challenge.
Last edit: 28 Oct 2026 21:16 by wlessard1. Reason: Added a more information.

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

More
Yesterday 18:37 #11054 by thomas
Can you describe what, if anything, is not working? It looks reasonable to me.

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

Time to create page: 1.284 seconds