About translations...

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
Masterminded666

About translations...

Post by Masterminded666 »

I want to create some gray demons but i cant understand the createtranslation parameters. Need an explanation please...
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

Use this:

Code: Select all

CreateTranslation(1,16:47=80:111);
Thing_SetTranslation(666,1);
Give your demons a tid of 1.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Now what are those numbers for?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

they're Doom pallette entries.
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

They're changing a range of colors to another range of colors. For more information try this:

http://zdoom.org/files/examples/translation-tud.zip
User avatar
deathz0r
Posts: 353
Joined: Tue Jul 15, 2003 4:09 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Land with them kangaroo
Contact:

Post by deathz0r »

Nanami wrote:Use this:

Code: Select all

CreateTranslation(1,16:47=80:111);
Thing_SetTranslation(666,1);
Give your demons a tid of 1.
666, not 1.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Re: About translations...

Post by The Ultimate DooMer »

Masterminded666 wrote:I want to create some gray demons but i cant understand the createtranslation parameters. Need an explanation please...
If you've ever opened up a DooM bitmap in Paint Shop Pro (or equivalent) and looked at the palette, you'll see 16 rows of 16 coloured squares. Each square is numbered, these are the numbers you see in the CreateTranslation special. Notice how all squares of a certain colour (various shades) are grouped together in a line, this is a palette range.

What the translation does is it changes one range of colours into another. If you look at my translation example (link given earlier) each translation replaces the standard green colour (112:127) with another colour, producing 22 different coloured marines. For demons, you need to replace the pink colour (16:31) instead of the green colour. All of the ranges are shown in the example wad, so you can just copy-and-paste them from there.

Replace:

Code: Select all

CreateTranslation (9, 112:127=96:111);
with:

Code: Select all

CreateTranslation (9, 16:31=96:111);
and use:

Code: Select all

Thing_SetTranslation (tag, 9);
to turn the demons grey.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

should be noted that you can also remap palette numbers to rgb values so like:

Code: Select all

CreateTranslation(1, 16:47=[0, 0, 128]:[0, 0, 255]); 
translates the pinkish colors used for demons into a blue range. makes it easier for ranges that are really small on the palette like a yellow or black range

you can't however do the opposite and assign rgb values to something (pal or other rgb values) so:

Code: Select all

CreateTranslation(1, [64, 0, 0]:[192, 0, 0]=[0, 0, 128]:[0, 0, 255]); 
CreateTranslation(1, [64, 0, 0]:[192, 0, 0]=112:127); 
are invalid

also you can have an unlimited (? I'm sure there's an upper limit, but I dunno) # of translations within so like:

Code: Select all

CreateTranslation(1, 16:47=[0, 0, 128]:[0, 0, 255], 112:127=16:47, 0:15=192:256); 
it's all documented in the translations example (or it was in the old one, I haven't actually looked at the new one but I'm sure TUD left all the comments etc :) )
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

deathz0r wrote:
Nanami wrote:Use this:

Code: Select all

CreateTranslation(1,16:47=80:111);
Thing_SetTranslation(666,1);
Give your demons a tid of 1.
666, not 1.
Oops. I copied and pasted that from my wad and thought I changed all the numbers.

Oh and Cyb, I'm not sure of the limit on translations but I managed to get nine on a lost soul yesterday.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

well I'm sure if there is a limit it's more like 255 or 65536 :P
User avatar
bimshwel
Posts: 745
Joined: Tue Jul 15, 2003 5:15 pm
Preferred Pronouns: It/Its
Operating System Version (Optional): windows 7 still
Graphics Processor: nVidia (Modern GZDoom)
Location: misplaced
Contact:

Post by bimshwel »

If none of these work, there's always Babelfish...
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

Cyb wrote:well I'm sure if there is a limit it's more like 255 or 65536 :P
You can have 31 CreateTranslations in each map. (but of course you can have plenty of ranges remapped in each one)


And yes, I did leave all the comments in the example wad. (with some of my own, too)
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

Yeah, we meant we didn't know the limit on altered ranges per translation.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

I don't know then. I've got 8 in a couple of mine, but I suppose 255 would be the theoretical limit. (remapping all palette entries)
Locked

Return to “Editing (Archive)”