Welcome to the Builder Academy

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

More
11 May 2026 06:09 #11022 by wlessard1
I am looking to try and figure out how to make a zone restriction based on a specific level.

I know we can set the suggested zone levels but that doesn't restrict someone from going in.

Or if someone has a better idea to restrict zones by level.

Thanks for any suggestions.

Just a guy coding a mud at home for no reason but the challenge.

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

More
11 May 2026 20:58 - 11 May 2026 20:58 #11023 by thomas
It should be relatively easy.
github.com/tbamud/tbamud/blob/a049fddcea.../act.movement.c#L218 has a message that could be turned into a blocking.

Code:
/* Check zone level recommendations */   if ((ZONE_MINLVL(GET_ROOM_ZONE(going_to)) != -1) && ZONE_MINLVL(GET_ROOM_ZONE(going_to)) > GET_LEVEL(ch) && (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {     send_to_char(ch, "This zone is above your recommended level.\r\n");     return (0);   }
Last edit: 11 May 2026 20:58 by thomas. Reason: format
The following user(s) said Thank You: wlessard1

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

More
17 May 2026 02:23 #11024 by wlessard1
Gets me started,

Will work on what I am trying to do.
I have built a remort system and I had an idea for a MUD, You start at the top, have zones to hunt and level. Then you remort and then you can go DOWN to the Remort zones.

So I know I have to add a "remort" or "rlevel" or other variable. Will look at how the levels are plugged into the zone files.

I see where I have to add the check now.

Thanks Thomas

Just a guy coding a mud at home for no reason but the challenge.

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

More
19 May 2026 15:01 #11025 by wlessard1
I want to make sure my thought process is working.

I have remort levels.. called rlevel.. we mudders can be so inventive with names right... hehehehe.

So if I build into zedit a way to set an rlevel, say zrlevel - zone remort level - So I build an adjusted clone of the level recommendations for zedit that would allow setting zrlevel to X rlevel. Then when someone enters a zone, a check like when "no_immort" is set.

Does this sound like I am on the right track?

I Know I can do this... I don't know why I am here asking about the beginning of a snippet, I should just jump in and then come here when something is not working right for the nit picky things I might miss.

Just a guy coding a mud at home for no reason but the challenge.

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

More
19 May 2026 21:12 #11026 by thomas
Yes, this is how I would go about it. I'd look for usages of ZONE_MINLVLand ZONE_MAXLVL throughout the code and add similar for remort.
The following user(s) said Thank You: wlessard1

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

More
28 Oct 2026 15:24 #11051 by wlessard1
I finally started working on restricting by my Remort Level code.

I have gotten to the point that it saves, at least in Zedit. I somehow missed a variable or misused one somewhere.
In Zedit I have this... under zedit_setup.

zone->zrlevel = zone_table[OLC_ZNUM(d)].zrlevel;

Under zedit_save_internally I have

    zone_table[OLC_ZNUM(d)].zrlevel = OLC_ZONE(d)->zrlevel;

Further down I have

/*
Remort Level restrictions for Zones  Bramage */

static bool zedit_get_remort(struct descriptor_data *d, char *buf)
{
  if (OLC_ZONE(d)->zrlevel == -1) {
    sprintf(buf, "<Not Set!>");
    return FALSE;
  }
  sprintf(buf, "%d", OLC_ZONE(d)->zrlevel);
  return TRUE;
}

Finally I have this for the menu choice of U....

/*
*/
  case ZEDIT_ZRLEV:
    /* Parse and add remort level minimum and return to main menu. */
    pos = atoi(arg);
    if (!isdigit(*arg) || pos < -1 || pos > 20)
      write_to_output(d, "Try again (0-20) : ");
    else {
      OLC_ZONE(d)->zrlevel = pos;
      OLC_ZONE(d)->number = 1;
      zedit_disp_menu(d);
    }
    break;

Then in act.movement.c under do_simple_move I added this.

  /* Check zone remort level restrictions */
  if ((ZONE_ZRLVL(GET_ROOM_ZONE(going_to)) != -1) && ZONE_ZRLVL(GET_ROOM_ZONE(going_to)) > GET_REMORT_LEVEL(ch)) {
    send_to_char(ch, "This zone is restricted to a higher Remort level.\r\n");
    return (0);
  }

So I am thinking that I somehow made some variable mistake on choice. I am just not seeing it right now so I am asking if anyone else might see my mistake.

Just a guy coding a mud at home for no reason but the challenge.

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

Time to create page: 0.344 seconds