texture lighting on a switch

texture lighting on a switch

Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 4:37pm
Koa
27 posts
Posted 2004-03-23 4:37pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
My goal is to use a button toggle a set of texture lights on and off. I saw a tutorial here: http://www.karljones.com/halflife/almanac.asp
If you look in the frame on the left, and scroll down to lighting.
But the link is down :sad:

Anyone know how to do this, or know of another tutorial?

Thanks.
Re: texture lighting on a switch Posted by KungFuSquirrel on Tue Mar 23rd 2004 at 5:28pm
KungFuSquirrel
751 posts
Posted 2004-03-23 5:28pm
751 posts 393 snarkmarks Registered: Aug 22nd 2001 Occupation: Game Design, LightBox Interactive Location: Austin TX
You can't just turn a texture light on and off by default - you'll need to have the updated MHLT compile tools version 1.7 or higher. Here's the snippet from that readme:
All texlights can now pulse, flicker, and switch on and off, just like normal light entities. To use this feature, you need to set the 'style' value on the brush entity which has the light-emitting texture.
If your .fgd doesn't include style values, you can add the following to any entity...

style(choices) : "Texlight style" : 0 =
[
0 : "Normal"
-3: "Grouped"
10: "Fluorescent flicker"
2 : "Slow, strong pulse"
11: "Slow pulse, noblack"
5 : "Gentle pulse"
1 : "Flicker A"
6 : "Flicker B"
3 : "Candle A"
7 : "Candle B"
8 : "Candle C"
4 : "Fast strobe"
9 : "Slow strobe"
12: "Underwater"
]
The Grouped setting is essentially a hack to allow your texlights to be switchable. To use it, create a brush entity with texlights on it, and set its style to Grouped; then create a light entity with the same name as the brush entity.
Hlrad will now pretend that the light emitted by the texlight is "really" being emitted by your light entity! In other words, turning the light on and off will now turn the texlights on and off, too. (You'll probably want to set the brightness of the light entity to 0.01, so that it emits no light of its own.)
(This trick is unnecessary if you're using Spirit of Half-Life, which supports switchable texlights directly.)
Re: texture lighting on a switch Posted by 7dk2h4md720ih on Tue Mar 23rd 2004 at 5:35pm
7dk2h4md720ih
1976 posts
Posted 2004-03-23 5:35pm
Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 6:02pm
Koa
27 posts
Posted 2004-03-23 6:02pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
Im trying to figure this part out....my fgd doesnt support styles.

"The Grouped setting is essentially a hack to allow your texlights to be switchable. To use it, create a brush entity with texlights on it, and set its style to Grouped; then create ......"

and...

"If your .fgd doesn't include style values, you can add the following to any entity... "

First, what I dont understand, is what type of entity do I assign to the brush with the light texture on it?
Second, do i have to take off smart edit and add my own "new key value" to the entity?
This is a little bit confusing.

Thanks

PS. I wonder of there is a Team Fortess Classic FGD that supports this?

/update...

ANSWER: I went and looked around. TFMapped hosts and updates that particualr FGD, and there is currently no support for it.
Re: texture lighting on a switch Posted by Wild Card on Tue Mar 23rd 2004 at 6:20pm
Wild Card
2321 posts
Posted 2004-03-23 6:20pm
2321 posts 391 snarkmarks Registered: May 20th 2002 Occupation: IT Consultant Location: Ontario, Canada
Ok, first off, to get switchable text lights, you need 2 things. The latest ZHLT tools, and a supported .FDG

Once you have both of these, making a switchable text light requires 2 things. The actual light as a func_wall entity, and a seperate light entity.

Make your light and put it func_wall. Give it a name. Then, put a entity light right under the func_wall. Give it the same name. For the brightness of the entity light, you need to find the same value as the light texture. To do this, open notepad, and find the directory that your lights.RAD file. Once you found the directory, open the file in notepad. You'll find a bunch of entries. In the first column are texture names, and the second column, a series of numerical values. Now, find the name of your textured light and find its associated value. Copy that value and paste it to your brightness value in your entity light. There should be three groups of numbers. Ex: 000 000 000. If there is a fourth set, delete it from the entity light, DO NOT DELETE IT FROM THE LIGHTS.RAD FILE.

Finally, the last thing to do is go to your text light propreties and find the light methode value, it is the second last one I think. Here, you will see the values that KFS quoted. The only difference is there wont be a "grouped" option. Instead there will be something like "associate with TL lighting" its the second from the top. Select it.

Now, when you push a button in the game, your light will turn on and off.
Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 6:31pm
Koa
27 posts
Posted 2004-03-23 6:31pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
Thanks everyone.

Wildcard, although I had that part figured out, you did a great job of putting it into words. Yes, Im using ZHLT 2.5 v1.7. (the style supporting ones)

The problem lies in my FGD.

If you scroll up, i added a postscript to my other post.
There isnt an FGD for TFCthat supports styles (at least that i could find), so i think im screwed right there. :sad:
But by the way i read zhlt read-me, it were as if you could add your own keyvalue.

"If your .fgd doesn't include style values, you can add the following to any entity... "

Im hoping that this is what they are talking about when they say you can add the following to any entity.
If this is the case, is a bit confusing....

Would I use text light style as the key, and 3 (grouped) as the value?
Re: texture lighting on a switch Posted by Wild Card on Tue Mar 23rd 2004 at 6:35pm
Wild Card
2321 posts
Posted 2004-03-23 6:35pm
2321 posts 391 snarkmarks Registered: May 20th 2002 Occupation: IT Consultant Location: Ontario, Canada
I have an expert CS FDG and it has the light values. Im not sure about entering them, well, I mean, if it will work that is.

But to enter the values, open your .FDG in notepad and find the func_wall entity. At the bottom, add the following value:
style(choices) : "Texlight style" : 0 =
[
0 : "Normal"
-3: "Grouped"
10: "Fluorescent flicker"
2 : "Slow, strong pulse"
11: "Slow pulse, noblack"
5 : "Gentle pulse"
1 : "Flicker A"
6 : "Flicker B"
3 : "Candle A"
7 : "Candle B"
8 : "Candle C"
4 : "Fast strobe"
9 : "Slow strobe"
12: "Underwater"
]
That should work. Save your FDG UNDER A NEW NAME. And load that new FDG in VHE. (This way, if you f**k up, you'll still have a backup to fall on)

make a brush a func_wall entity and see if the value appears. If the values arent there, click the smartedit button.

Add the value that way.
Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 8:27pm
Koa
27 posts
Posted 2004-03-23 8:27pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
Ok.....wow that turned into a HUGE learning experience.

So...I tried Wildcards idea of editing my fgd as he described. However i could not get hammer to display this new value to appear in the entitys properites. (great idea though :smile: )

I just spent more than an hour playing with this and the good news is the solution was very simple!!
What was messing me up was the fact that I was trying to edit the "renderFX" by using the value of -3 BECAUSE....they listed things that looked so similar to what is described in the zhlt faq. Similar, but not the same, you dont need to mess with that.

This is what I had to do:

1. Tie the brush with the light texture on it to a func_wall entity.
De-select the smart edit button, and click on the add button.

For the key simply enter "style" and for the value enter "-3"
Named the entity. (light1)

like this...

User posted image

2. I then created a light entity with the "brightness" values set as follows: 134 228 249 0.01
[color=orange]The first three values are the same as defined in the lights.rad file for my particular texture. (~SPOTBLUE)

[/color](0.01 being the the brightness value, because you dont wish for this entity to actually create the light)
Named the light entity with the same name as the brush entity with light texture on it (light1).
like this...

User posted image

3.
Create a brush with a button texture and tie it to a func_button entity.
Give it a target name of the two previous entities (light1)

And thats about it.
I can now walk up to this button in-game and activate this texture light.
A side affect I thought may occur would be that it would switch on and off every brush with the texture applied to it, but it seems it only affects the ones targeted by your button.
This whole thing is pretty damn cool :biggrin:

Re: texture lighting on a switch Posted by JFry on Tue Mar 23rd 2004 at 8:30pm
JFry
369 posts
Posted 2004-03-23 8:30pm
JFry
member
369 posts 82 snarkmarks Registered: Mar 9th 2004 Occupation: Scumbag Location: USA
I'm gonna keep it short and sweet. All you gotta do is hit smartedit, type in "style" and give it a value of -3.

EDIT: Heh you beat me to it.
Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 8:36pm
Koa
27 posts
Posted 2004-03-23 8:36pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
Heh, yeah.
This was actually pretty involved when you start editing fgd's and looking for "values" and blah blah blah.
So I thought it maybe it would be a benefit to go into a little more detail. Hopefully this thread wont just help me.
Re: texture lighting on a switch Posted by Wild Card on Tue Mar 23rd 2004 at 8:48pm
Wild Card
2321 posts
Posted 2004-03-23 8:48pm
2321 posts 391 snarkmarks Registered: May 20th 2002 Occupation: IT Consultant Location: Ontario, Canada
I tryed that once before. Does the light emit light in the game? Because mine didnt, and all I had to do to fix that was remove the 0.01 brightness thing. But if it works, it works.
Re: texture lighting on a switch Posted by Koa on Tue Mar 23rd 2004 at 9:00pm
Koa
27 posts
Posted 2004-03-23 9:00pm
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
Yeah works great !!

And I was just experimenting some more. You evidently do not need to create a light entity for each texture light. You simple need one. I just gave several other brushes with this texture the same name name, and this one light entity will switch on / off all the texture lights that have the name. Pretty cool.
Logic would dictate if you want to use a different texture you need to do a new entity setup for that texture.
Note you can use the flag "initially dark" on that one light entity to control wether you want the lights on when the leve starts or not. Also pretty damn cool.
Wow, I had a lot of fun playing with this.
Re: texture lighting on a switch Posted by fishy on Tue Mar 23rd 2004 at 11:05pm
fishy
2623 posts
Posted 2004-03-23 11:05pm
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
it's not too difficult to edit your fgd, so that it has the texlight styles in it. here's an example to add styles to a func_wall_toggle.

open your fgd with a text editor. search for where the func_wall_toggle is listed. it looks like;

@SolidClass base(func_wall) = func_wall_toggle : "Toggleable geometry"
[
spawnflags(flags) =
[
1 : "Starts Invisible" : 0
]
]

now move the last bracket ] down one line. in the new blank line, paste the following;

style(choices) : "Texlight style" : 0 =
[
0 : "Normal"
-3: "Grouped"
10: "Fluorescent flicker"
2 : "Slow, strong pulse"
11: "Slow pulse, noblack"
5 : "Gentle pulse"
1 : "Flicker A"
6 : "Flicker B"
3 : "Candle A"
7 : "Candle B"
8 : "Candle C"
4 : "Fast strobe"
9 : "Slow strobe"
12: "Underwater"
]

you can do this with whatever type of entity you plan on using with texlights.

[edit] darn the lack of indentability

one other thing. you dont need to go to the bother of getting the colour on the pointlight to be the same as that on the texlight. not if you're going to set the brightness value of the pointlight to 0.01, because your never going to see it.[/edit]
Re: texture lighting on a switch Posted by Koa on Wed Mar 24th 2004 at 6:10am
Koa
27 posts
Posted 2004-03-24 6:10am
Koa
member
27 posts 3 snarkmarks Registered: Feb 24th 2004
fishy said:
one other thing. you dont need to go to the bother of getting the colour on the pointlight to be the same as that on the texlight. not if you're going to set the brightness value of the pointlight to 0.01, because your never going to see it.[/edit]
Agreed
Re: texture lighting on a switch Posted by Wild Card on Wed Mar 24th 2004 at 12:06pm
Wild Card
2321 posts
Posted 2004-03-24 12:06pm
2321 posts 391 snarkmarks Registered: May 20th 2002 Occupation: IT Consultant Location: Ontario, Canada
Well, I learned something as well. My expert CS FDG is good because it gives me the game_text entity, which I needed. It's textured light setup isnt worth a damn.

When I said the 0.01 setup dosent work, I am sorry, it DOES work. The only reason it didnt for me, is because my VHE folder has been ported from reformat to reformat so many times I ended up with 4 different lights.RAD files and I wasent loading the correct one. The one I was loading had no values in it.

I have to head to school now, but tonight I will be editing my FDG and adding the light codes.