More text colors

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby take_this_cup_of_poison » Sun Nov 02, 2008 3:37 am

Good Job!
See. Isn't it kinda fun :). It's almost like scripting.

Could you post your changes here so we don't loose them.

(What isn't fun is texturing a uvmap... everything distorts).
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby terencehill » Sun Nov 02, 2008 6:42 pm

I'm implementing this system so that it's fully compatible with standard Quake colors. And also to be mnemonic, once u memorize the numbers of the 10 main colors.

The limit of 90 colors is a bad thing (there are some stupid things in the rest of the code, maybe they can be fixed easily, otherwise could be 100). I know it's better a system with millions of colors, but on the other hand this is less mnemonic (not a huge problem btw).

A system with ^x^x^x can be still implemented expanding my system with the same concept to give a max of 1000 colors, keeping the 90 existing ones.

Watch the (final?) result with all colors I did in this page: http://sites.google.com/site/terencehill/

PS: I did my best chosing colors... they can't be millions neither 256 (with 256, at least all main kind of colors are covered)
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Sun Nov 02, 2008 7:18 pm

This system does break with some Nexuiz code, e.g. print("^7Some message ^3", playername, "^7 something else"); would seemingly randomly recolor the name if it starts with a color code.

So I am not really sure if I should apply it. Sure, THIS SPECIFIC code can be replaced by

print("^7Some message^3 ", playername, "^7 something else");

but all such instances in the code have to be found and fixed then. And that will take quite some time.
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 » Mon Nov 03, 2008 4:27 pm

I've encountered a little problem that fucked all up. I wanted to keep color compatibility with less loss of color information, but it's impossible due to ^0^7 and ^7^0: in theory the first should be white, the second black. In practice, considering the existing code, to make work all stuffs, they have to be both white. And ^7^0 can't be white but only black (^7^0 should be equal to ^0). End of the story.
Watch this screenshot to see what's wrong:
http://sites.google.com/site/terencehill/Nexuiz/problem%20with%20colors.jpg

The definitive solution compatible with the actual system can be this one:
Nexuiz could decode only ^x or ^x^x^x, while ^y^x is intended as ^x.
In this way we can introduce 1000 colors without any kind of problem with existing code. Indeed the problem is ^x^x but not ^x^x^x.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Mon Nov 03, 2008 10:49 pm

terencehill wrote:I've encountered a little problem that fucked all up. I wanted to keep color compatibility with less loss of color information, but it's impossible due to ^0^7 and ^7^0: in theory the first should be white, the second black. In practice, considering the existing code, to make work all stuffs, they have to be both white. And ^7^0 can't be white but only black (^7^0 should be equal to ^0). End of the story.
Watch this screenshot to see what's wrong:
http://sites.google.com/site/terencehill/Nexuiz/problem%20with%20colors.jpg


What's wrong here?
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby Alien » Tue Nov 04, 2008 6:10 am

Anyway, if your problem is this: ^7say meh, this won't work cause say command will be misintepreted. Use this say ^7meh. Same goes for say ^7^0 black text, say ^0^7 white text.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby terencehill » Tue Nov 04, 2008 2:27 pm

Alien wrote:Anyway, if your problem is this: ^7say meh, this won't work cause say command will be misintepreted. Use this say ^7meh. Same goes for say ^7^0 black text, say ^0^7 white text.


The problem is that in "^7say meh" I can't remove neither modify that ^7 coz atm I can't understand how all the things work and I'm not capable of doing it.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Tue Nov 04, 2008 2:42 pm

You can't use ^7say meh (and you don't to modify anything), but you can use say ^0^7meh/ say ^7^0meh (which both work). IIRC, You wanted to make chat more colourful and not to change the colour of console commands.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby terencehill » Tue Nov 04, 2008 4:39 pm

Alien wrote:You can't use ^7say meh (and you don't to modify anything), but you can use say ^0^7meh/ say ^7^0meh (which both work). IIRC, You wanted to make chat more colourful and not to change the colour of console commands.


I explain better:
1. I can't modify or remove anything before say and in general at the beginning of a string!
2.
a) ^0 and ^7 MUST be black and white, they are main colors.
b) To make work all things in console ^0^7 and ^7^0 MUST be both white.
c) ^0^7 MUST be equal to ^7 and ^7^0 MUST be equal to ^0 to be compatible.
Deadlock.
Therefore I can do nothing.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Tue Nov 04, 2008 8:26 pm

This basically means that approach does not work, but it does not rule out any other approach.

Basically, you must add at least one more escape sequence, and can't just work with the existing sequences.

For example, ^x, after which three hex digits would follow, e.g. ^xF00 = red.

Then all functions that decolorize (look for '^' and STRING_COLOR_TAG in the engine source) need to be altered to support that notation too.

If you get that done in the engine, I'll do the remaining step of making the Nexuiz menu code support it too.
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

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron