Author Topic: How do you manipulate FXTINT?  (Read 4993 times)

Sin Stalker

  • Boss
  • ****
  • Posts: 179
How do you manipulate FXTINT?
« on: March 10, 2013, 08:30:42 AM »
I'm trying to make electric armor blue. The type of blue as the default electric blaster. Can anyone give me a short instruction on how the FXTINT works and maybe a starting point to help me narrow down how to get it?

Samuraiko

  • Honorary Paragon Dev and
  • Elite Boss
  • *****
  • Posts: 350
  • EVERYONE LOOK AWESOME - I'M FILMING!
    • The Wandering Crane
Re: How do you manipulate FXTINT?
« Reply #1 on: March 11, 2013, 02:57:12 AM »
0   1910 FXTINT -16777037 -16777216

This is a color sample from my pain/energy corruptor. Her primary color was red, backset was black, IIRC. I'm trying to figure out the conversion from whatever this is to RGB, because when I just check the numbers, it doesn't come out right.

Michelle
aka
Samuraiko/Dark_Respite
The game may be gone, but the videos are still here...
http://www.youtube.com/samuraiko
http://cohtube.blogspot.com

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #2 on: March 11, 2013, 04:16:32 AM »
Yeah, seems that no matter what I change the numbers to, the electricity comes out white.

Its too bad no one has been able to figure out and make a fx tint converter.

The Fifth Horseman

  • Elite Boss
  • *****
  • Posts: 961
  • Outside known realities.
Re: How do you manipulate FXTINT?
« Reply #3 on: March 11, 2013, 04:52:09 PM »
Its too bad no one has been able to figure out and make a fx tint converter.
More likely because it's so elementary to us computer geeks that we fail to realise anyone might have a problem with it. Here's the C code - after compiling the program and running it, just type in the RGB value to convert.
Code: (C) [Select]
#include <stdio.h>
int main()
{
int i;
scanf("%X", &i);
i=((i&0x000000FF)<<16)+((i&0x00FF0000)>>16)+(i&0x0000FF00)|0xFF000000;
printf("%d\n", i);
return 0;
}
0   1910 FXTINT -16777037 -16777216

This is a color sample from my pain/energy corruptor. Her primary color was red, backset was black, IIRC. I'm trying to figure out the conversion from whatever this is to RGB, because when I just check the numbers, it doesn't come out right.
The values are stored in the lower three bytes of 32-bit signed integers. The demo commands store them as integers rather than hex strings.
-16777037 = 0xFF0000B3
-16777216 = 0xFF000000
Note that this appears to be in BGR order rather than RGB.
To convert from these values to RGB, you can either use a very simple program in C or use a calculator.
Code: (C) [Select]
#include <stdio.h>
int main()
{
int i;
scanf("%d", &i);
i=((i&0x000000FF)<<16)|((i&0x00FF0000)>>16)|(i&0x0000FF00);
printf("%06X\n", i);
return 0;
}

There are some roundabout ways of doing it with a calculator app (or an actual calculator). The simplest one is to use Windows' calculator app with its' scientific view:
1. Input the number (with sign) when the calculator is in decimal mode.
2. Switch to hexadecimal mode.
3. Done.

A more roundabout way:
  • Add -16777216 to the number.
  • For each of the three bytes you want to extract:
    • M+ the result.
    • Calculate modulo (MOD) 256 of the number you have (in other words, the remainder of division of the number by 256).
      The integral part of this number is the decimal value for one byte of the number. (fractions do not matter here)
    • CE and MR.
    • Divide the number by 256.
  • Now you have the decimal values of the R G and B channels, extracted in that specific order.
  • To convert the decimal value to its' hex equivalent:
    • Compute modulo 16 of the number. This is the decimal value of your lower hex digit.
    • Divide the number by 16 and ignore fractions. This is the decimal value of your upper hex digit.
      • 0-9 in decimal equal same hex digit
      • 10 equals A
      • 11 equals B
      • 12 equals C
      • 13 equals D
      • 14 equals E
      • 15 equals F
  • Write down the hex notation determined in the last step. This is the RGB value for your power color.

We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: How do you manipulate FXTINT?
« Reply #4 on: March 11, 2013, 07:24:57 PM »
Note that this appears to be in BGR order rather than RGB.

Taking a guess, it's likely parsed as an integer and then fed to something like glColor4ubv or glColorPointer as-is. Since x86 is a little-endian architecture, the 32-bit integer -16777037 (0xFF0000B3) will be stored in memory with the low byte first as:

