About translations...
					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.
	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.
- 
				Masterminded666
About translations...
I want to create some gray demons but i cant understand the createtranslation parameters. Need an explanation please...
			
			
									
						
										
						- Nanami
- Posts: 1066
- Joined: Tue Jul 15, 2003 5:13 pm
- Location: That little island pritch created.
- Contact:
Use this:
Give your demons a tid of 1.
			
			
									
						
										
						Code: Select all
CreateTranslation(1,16:47=80:111);
Thing_SetTranslation(666,1);
- Nanami
- Posts: 1066
- Joined: Tue Jul 15, 2003 5:13 pm
- Location: That little island pritch created.
- Contact:
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
			
			
									
						
										
						http://zdoom.org/files/examples/translation-tud.zip
- 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:
666, not 1.Nanami wrote:Use this:Give your demons a tid of 1.Code: Select all
CreateTranslation(1,16:47=80:111); Thing_SetTranslation(666,1);
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
Re: About translations...
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.Masterminded666 wrote:I want to create some gray demons but i cant understand the createtranslation parameters. Need an explanation please...
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);Code: Select all
CreateTranslation (9, 16:31=96:111);Code: Select all
Thing_SetTranslation (tag, 9);should be noted that you can also remap palette numbers to rgb values so like:
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:
are invalid
also you can have an unlimited (? I'm sure there's an upper limit, but I dunno) # of translations within so like:
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 :) )
			
			
									
						
										
						Code: Select all
CreateTranslation(1, 16:47=[0, 0, 128]:[0, 0, 255]); 
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); 
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); 
- Nanami
- Posts: 1066
- Joined: Tue Jul 15, 2003 5:13 pm
- Location: That little island pritch created.
- Contact:
Oops. I copied and pasted that from my wad and thought I changed all the numbers.deathz0r wrote:666, not 1.Nanami wrote:Use this:Give your demons a tid of 1.Code: Select all
CreateTranslation(1,16:47=80:111); Thing_SetTranslation(666,1);
Oh and Cyb, I'm not sure of the limit on translations but I managed to get nine on a lost soul yesterday.
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone






