Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: don_tomaso on Fri 18/03/2005 23:41:12

Title: colour tint AND light level !!?
Post by: don_tomaso on Fri 18/03/2005 23:41:12
a quick question:

is it possible to adjust both the colour tinting and the light level in the same room?  cause in the regioneditor you have to choose between one of them
Title: Re: colour tint AND light level !!?
Post by: Goot on Sat 19/03/2005 19:41:52
Yeah, I think you can only have one at a time. I think it's probably too hard to implement both at the same time, it would just be a whole lot more complicated to program. You can, however, change between having a light level and color tint using SetAreaLightLevel and SetRegionTint.
Title: Re: colour tint AND light level !!?
Post by: NiksterG on Sun 20/03/2005 00:27:14
I'm not an expert or anything (actually, more of a beginner), but maybe you can use one region to change light shade, and then another right on top for color change. (Try ths at your game's risk... It might not work. ::))
Title: Re: colour tint AND light level !!?
Post by: ZayanM on Sun 20/03/2005 05:23:33
Sounds reasonable, but you can only have region in an area. You can have regions over other areas though.  :)
Title: Re: colour tint AND light level !!?
Post by: GarageGothic on Mon 21/03/2005 11:52:34
Um, posting without knowing eactly what you're trying to do - couldn't you just tint him a darker shade of the same color? And set all three RGB values to the same number to tint him different shades of gray, thus darkening him without actually changing the color?
Title: Re: colour tint AND light level !!?
Post by: don_tomaso on Mon 21/03/2005 18:31:49
Im having a room where the lightning colour is red, and sometimes blue, and in some areas its very bright, and in some it's very dark, so basicly I want to change the color and the brightness at the same time..
um but I do not quite understand what you mean
Title: Re: colour tint AND light level !!?
Post by: Proskrito on Mon 21/03/2005 21:58:09
i think he means that you can tint, for example, with values like 0,0,20 , and it would tint it with dark blue, or you could use 235,235,255 , and it would tint with light blue. In both cases it would be blue, but one lighter than the other, making the light level unnecessary (sp?)
the higher the number, the lighter the colour, and if you mantain the relationship between r,g and b values, the colour would be similar.
If im not right, im sure someone will know how this works and tell us : )
Title: Re: colour tint AND light level !!?
Post by: don_tomaso on Wed 23/03/2005 17:32:04
hm well that only seems to change the intensity of the colours, not the brightness/darkness ..  so the character only looks more coloured, not brighter/darker
Title: Re: colour tint AND light level !!?
Post by: Proskrito on Thu 24/03/2005 11:24:54
well, you are right, that wasnt the best example, because you would need to add more green to get a light blue : ) . sorry, as i said i wasnt totally sure about that. but the point is the same, you can get the same colour with different brightness by changing RGB values. The easiest way that i can think of would be to pick the colours you want in some paint program, for example, a light blue and a dark blue that you like (or, if you want the same blue, pick one and change its brightness up and down) , and write down their RGB values, and use them in AGS.
That might work (i hope so : ) )
Title: Re: colour tint AND light level !!?
Post by: don_tomaso on Thu 24/03/2005 19:45:17
:) alright thanx, Ill check it out
Title: Re: colour tint AND light level !!?
Post by: GarageGothic on Sat 26/03/2005 19:21:31
Um, it turns out it didn't quite work as I expected. Apparently there's no such thing as luminance for region tinting. However, you can cheat and use another command called SetAmbientTint (or similar, I don't have AGS here). You could either have a "stand on region" trigger for it, or better yet, check the regions in the room's repeatedly_execute_always, so it would also work during blocking events.

Of course this applies to all characters and objects on the screen, so you'd have to check "ignore room lighting" on them, and they wouldn't be able to move through the "tinted" regions.
Title: Re: colour tint AND light level !!?
Post by: Khris on Thu 31/03/2005 07:55:11
You have to make a seperate region for each combination of color tint and light level.
I made a quick example with: dark, dark & blue, blue
Unfortunately, when I tried the same with light & blue, the result wasn't too convincing.

Here's (http://home.arcor.de/choala/ags/try.zip) the 'game', including a crappy char :)
Title: Re: colour tint AND light level !!?
Post by: Samwise on Sun 08/04/2007 10:38:53
I see this topic is two years old - is it still not possible to use colour tint & light level at the same time?

I've tried to do that, but no luck yet.

The thing is, I want all the characters (or at least my main character) to become 10% lighter and -15% bluer, without having to import hundreds of sprites again.  Is it possible to achieve that way or another?


Title: Re: colour tint AND light level !!?
Post by: Ashen on Sun 08/04/2007 11:21:17
Take a look at GG's post a few up, and at Character.Tint (http://www.adventuregamestudio.co.uk/manual/Character.Tint.htm). Using that in rep_ex(_always) you should be able to adjust the tint AND brightness of a character while they're on a given Region. It shouldn't be too much harder to make it apply to all characters (e.g. use a while loop to check them all).

There's still no way to do it directly in the editor, though.
Title: Re: colour tint AND light level !!?
Post by: Samwise on Sun 08/04/2007 12:29:55
Thank you, this is a great feature I wasn't aware of.  I'll try it out.

EDIT:
Well, I applied the tint thing to my main character in the global script.  It works fine, but when I run the game it seems that the light level I previously applied in the regions isn't working anymore (i. e. no shadows/lights).
Title: Re: colour tint AND light level !!?
Post by: Ashen on Sun 08/04/2007 13:05:42
I think that's normal behaviour for this and SetAmbientTint.
Title: Re: colour tint AND light level !!?
Post by: Samwise on Sun 08/04/2007 13:17:20
So basically, you can't use shadows and tint for the same character, right?

The thing is, I'm trying to make the character less red, and a little brighter, at the same time.

cOser.Tint(85, 100, 100, 22, 110);  won't work, because for some reason the luminance can't be more than 100.

Is there any way to "trick" the system to do that?
Title: Re: colour tint AND light level !!?
Post by: Scorpiorus on Mon 09/04/2007 16:45:14
I believe you cannot only make it less red with the Character.Tint() function. What it does, is saturating sprite colours towards a specified colour, i.e. it re-colourizes colours to shades of the specified colour (with 100 in saturation it will completely re-colourize them). So it affects all channels, not just the red one.

I would suggest making a GUI with five sliders for R, G, B, Saturation and Luminance. Then make a script to change character colours according to slider values and then run the game and try to pick out the values that suit best for the look you want.
Title: Re: colour tint AND light level !!?
Post by: Samwise on Tue 10/04/2007 06:39:03
I see.  I guess it's the best that can be done.