Code: [Select]
B3 00 00 FF
If re-cast as an array of unsigned char[4] and passed to an OpenGL function, then it would be in the customary RGBA order.

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #5 on: March 15, 2013, 06:24:59 AM »
More likely because it's so elementary to us computer geeks that we fail to realise anyone might have a problem with it. Here's the C code - after compiling the program and running it, just type in the RGB value to convert.
Code: (C) [Select]
#include <stdio.h>
int main()
{
int i;
scanf("%X", &i);
i=((i&0x000000FF)<<16)+((i&0x00FF0000)>>16)+(i&0x0000FF00)|0xFF000000;
printf("%d\n", i);
return 0;
}
The values are stored in the lower three bytes of 32-bit signed integers. The demo commands store them as integers rather than hex strings.
-16777037 = 0xFF0000B3
-16777216 = 0xFF000000
Note that this appears to be in BGR order rather than RGB.
To convert from these values to RGB, you can either use a very simple program in C or use a calculator.
Code: (C) [Select]
#include <stdio.h>
int main()
{
int i;
scanf("%d", &i);
i=((i&0x000000FF)<<16)|((i&0x00FF0000)>>16)|(i&0x0000FF00);
printf("%06X\n", i);
return 0;
}


Run code? Sorry, I'm not that computer skilled. How do I do this?

The Fifth Horseman

  • Elite Boss
  • *****
  • Posts: 961
  • Outside known realities.
Re: How do you manipulate FXTINT?
« Reply #6 on: March 17, 2013, 09:31:01 AM »
Run code? Sorry, I'm not that computer skilled. How do I do this?
*sigh*
This should be more up to your speed.
https://www.dropbox.com/s/dtaltzdq6prd4ad/FiXTINT.zip
We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #7 on: March 17, 2013, 06:42:59 PM »
Thank you. I downloaded it and extracted the files. However now I have a folder (and 3 sub folders) with files I have no idea how to run. lol

Not sure what to google or if there is some readme file I am missing?

Arachnion

  • Elite Boss
  • *****
  • Posts: 642
  • Professional Cynic
Re: How do you manipulate FXTINT?
« Reply #8 on: March 17, 2013, 09:41:05 PM »
Thank you. I downloaded it and extracted the files. However now I have a folder (and 3 sub folders) with files I have no idea how to run. lol

Not sure what to google or if there is some readme file I am missing?

I just downloaded it and there's an exe file in there.

Run that.

 ;D
I'm all dressed up with nowhere to go
Walkin' with a dead man over my shoulder

Waiting for an invitation to arrive
Goin' to a party where no one's still alive

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #9 on: March 18, 2013, 06:35:44 AM »
I just downloaded it and there's an exe file in there.

Run that.

 ;D

Weird. I don't have an exe file. I'll try downloading it again.

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #10 on: March 18, 2013, 07:02:22 AM »
Sweet. Got it. Thank you!

therain93

  • Elite Boss
  • *****
  • Posts: 574
Re: How do you manipulate FXTINT?
« Reply #11 on: March 18, 2013, 12:39:28 PM »
So, could you theoretically select any hue beyond the ones we had available to choose from in the GUI, assuming you input it in the correct format, or is there a limitation in the renderer as well?
@Texarkana - March 5, 2004 - December 1, 2012 -- Imageshack |-| Youtube
---------------------------------------------------------------------------------------

You don't know what it's like.... |-| Book One. Chapter one...

Sin Stalker

  • Boss
  • ****
  • Posts: 179
Re: How do you manipulate FXTINT?
« Reply #12 on: March 18, 2013, 08:44:09 PM »
I used this to find the RGB number.

http://www.rapidtables.com/web/color/RGB_Color.htm


So I think you can pick colors or shades that weren't accessible before but I don't know for sure.

TimtheEnchanter

  • Elite Boss
  • *****
  • Posts: 1,466
  • There are some who call me... Tim?
Re: How do you manipulate FXTINT?
« Reply #13 on: March 18, 2013, 11:59:13 PM »
Never could understand why FXTINT uses this bizarre system of numbers while the costume colors use normal hexidecimal.

The Fifth Horseman

  • Elite Boss
  • *****
  • Posts: 961
  • Outside known realities.
Re: How do you manipulate FXTINT?
« Reply #14 on: March 19, 2013, 08:19:23 AM »
Most likely someone messed up a numeric format specifier on release and it was retained for backwards compatibility.

Thank you. I downloaded it and extracted the files. However now I have a folder (and 3 sub folders) with files I have no idea how to run. lol
You only need the .exe file directly in the archive itself. The subdirectories contain the application source.

So, could you theoretically select any hue beyond the ones we had available to choose from in the GUI, assuming you input it in the correct format, or is there a limitation in the renderer as well?
Uncertain. Try and see what you get?
We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.