View Full Version : More Lightings
Tokuriku
March 26th, 2007, 15:53
I'm not sure if this has been adressed but... you can have more lighting options you know :)
https://legriffondor.com/archives/Lightings.jpg
My cave/dungeons lighting turns a deep purple :D
richvalle
March 26th, 2007, 16:48
Nice! More lighting effects would be cool.
rv
Valarian
March 26th, 2007, 16:57
You can't stop there .... how?
Elf
March 26th, 2007, 20:12
Yes elaborate please....
mr_h
March 26th, 2007, 21:10
TEASE!
*points at Kenshin*
Get'em boys!
joshuha
March 26th, 2007, 22:28
This is *very* easy to do in FG 2.0 btw. I never dug around to see it could be done in FG 1.05 but in 2.0 its just a few lines of code.
joshuha
March 27th, 2007, 01:47
Ok looking back at 1.05, you should see a data\ui_utility.xml. In this file you should see the following section:
<windowclass name="lightingselection">
<frame name="framebox" />
<defaultsize width="165" height="460" />
<softclose />
<sheetdata>
<lightingselection>
<bounds rect="30,30,-30,-30" />
<state icon="lighting_day" />
<state icon="lighting_night" window="A4B8FF" />
<state icon="lighting_fire" window="F4C6B1" />
<state icon="lighting_forest" window="E6FDE0" />
</lightingselection>
</sheetdata>
</windowclass>
The window variable controls the hue that will modulate the window. It appears to be in a RedGreenBlue (rrggbb) format. The icons need to be declared in your graphics.xml file along with all the other icons. Don't think there is much else you need to do but maybe adjust the default size to fit your new icon.
Tokuriku
March 27th, 2007, 02:22
Joshuha is dead-on.
First thing I did was to put a copy of:
data/ui_utility.xml
data/graphics.xml
in my ruleset folder as to not touch the original settings of FG.
Then, edit your base.xml (of your new ruleset) to point at the right files:
<includefile source="rulesets\your_ruleset\graphics.xml" />
<includefile source="rulesets\your_ruleset\ui_utility.xml" />
Second step is to procude an Icon for your new lighting.
I put it in the "data/icons" folder with all the other icons as to find it easily afterwards. Then, you must add that icon to the iconlist of FG in your new "graphics.xml"
<icon name="lighting_day" file="data/icons/lighting_day.png" />
<icon name="lighting_night" file="data/icons/lighting_night.png" />
<icon name="lighting_fire" file="data/icons/lighting_fire.png" />
<icon name="lighting_forest" file="data/icons/lighting_forest.png" />
<icon name="lighting_cave" file="data/icons/lighting_cave.png" />
Be sure to put the right path & name of your icon.
Finally, put the new lighting in your lightingselection in the new "ui_utility.xml"
and increase the size of the window so that your icon can be seen.
<windowclass name="lightingselection">
<frame name="framebox" />
<defaultsize width="165" height="550" />
<softclose />
<sheetdata>
<lightingselection>
<bounds rect="30,30,-30,-30" />
<state icon="lighting_day" />
<state icon="lighting_night" window="A4B8FF" />
<state icon="lighting_fire" window="F4C6B1" />
<state icon="lighting_forest" window="E6FDE0" />
<state icon="lighting_cave" window="AA90FC" />
</lightingselection>
</sheetdata>
</windowclass>
Three interesting things for you:
The window for lightings adjusts itself automatically in the center of your game window so you need not bother with that.
You can have different colors then the ones comming with FG (i always liked a deeper night color).
Last but not least, the colors are in html format and you can find those on numourous websites or in your favorite image handling software (Photoshop for instance).
Tokuriku
August 3rd, 2007, 16:02
I figured in part the new tagging system in FGII for colors (Lighting).
It seems reverse then the standard RGB, so it's like BGR...
One thing though, there is anoter color marker in front (hence 4 color indexes), can someone enlighten me on that?
Griogre
August 3rd, 2007, 16:57
Alpha maybe?
joshuha
August 3rd, 2007, 17:29
Yep its the alpha for transparency.
Tokuriku
August 4th, 2007, 02:06
That's what i tought.... but what kind of notation is it?
Griogre
August 4th, 2007, 17:43
Not sure what you mean by notation. The alpha value like the colors are in hexadeximal - base 16. Hex numbers are 0-9, then A-F.
So the hex numbers :<state icon="lighting_cave" window="AA90FC" />
for the cave in a RGB format are AA hex = 170 decimal; 90 = 144 decimal, FC = 252 decimal. The three pairs of two hex numbers have values between 0-255.
I suspect on your version of windows if you start the calculator and change your view from stardard to scientific you should see radio buttons for switching between Hex, Decimal, Octal (base 8), and Binary (base 2). You can type in a number and then change the radio button to see what it would be in hex.
Tokuriku
August 5th, 2007, 03:11
Thanks Griogre... I understands what you say :)
But, maybe I wasn't clear what I meant was:
A = Alpha
R = Red
G = Green
B = Blue
RRGGBB is "html" style color notation right?
so...
AABBGGRR is what kind of color notation style?
When was it invented and for what purpose/program?
Does somebody know?
Foen
August 5th, 2007, 06:38
I'm guessing that the notation springs from 32-bit BMP layout, where each pixel has one byte each for RGB and Alpha.
Not seen it used like this before, but it does seem an easy extension to the html approach.
Cheers
Stuart
(Foen)
Mellock
August 5th, 2007, 16:14
Wow, this is like carving "nerd" into my forehead, but...
Alpha channels (or just alpha compositing") were created in the 70's already. You can look up more on Thomas Porter and Tom Duff if you want. There's a very nerdy paper at https://portal.acm.org/citation.cfm?doid=800031.808606
It was developed to do what is does really: take an image and a background, and create an effect that looks like transparancy. The color space is simply called RGBA (red, green, blue, alpha or sometimes ARGB. Macromedia calls it ARGB I think.
The abstract from that paper pretty much says it all:
Most computer graphics pictures have been computed all at once, so that the rendering program takes care of all computations relating to the overlap of objects. There are several applications, however, where elements must be rendered separately, relying on compositing techniques for the anti-aliased accumulation of the full image. This paper presents the case for four-channel pictures, demonstrating that a matte component can be computed similarly to the color channels. The paper discusses guidelines for the generation of elements and the arithmetic for their arbitrary compositing.
That matte component is sometimes just called "the matte". Think of it as a grayscale overlay, where black is transparant, white is opaque, and anything in between can be anything in between. (from 0 to 255)
Dachannien
August 5th, 2007, 18:49
Wow, this is like carving "nerd" into my forehead, but...
It's okay. After all, these forums are for a computer program that lets you play roleplaying games over the Internet.
Valarian
August 5th, 2007, 19:49
What are you trying to say?
Are you implying something Sir?
I have a slide rule and I'm not afraid to use it!
Mellock
August 5th, 2007, 19:57
As if you don't hide any knowledge of such matters at ****tail parties. Sometimes I feel like I'm a giant pocket protector and everybody's staring at me. :D
Lest you get... the look! (I just got one yesterday. Dang, that had been a while.)
Tokuriku
August 6th, 2007, 01:17
Hehe...
I don't know why but I'm still not satisfied.
I mean ARGB or RGBA makes sense to me but FG2 uses ABGR!!!
The only reason I tought it could be used in reverse is maybe, just maybe if you need to seperate the information easily for the computer using some command that apparents to C, it would take each part of the A.B.GR. one by one, putting the Alpha in a separate string and then each of the other B.G.R. in another string from the last character up making it RGB in the end...
I shouldn't care that much :P
It works and got ALPHA!, that's all I should need...
Mellock
August 6th, 2007, 08:03
Well, I never needed to work with color spaces like that, but I'll look it up after I've had some sleep.
What did they code FG in?
Foen
August 6th, 2007, 17:46
C I believe, and Lua (a scripting overlay which works with C).
That said, the 4-character strings for ABGR values are unlikely to be 32-bit C character literals, because they are embedded in other (longer) strings. It would have been a neat solution otherwise.
Stuart
(Foen)
Tokuriku
January 15th, 2012, 14:19
Ok, I know this is a VERY old topic but I just recently came back to FGII and I'm having trouble with this.
I made an extension from the foundations ruleset and included all the needed files to add lighting options. I also changed the hight of my frame to accommodate the new "Cave" lighting Icon I made. Problem is, the icon is there but the frame is not resized bigger to accommodate it.
Anyone has an idea why?
Here is the code:
<windowclass name="lightingselection">
<frame name="framebox" />
<placement>
<size>
<width>165</width>
<height>560</height>
</size>
</placement>
<sheetdata>
<lightingselection name="day">
<anchored>
<top>
<anchor>top</anchor>
<offset>30</offset>
</top>
<left>
<anchor>left</anchor>
<offset>30</offset>
</left>
<size>
<width>100</width>
<height>100</height>
</size>
</anchored>
<icon>lighting_day</icon>
<light>
</light>
</lightingselection>
<lightingselection name="night">
<anchored>
<to>day</to>
<position>below</position>
<size>
<height>100</height>
</size>
</anchored>
<icon>lighting_night</icon>
<light>
<window>FFFFB8A4</window>
</light>
</lightingselection>
<lightingselection name="fire">
<anchored>
<to>night</to>
<position>below</position>
<size>
<height>100</height>
</size>
</anchored>
<icon>lighting_fire</icon>
<light>
<window>FFB1C6F4</window>
</light>
</lightingselection>
<lightingselection name="forest">
<anchored>
<to>fire</to>
<position>below</position>
<size>
<height>100</height>
</size>
</anchored>
<icon>lighting_forest</icon>
<light>
<window>FFE0FDE6</window>
</light>
</lightingselection>
<lightingselection name="cave">
<anchored>
<to>forest</to>
<position>below</position>
<size>
<height>100</height>
</size>
</anchored>
<icon>lighting_cave</icon>
<light>
<window>FFFC90AA</window>
</light>
</lightingselection>
<closebutton />
</sheetdata>
</windowclass>
EDIT:
LOL
Sorry for the alarm, I figured out why!
I used it in an existing campaign so the frame state was saved in the campaignregistry.lua
Deleted it and everything is golden now ;)
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.