View Single Post
Old 11-19-09, 08:51 AM   #141
The Old Man
Join Date: Mar 2009
Location: Bucharest, Romania
Posts: 1,403
Downloads: 151
Uploads: 0

Default I just found something

Strange, this is the first time a quirk of SH4's interface has turned into a perk . There was no point in starting a new thread for this info, but it should help pretty much any interface modder that has to create marking lines. I have not tested this in SH3 and would appreciate if anybody (I'm looking at you Makman ) tests this.

As you all know the periscope marking lines are hardcoded to light up at night. How? Apparently, EVERY item in the Marking lines group has this feature, even the ones that you add. In SH4, it looks like this...

[G26 IXXX]
Name=Marking lines
Type=1026;Menu group

Then come a few text items (not important, actually i moved them offscreen)... I just added my item after them (if your Pos and Zone are the same, then yes, the marks will remain centered on the screen in SH4):

[G26 I278]
Name=Karamazov Periscope Marks ;new item
Type=1030;Static bmp
Zone= 0 0 1024 768 1 1 0x26060000 0.5 -0.5 0x260EF005 -0.5 0.5 0 0
Mat 0=data/menu/Karamazov/AP_Marks2.tga
Crop 0=0,0,1,1

That image, AP_Marks2.tga is a simple image file with a black alpha channel. The color channel itself is a full block of color and the marks themselves are on the alpha channel as white marks. Now here's the real trick.... The game deals with the color channel very differently than you might expect. regardless of the color in the RGB channel, during the day, it will make the marks appear black. But during the night it will make it a different color depending on the HSB values that you used that you used. It's something like this( I'll consider the values that you used to be H, S and B:

New Brightness=B
New Hue=H*S + GREEN*(100%-S)

In other words:
Perfect White becomes Perfect Green
Perfect Red becomes Still Perfect Red
Red with less saturation becomes Something
And of course, the brighter your color is the more the marks will "lit up" during the night. However, the items will never be true opaque, no matter how white you make the alpha channel. They will have around 5-10% transparency.

Hope this info will be useful to someone. This method should work in ANY group that has such items so it should work for binoculars, Uzo, Obs Scope and the rest, hopefully in SH3 too. For example I've just made a periscope filter that makes the image appear green during the night (a sort of night vision). It's very very subtle, but it's there Also has the effect of making the image a bit darker during the day (I mean darker than the Obs Scope).

Last edited by karamazovnew; 11-19-09 at 09:21 AM.
karamazovnew is offline   Reply With Quote