Welcome to the Builder Academy

Question Gossip

More
18 Feb 2026 19:31 #10984 by JTP
Gossip was created by JTP
Hi

I would like to change gossip so that immortal gossip shows a different “gossip” message, but mortal can still just say gossip

But looking in the files I can’t seem to find where to edit the code

Anyone who can point me in the right direction pls ?

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

More
20 Feb 2026 11:48 #10985 by WhiskyTest
Replied by WhiskyTest on topic Gossip
act.comm.c

ACMD(do_gen_comm)

This is where all the different channels are coded.
The message gets built up into buf1 and buf2 (from about line 480) so you could manipulate that depending on what you want it to look like

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

More
20 Feb 2026 13:37 #10986 by JTP
Replied by JTP on topic Gossip
But wont that change all, shout, gossip etc ?

I would like only the gossip to look different for immortals ?

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

More
20 Feb 2026 14:40 - 20 Feb 2026 14:40 #10987 by thomas
Replied by thomas on topic Gossip
Here's how I'd do it.


First, add another string to the com_msgs matrix:
Code:
  /* com_msgs: [0] Message if you can't perform the action because of noshout   *          [1] name of the action   *          [2] message if you're not on the channel -  *          [3] a color string. */ +  *          [3] a color string.   *          [4] name of the action if the noise is made by an imm. */   const char *com_msgs[][4] = {     {"You cannot holler!!\r\n",       "holler",       "", -      KYEL}, +      KYEL, +      NULL},     {"You cannot shout!!\r\n",       "shout",       "Turn off your noshout flag first!\r\n", -      KYEL}, +      KYEL, +      NULL},     {"You cannot gossip!!\r\n",       "gossip",       "You aren't even on the channel!\r\n", -      KYEL}, +      KYEL, +    "immgossip"},     {"You cannot auction!!\r\n",       "auction",       "You aren't even on the channel!\r\n", -      KMAG}, +      KMAG, +      NULL},     {"You cannot congratulate!\r\n",       "congrat",       "You aren't even on the channel!\r\n", -      KGRN}, +      KGRN, +      NULL},     {"You cannot gossip your emotions!\r\n",       "gossip",       "You aren't even on the channel!\r\n", -    KYEL} +    KYEL,   +    NULL}   };

And then below, add another check:
Code:
- snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", -        com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP)); + snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", +        (com_msgs[subcmd][4] != NULL && !IS_NPC(ch) && GET_LEVEL(ch) >= LVL_IMMORT) ? com_msgs[subcmd][4] : com_msgs[subcmd][1], +        argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));

And similarly a little further down:
Code:
- snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument); + snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", +        (com_msgs[subcmd][4] != NULL && !IS_NPC(ch) && GET_LEVEL(ch) >= LVL_IMMORT) ? com_msgs[subcmd][4] : com_msgs[subcmd][1], + argument);

I hope you see what I'm going for here?
Last edit: 20 Feb 2026 14:40 by thomas. Reason: formatting

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

More
01 Mar 2026 15:31 - 01 Mar 2026 19:59 #10989 by JTP
Replied by JTP on topic Gossip
Hi

Ok so it works

Used this: +    "immgossip across the world"},
But when the immortal does the new gossip an s is being added in the and the player see this end like this: 

With this code: Name immgossip across the worlds

Should be: Name immgossips across the world


Regular mortal gossip looks good like: Name gossips and You gossip
So that is good
Last edit: 01 Mar 2026 19:59 by JTP.

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

More
02 Mar 2026 21:23 - 02 Mar 2026 21:24 #10990 by thomas
Replied by thomas on topic Gossip
In this line (in stock tba it is here: github.com/tbamud/tbamud/blob/master/src/act.comm.c#L487 ) the buffer that is sent to the mud is built:
Code:
    snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument);
Here you see the buf1 is being filled this the com_msgs[subcmd][1] which is your string "immgossip across the world". This is substituted into the string instead of the %s - but it says %ss, so the s is added at the end.

The reason for this is that all the other messages are simple verbs and the way to make those active third person present tense, is to add an s (to sing -> he sings).

So your choices are:
1. change the immgossip text into something that is a verb ("thunder" -> "thunders", for example)
2. add another couple of items in the list above, like this:
Code:
  /* com_msgs: [0] Message if you can't perform the action because of noshout   *          [1] name of the action   *          [2] message if you're not on the channel -  *          [3] a color string. */ +  *          [3] a color string. +  *          [4] name of the action if the noise is made by an imm. +  *          [5] third person tense of the action +  *          [6] third person tense of the action if the noise is made by an imm. */   const char *com_msgs[][4] = {     {"You cannot holler!!\r\n",       "holler",       "", -      KYEL}, +      KYEL, +      NULL, +      "hollers", +      "hollers"}, // similar changes throughout the list.

And then in that line, alter the call somewhat:
Code:
-    snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument); +    snprintf(buf1, sizeof(buf1), "$n %s, '%s'",  !IS_NPC(ch) && GET_LEVEL(ch) >= LVL_IMMORT) ? com_msgs[subcmd][6] : com_msgs[subcmd][5] , argument);
This will give you full freedom to choose which word(s) you want to use for this.
Last edit: 02 Mar 2026 21:24 by thomas. Reason: formatting

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

Time to create page: 0.193 seconds