Welcome to the Builder Academy

Question Changing colors for wiznet channels and the tells

More
02 Feb 2014 07:00 - 25 Oct 2014 23:26 #4676 by aredcloak19
The files that you will need are the act.wizard.c, act.comm.c, and screen.h(optional, just looking up the code for the tells if you want ansi defaults) Another help is the show colour help file with the 256 colors.

NOTE: When you are editing these files backup everything and then test. Also you need to run a make then do a copyover when you are finished with the changes for them to be accepted on both wiznet and tell color changes.

2nd NOTE: You will have to do a change directories and do a make in the src directory, just like in the first time that you compiled the tbamud.

We are now going to start with changing the Tell color. If you want to change from the deep red that is default from to the another default color open the screen.h located in the same /src folder. Also if you are a little more adventurous(such as myself) and want to use the 256 color scheme in the tbamud itself by typing <show colour>.

Now with the act.comm.c open scroll down to the perform_tell function(method in java).

Code:
snprintf(buf, sizeof(buf), "%s$n tells you, '%s'%s", CCRED(vict, C_NRM), arg, CCNRM(vict, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_VICT | TO_SLEEP); add_history(vict, msg, HIST_TELL); if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else { snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", CCRED(ch, C_NRM), arg, CCNRM(ch, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); add_history(ch, msg, HIST_TELL); }

We are going to change the CCRED to another ANSI color first, then do a 256 color scheme change.

Code:
snprintf(buf, sizeof(buf), "%s$n tells you, '%s'%s", CBCYN(vict, C_NRM), arg, CCNRM(vict, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_VICT | TO_SLEEP); add_history(vict, msg, HIST_TELL); if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else { snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", CBCYN(ch, C_NRM), arg, CCNRM(ch, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); add_history(ch, msg, HIST_TELL); }

This will be a bright Cyan color, if you want the darker Cyan, then do CCCYN. Now for the 256 color scheme change.
Code:
snprintf(buf, sizeof(buf), "%s$n tells you, '%s'%s", ColourRGB(ch->dsec, "F530"), arg, CCNRM(vict, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_VICT | TO_SLEEP); add_history(vict, msg, HIST_TELL); if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) send_to_char(ch, "%s", CONFIG_OK); else { snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", ColourRGB(ch->desc, "F530"), arg, CCNRM(ch, C_NRM)); msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); add_history(ch, msg, HIST_TELL); }

The color is a softer orange color, but you can look at the show colour and choose the one that you like the most and put it in where I have the orange color. Also You can leave the vict in there, just (vict->desc, <256color>) or (ch, <256color>)

That's how you change the colors between in the default and the 256 Color scheme and a shout out goes to Luran and Krell for helping with this color change.

I'm the one that people say, "How did you break this and what did you do to break it."
Last edit: 25 Oct 2014 23:26 by aredcloak19.

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

More
02 Feb 2014 07:21 - 02 Feb 2014 17:30 #4677 by aredcloak19
Now we are going to do the Wiznet channel color change. This is because if you have changed the colors for the tells to the same color as your wiznet, if you are like me you want colors that are different so you can reply to the same channel and not have the embarrassment of the mischan. I know that it will probably still happen, but now you could a little less confusion by a color change.

Now from the previous post, open the act.wizard.c file and if you have line numbers scroll down to: 2212
Code:
if (level > LVL_IMMORT) { snprintf(buf1, sizeof(buf1), "\t[F530]%s: <%d> %s%s\tn", GET_NAME(ch), level, emote ? "<--- " : "", argument); ----- OMITTED --------------- } else { snprintf(buf1, sizeof(buf1), "\t[F530]%s: %s%s\tn", GET_NAME(ch), emote ? "<--- " : "", argument); ------ OMITTED -------- }

This will change your wiznet channel communication to a nice soft orange color of text. You may change it if you like to one of the show colour color scheme, but this is just a tutorial and showing you how to change the colors with 256. Another big thanks to Krell and Luran for helping again with this.

Ok, I'm doing this for people who want to use the default colors like @M or @C in the game for the colors that show wiznet. This is how you would use that for the changing the colors for wiznet.
Code:
if (level > LVL_IMMORT) { snprintf(buf1, sizeof(buf1), "\tM%s: <%d> %s%s\tn", GET_NAME(ch), level, emote ? "<--- " : "", argument); ----- OMITTED --------------- } else { snprintf(buf1, sizeof(buf1), "\tM%s: %s%s\tn", GET_NAME(ch), emote ? "<--- " : "", argument); ------ OMITTED -------- }

giving you a bright pink color for text.

I'm the one that people say, "How did you break this and what did you do to break it."
Last edit: 02 Feb 2014 17:30 by aredcloak19. Reason: added changing the code for adding Ansi colors.

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

Time to create page: 0.198 seconds