Welcome to the Builder Academy

Question Hometown Code - Does anyone have a working snippet for TBA?

More
22 Oct 2025 17:40 #10935 by wlessard1
I do have the snippet that is available but it seems a bit dated.

Looking for anyone that has suggestions/snippet for hometowns.

If not, then okay I have to do the heavy work on it. Not a problem. Just asking for a little faster and less stressful coding. hehehehehe.

Thanks

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
24 Oct 2025 19:07 - 27 Oct 2025 00:16 #10936 by Salty
I'm giving you some browser code that should do the trick.  You'll have to do some of the heavy lifting to make it all work, but you should be able to add the stuff you need.

the do_hometown command is untested and you'll need to add a few things to make it work.
Code:
ACMD(do_hometown) {   if (IS_NPC(ch))     return;   else   {     /*      * You'll have to create this room flag      * See: room_flags in struct.h      *      * You'll need to add this to the room_bits in constant.c also.      */     if (!ROOM_FLAGGED(IN_ROOM(ch), ROOM_HOMETOWN))     {       send_to_char(ch, "You cannot make this room your hometown!");       return;     }     else     {       send_to_char(ch, "You make %s your hometown!\r\n",world[IN_ROOM(ch)].name);       /*        *  You'll have to create the GET_HOMETOWN macro and associated defines.        *         *  See: GET_DAMROLL(ch) for an example.         *     : int damroll; in structs.h        *         *  This should save and load to/from the player file in players.c        */       GET_HOMETOWN(ch) == IN_ROOM(ch);       return;     }   } }



the do_recall command works for me and has been edited to include the check for GET_HOMETOWN().
Code:
ACMD(do_recall) {   if (IS_NPC(ch))     return;   else   {     if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_NORECALL))     {       send_to_char(ch, "You cannot recall from this room!");       return;     }     act("$n disappears.", TRUE, ch, 0, 0, TO_ROOM);     char_from_room(ch);     if (GET_HOMETOWN(ch))       char_to_room(ch, GET_HOMETOWN(ch)) else char_to_room(ch, r_mortal_start_room);     act("$n appears in the middle of the room.", TRUE, ch, 0, 0, TO_ROOM);     look_at_room(ch, 0);     entry_memory_mtrigger(ch);     greet_mtrigger(ch, -1);     greet_memory_mtrigger(ch);   } }

Hope this helps.

Salty
Last edit: 27 Oct 2025 00:16 by Salty.
The following user(s) said Thank You: wlessard1

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

More
25 Oct 2025 18:44 #10938 by wlessard1
Thanks will chase it soon, psyching myself up for the challenge so to speak.
Just messed around with remove curse to make it look through another players equipment and inventory to find the cursed item and uncurse it. mixed results.

Thanks again.

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.175 seconds