More text colors

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby Alien » Wed Nov 05, 2008 1:56 pm

terencehill wrote:b) To make work all things in console ^0^7 and ^7^0 MUST be both white.

Why? If some function uses ^7^0 for white output, than this function is wrong.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby terencehill » Wed Nov 05, 2008 3:20 pm

Alien wrote:
terencehill wrote:b) To make work all things in console ^0^7 and ^7^0 MUST be both white.

Why? If some function uses ^7^0 for white output, than this function is wrong.


Alien, u can notice some problems until u modify the code. I don't know the exact reason of this behaviour, but if the things work on this way, one reason should be!!!

Btw... good news :)
I have solved the problem: now when the algorithm find ^x^0 or ^7^y it just ignores the x and the y so they become ^0 and ^y. Now the new colors are only 81 instead of 90. But I can now expand this system (keeping these 81 colors) and add other 1000 colors (unless of other problems) with the system ^x^y^z :wink:

screenshot here: http://sites.google.com/site/terencehill/Nexuiz

Now there is another thing to do (damn!): change the algorithm to generate new colors also in the player name setup in the GUI. I've searched in the code and I couldn't find it :(
Div can u tell me pls where I should put my hands?

PS: ROFL this seems just a blog of what I am doing... maybe I shouldn't discuss these things here... Should I send u PMs instead, div?
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Wed Nov 05, 2008 3:43 pm

I still am not convinced this is the way to go. Taking one message of many:

nexuiz-trunk/data/qcsrc/server/clientcommands.qc: bprint ("^4", self.netname, "^4 is playing now\n");

Now if the player sets ^4^2foo^4^2 as name, it will be interpreted as the color codes ^4^4^2 and ^4^2^4. The "is playing now" text would appear as another color.

This is why I really dislike this solution of adding more colors, and would be in favor of adding more codes in a more "normal" way, like another initial sequence (e.g. ^xF00 for red, x standing for "hex", or simply adding ^a to ^z, ^A to ^Z, etc.).

Anyway, the part you are looking for is in item/inputbox.c, the if(me.editColorCodes) block.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Wed Nov 05, 2008 5:49 pm

divVerent wrote:I still am not convinced this is the way to go. Taking one message of many:

nexuiz-trunk/data/qcsrc/server/clientcommands.qc: bprint ("^4", self.netname, "^4 is playing now\n");

Now if the player sets ^4^2foo^4^2 as name, it will be interpreted as the color codes ^4^4^2 and ^4^2^4. The "is playing now" text would appear as another color.


1. Yes u r right. I already guessed but i've forgot this thing. Indeed I should implement or the system ^x^x or ^x^x^x but not together.

2.
    a) Using the algorithm I've already implemented (based on ^x^y) each ^x^y^z is considered as ^y^z, therefore ^4^4^2foo is ^4^2foo. ok.

    b) Names that ends with ^x may interfer with the remaining string only if the remaining string is like "^4 is plying now" (the space is after the ^4). They can be changed to put space before ^4, if they r written in this way.
    If it happens the color is modified to a similar color.
    e.g. name: "foo^3" message: "foo^3^4 is playing now"
    "is playing now" is shown in another kind of blue instead of blue.
    However if a player intentionally appends ^x (with x different from 7) to his name, maybe he wants to make a little hack, he changes a bit the following string, not a serious thing :)
    Nexuiz adds a ^7 sometimes to the remaining string, and this is not problem since ^x^7 is considered as ^7

divVerent wrote:... would be in favor of adding more codes in a more "normal" way, like another initial sequence (e.g. ^xF00 for red, x standing for "hex", or simply adding ^a to ^z, ^A to ^Z, etc.).

1. This system is not backward compatible (not very important thing).
2. atm I am capable to do only eaasy things in C. I have modified a bit the algorithm flow, and added the new colors. I try to understand if i can do it or not.
3. we can still implement the system u r talking in a second time, even using it together with my system (or also deleting it).

So, considering all, if u agree, we can use this system unless me or any other programmer will do your better system. Obviously, before applying the changes, u have to see if the result is good for u.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Wed Nov 05, 2008 8:28 pm

Well, what I mean is that I doubt LordHavoc would want such a system in his engine that has unintended side effects in about every existing Quake mod.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Wed Nov 05, 2008 9:23 pm

ok. I've understood it. I can throw my system away then.

I try to see if I can implement your system.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Thu Nov 06, 2008 6:44 am

Well, it does not have to be the ^xRGB system. I already proposed a simpler system, with ^a to ^o using the player colors (and maybe putting extra colors on the remaining letters). In the engine source, you find that palette in the palette_rgb_pantsscoreboard array, and in the menu QC source, you find it in the function colormapPaletteColor(). That won't need MANY code changes, basically you just have to include the range ^a to ^o in every occasion where STRING_COLOR_TAG or maybe '^' is used and the next char compared to the 0..9 range.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Thu Nov 06, 2008 5:50 pm

I had already started to implement the system ^xRGB, so now I'm very very sorry to tell u that I've just implemented it :D

Well, it does not have to be the ^xRGB system. I already proposed a simpler system, with ^a to ^o using the player colors (and maybe putting extra colors on the remaining letters). In the engine source, you find that palette in the palette_rgb_pantsscoreboard array, and in the menu QC source, you find it in the function colormapPaletteColor(). That won't need MANY code changes, basically you just have to include the range ^a to ^o in every occasion where STRING_COLOR_TAG or maybe '^' is used and the next char compared to the 0..9 range.


Maybe i try to do this thing too
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Fri Nov 07, 2008 6:42 am

Well, if your ^xRGB is working, it's perfect.

I just suggested the simpler one in case it is easier for you.,
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Tue Nov 11, 2008 3:48 pm

^a to ^o using the player colors


I was thinkin to implement instead of that (that now with ^hrgb is useless) a unique tag ^p that before a string gives the same color of the skin (shirt or pants). So if u put ^p before your name, your name will have always the same color of your skin.

Is it a good idea?
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron