ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Print Color Codes

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Wad Editing
View previous topic :: View next topic  
Author Message
EarthQuake
Spamming!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Wed May 20, 2009 6:11 am    Post subject: Print Color Codes Reply with quote

Okay, so if you've ever messed around with color Print() statements in ACS, you've probably noticed that some colors don't work properly, or at all. Here's a run-down of using color codes in ZDaemon ACS:

Code:
Print(s:"The word \cgcolor\c- is red.");


Using the "\cX" escape sequence will make a print statement start using the color code specified by X to color the line from that point until the next line, or until another color code is used to change the color again.

Possible values of X are:

Code:
a = Pink
b = Tan
c = White (see note 1)
d = Green
e = Brown
f = Gold (see note 2)
g = Red
h = Blue
i = Orange
j = White (see note 1)
k = Yellow (see note 2)
l = "Clear" (see note 3)
m = "Black" (see note 4)
- = Revert color to default

No other codes work, as far as I know...


Note 1: There are two white values, C and J. From what I can tell, these are both the same color on-screen, but when viewed from the console, you'll notice that they are not the same white color used for the standard console font.

Note 2: On-screen, you can clearly tell the difference between these, but they are quite similar (although not the same) in the console. It might be hard to distinguish these colors in the console if used together.

Note 3: The code L clears the color translation so the font in-game will appear exactly how is in the actual sprites (as red), however, ZDaemon doesn't account for this in the console, and the font is displayed as solid black, which looks rather ugly, in my opinion.

Note 4: The code M is supposed to be black, but it displays on-screen as the normal default color (gold) and is solid black in the console as the previous code. The only possible use this has is to hide text in the console (as blank lines) when something is printed to screen. Provided the console background is solid black, you would not be able to see it at all.

So, with all that said, here's what the (useful) colors look like:



The colors appear lighter in the console, but the shades are pretty accurate otherwise.

Hope someone finds this useful.
Back to top
View user's profile Send private message Send e-mail
Ronald
Rontard


Joined: 17 Aug 2005
Location: Netherlands Clan: [QnB]

PostPosted: Wed May 20, 2009 1:48 pm    Post subject: Reply with quote

I never realised some of the colors didn't work properly, while I've been messing around with this function quite often. Just used the right colors all the time I guess. Laughing Thanks for the information and investigation. It is useful I guess. Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
pErf3ct _DaRk_
Spamming!


Joined: 07 Oct 2007
Location: France - Teh 21

PostPosted: Wed May 20, 2009 4:45 pm    Post subject: Reply with quote

I find it useful! As I'm using print in a recent wad I'm working on, I've notcied some colors didn't display correctly, thanks a lot Earthquake !
Back to top
View user's profile Send private message MSN Messenger
theDooMguy
Dominating!


Joined: 07 Feb 2009
Location: Installing ZDaemon on the school computers

PostPosted: Wed May 20, 2009 9:55 pm    Post subject: Reply with quote

I'm making a wad depending heavily on print as well. So far i'm mostly using white but this is good to know. Thanks.
Back to top
View user's profile Send private message
EarthQuake
Spamming!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Thu May 21, 2009 2:08 am    Post subject: Reply with quote

Also, something that Worst notified me of, is that printing player names is now possible (or always has). When you set up a Print() statement, you can use the "n:" type to print out a corresponding player's name. An example:

Code:
PrintBold(n:0, s:" pressed the switch everybody!");


Would print...

Code:
EarthQuake pressed the switch everybody!


The number 0 will return the activator of the script, but you should be able to substitute 0 for any player number. Seeing as the player numbers will change as players join or leave the server, it's not practical to use this to display other players' names specifically. However, it's plausible that you can use PlayerCount() to return the number of players, so you can display a random player name if you wish. This will not work in script types like OPEN, as the activator of those scripts is the "World".

Thanks for letting me know about this Worst. Smile
Back to top
View user's profile Send private message Send e-mail
EarthQuake
Spamming!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Thu May 21, 2009 2:17 am    Post subject: Reply with quote

Also, another bit of trickery you can use, is displaying one message for the activator of a script, and another message for everyone else. To do this, use a PrintBold() statement with your message to the whole server, and immediately after use a Print() statement that will display a message only to the activator and overwriting the previous PrintBold() statement.

Example:

Code:
PrintBold(s:"Hey everyone! ", n:0, s:" just opened a door!");
Print(s:"Hey, you just opened the door for everyone!");


Because of the behavior of Print/PrintBold, any subsequent messages will be overwritten if there is no delay between them. For the activator, if this method is used, the PrintBold message will still be displayed in the console, but will not be seen on-screen, except by other players. This can be used in a lot of different ways, so be sure to experiment with it. Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Wad Editing All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group