|
You last visited: Today at 19:28
Advertisement
Text Colors
Discussion on Text Colors within the CO2 Private Server forum part of the Conquer Online 2 category.
09/27/2010, 05:46
|
#1
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
Text Colors
Alright i've been trying to do this for a little bit but am not doing very well, here is what I got.
Code:
public static void SendMSG(string Name, string Colors, string Message, ushort ChatType, uint Mesh)
{
try
{
foreach (DictionaryEntry DE in H_Chars)
{
Character C = (Character)DE.Value;
C.MyClient.AddSend(Packets.ChatMessage(C.MyClient.MessageID, Name, "ALL", Message, ChatType, Mesh));
}
}
catch { }
}
Code:
static class Colors
{
public const uint
Black = 0x00000000,
White = 0x00FFFFFF,
Red = 0x00FF0000,
Blue = 0x0000FF00,
Green = 0x000000FF,
Yellow = 0x00FFFF00,
Pink = 0x00FF00FF,
Teal = 0x0000FFFF;
}
And here is a test command I made:
Code:
if (Cmd[0] == "/testmsg")
{
Game.World.SendMSG("GM", Colors.Red, "Test Test Test Test Test Test Test Test", 2011, 0);
}
But the message still comes out normal. Can you tell me what I'm doing wrong? Thank you.
|
|
|
09/27/2010, 06:25
|
#2
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,764
Received Thanks: 5,291
|
The hell?
uint Mesh is the color.
|
|
|
09/27/2010, 06:27
|
#3
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
You are not even writing the chat color to the packet...
ChatMessage = your packet. There is no field for chat color input. You will have to add one to write the 4bytes that holds the RGB color info at the correct offset in the packet (if you don't know the offset I suggest in your command you actually ask for an offset.
Eg:
/testchat 16711935 offset
then change your packet so 16711935 is the uint32 representation of color (FF00FF) and offset is where in the packet it's being written to. Shouldn't take long at all to find the correct offset.
<edit>
or as arco apparently said. Write the color value to the mesh offset.
|
|
|
09/27/2010, 07:05
|
#4
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
Quote:
Game.World.SendMsgToAll("GM", "Test Test Test Test Test Test Test Test", 2011, 0x00FF0000);
|
Didn't work, where can I get the colors?
|
|
|
09/27/2010, 07:11
|
#5
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,764
Received Thanks: 5,291
|
Then you're doing it wrong.
Is that even the right hex for a color o.O
|
|
|
09/27/2010, 07:13
|
#6
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
I couldn't have did it wrong, that's what I did right there ^^, just that command. Is anything wrong with it?
|
|
|
09/27/2010, 12:45
|
#7
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Quote:
Originally Posted by Аrco
Then you're doing it wrong.
Is that even the right hex for a color o.O
|
Conquer doesnt take a few set values, it takes a full argb value, of which any should be valid i beleive.
|
|
|
09/27/2010, 16:21
|
#8
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
Does anyone know how I can get the colors?
|
|
|
09/27/2010, 16:31
|
#9
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
Quote:
Originally Posted by peterpiper99
Does anyone know how I can get the colors?
|
They are hexidecimal
0-255 for red green and blue (0-ff). Use a html color chart or a rgb converter to get the rgb values for diff colors
|
|
|
09/27/2010, 16:48
|
#10
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
its 4 bytes
Code:
public static byte[] ChatMessage(uint MessageID, string From, string To, string Message, ushort Type, uint Mesh, [COLOR="Red"]System.Drawing.Color color[/COLOR])
{
byte[] Packet = new byte[8 + 34 + Message.Length + From.Length + To.Length];
COPacket P = new COPacket(Packet);
P.WriteUshortAddPos2((ushort)(Packet.Length - 8));
P.WriteUshortAddPos2((ushort)0x3ec);
[COLOR="Red"]P.WriteUintAddPos4((uint)color.ToArgb());[/COLOR]
Code:
public void LocalMessage(ushort Type, System.Drawing.Color _color, string Message)
{
SendPacket(Packets.ChatMessage(MessageID, "SYSTEM", MyChar.Name, Message, Type, MyChar.Mesh, _color));
}
GC.LocalMessage(2005, System.Drawing.Color.Red, "Test");
|
|
|
09/27/2010, 17:47
|
#11
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
Quote:
Originally Posted by pro4never
They are hexidecimal
0-255 for red green and blue (0-ff). Use a html color chart or a rgb converter to get the rgb values for diff colors
|
Can you give me an example?
|
|
|
09/27/2010, 22:10
|
#12
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,764
Received Thanks: 5,291
|
Quote:
Originally Posted by peterpiper99
Can you give me an example?
|
......
Quote:
Originally Posted by pro4never
Use a html color chart or a rgb converter to get the rgb values for diff colors
|
|
|
|
09/27/2010, 23:11
|
#13
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
I used tera's. But now I'm trying to do the /c command.
Quote:
if (Cmd[0] == "/c")
{
Game.World.SendMsgToAll(GC.MyChar.Name, ": " + Message.Remove(0, 3), 2011, 0);
}
|
But it uses the same packet.
Quote:
public static void SendMsgToAll(string Name, string Message, ushort ChatType, uint Mesh)
{
try
{
foreach (DictionaryEntry DE in H_Chars)
{
Character C = (Character)DE.Value;
C.MyClient.AddSend(Packets.ChatMessage(C.MyClient. MessageID, Name, "ALL", Message, ChatType, Mesh));
}
}
catch { }
}
|
Does anyone know how I could do this?
|
|
|
09/28/2010, 02:39
|
#14
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,764
Received Thanks: 5,291
|
By sending the correct mesh, as I see you are setting the mesh as 0.
|
|
|
09/28/2010, 04:53
|
#15
|
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
|
Quote:
Originally Posted by Аrco
By sending the correct mesh, as I see you are setting the mesh as 0.
|
I don't understand that. What's an example of numbers, how many numbers?
|
|
|
|
|
Similar Threads
|
2Moons New Colors
06/23/2011 - Dekaron - 7 Replies
Theres been typing things where u can change your FONT color to diff colors from typing codes in either guild chat or announcement, and the guild name color can be changed, does anyone know how?
Thanks.
|
colors
01/05/2010 - S4 League - 0 Replies
I wonder like change the colors of the weapons, but that other players be are able to see.
|
Colors
01/05/2010 - S4 League - 1 Replies
I wonder like change the colors of the weapons, but that other players be are able to see.
|
text colors
05/10/2007 - Conquer Online 2 - 5 Replies
i was dwelling in my co folder but i dont understand alt codes too well to handle a file that could be what im looking for, was wondering if you could change the text color to something darker since all they have it light colors and sometimes they are hard to read.
if anyone will look into this the file i found was in the "ini" folder in the co2 folder called TxtColor. so far i still go no where even tho i changed some stuff in the file a bit. lol
|
Ground Colors
12/28/2006 - Conquer Online 2 - 6 Replies
is there any way to modify the colors of the ground texture files? maybe turn the sand blue?
The desert maps (both the DC map and the sandy part of MZ) hurt to look at for long, makes running quests and hunting difficult.
|
All times are GMT +1. The time now is 19:28.
|
|