Welcome to the Builder Academy

Question Showing "Sanctuary" as a different color....

More
07 Feb 2016 06:18 #5579 by Valkin
This is probably ridiculously simple and I am just overlooking something.

I am trying to get the "...$e glows with a bright light!" effect from the Sanctuary spell to show as a different color. How do I go about doing this? I have been playing with act.informative.c and have thus far had no luck.

Thanks in advance!

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

More
07 Feb 2016 14:46 #5581 by rudeboyrave
just find where it is in your code and add a colorcode.

Do a grep in your src directory.
Code:
grep -l "glows with a bright light" *.c

it will show you that the string is located in act.informative.c

edit the file, find the location of the code you need. In stock tba its around line 337 and add a colorcode. you can find in-game colorcodes with "help colorcodes" in game.

here is the code from act.informative.c unchanged.

Code:
if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("...$e glows with a bright light!", FALSE, i, 0, ch, TO_VICT);


Change it to something like this:
Notice the @W and @n below. this is to start a bright white and then terminate it at the end of the string.

Code:
if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("@W...$e glows with a bright light!@n", FALSE, i, 0, ch, TO_VICT);

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
The following user(s) said Thank You: Valkin

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

More
07 Feb 2016 17:35 - 07 Feb 2016 17:36 #5582 by Valkin
Thanks for taking the time to reply, I appreciate it!

I did try that already, it doesn't work - it just displays the output as a string complete with the @ characters.... so it literally says "@W...$e glows with a bright light!@n" under the mobs.

I tried F codes as well, those do the same thing. I'm on the latest TBA, 3.67 if that matters.
Last edit: 07 Feb 2016 17:36 by Valkin.
The following user(s) said Thank You: rudeboyrave

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

More
07 Feb 2016 18:22 - 07 Feb 2016 18:36 #5583 by rudeboyrave
this will work. use \tW for the color and \tn to turn of the color


Code:
if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("\tW...$e glows with a bright light!\tn", FALSE, i, 0, ch, TO_VICT); }

we can also use f codes for 255 colors like this (from show colour in game)
Code:
if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("\t[f505]...$e glows with a bright light!\tn", FALSE, i, 0, ch, TO_VICT);

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
Last edit: 07 Feb 2016 18:36 by rudeboyrave.
The following user(s) said Thank You: Valkin

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

More
07 Feb 2016 19:17 #5584 by Valkin
That worked - thank you!!

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

Time to create page: 0.187 seconds