Page 1 of 1

Changes with Random Skies

Posted: Sat Jan 23, 2010 7:28 pm
by Null_1138
Keep in mind that I'm not an expert on random skies. Here's my scenario:

I have a city map made of Naboo buildings from the BF2 version, with "lights" on inside. I used them because originally I wanted the map to be set at night. I noticed that some windows make use of the alpha channel to show the light behind it while others do not, as shown in this pic.
Hidden/Spoiler:
Image
Now, I wondered, if the map had random skies - one in the morning and one at night - how would I get the lights to "turn off" in the morning? Here's what I want to do: I want to get the alpha channels to turn on and off according to the sky. Would that be possible, and how? If not, can anyone suggest a suitable work-around?

Thanks in advance!

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 9:37 pm
by Fiodis
Aren't those lights just skinned on? Lighting doesn't show up in MSH Viewer.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 10:32 pm
by Null_1138
I don't mean the ZE lighting, sorry if that's how it sounds. The thing with those buildings is the "lights" are actually faces textured with nab2_prop_glow.tga; so yes they are skinned on, but not on the windows themselves. The texture for the windows, nab2_bldg_window02.tga, has an alpha channel that takes away the window, excluding the panes. For some instances of the texture on the buildings, the alpha channel is active and allows you to see the faces behind them, but in other instances, the alpha channel is :quotes: dormant :quotes: and shows you just the glass from the texture.

I want to know what governs this. Is it hex edited? Is it UVed that way?

Once I know that, I want to know if that can change with random skies or I will have to find a work-around.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 10:46 pm
by Fiodis
That's easy. You just make two copies of the same MSH and hex them to read different light textures, one off and one on. Then you place both objects, one over the other, in ZE, and use LUA to kill one or the other based on what sky you're loading.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:00 pm
by Null_1138
I remember that being a solution to Rends' Tatooine map (here). Does that work for random skies?

Here's what I think the problem is. The method you suggested and was mentioned in Rends' thread was based on user input: you picked the mode / era and that determined which version would be loaded. But random skies is random (no meme intended). There's nothing to determine what will load. If I had two modes, one daytime and one nighttime, what you suggested would work, but not for only one mode. You can't change the physical mapping with random skies, that only changes the skydome, lighting, and weather effects.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:04 pm
by Fiodis
Assuming your custom skies are determined by a number from a random number generator, you can tack on the KillObject() functions to specific numbers along with their corresponding skies.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:12 pm
by Null_1138
Wow, you could do that?

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:16 pm
by Maveritchell
Null_1138 wrote:Wow, you could do that?
There isn't a specific function you use to do "random skies." All I or anyone else does is generate a random variable and based on that variable assign certain things to be loaded.

Your map would be much more memory-effective if you simply loaded a different texture to correspond with your random skies (I don't know what the tutorial here says, but if you are loading through a different .lvl file each time, you can simply load a specific texture in that .lvl's .req file). What Fiodis said will work too, it just has twice as many objects as you need.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:24 pm
by Null_1138
Maveritchell wrote:
Null_1138 wrote:Wow, you could do that?
There isn't a specific function you use to do "random skies." All I or anyone else does is generate a random variable and based on that variable assign certain things to be loaded.

Your map would be much more memory-effective if you simply loaded a different texture to correspond with your random skies (I don't know what the tutorial here says, but if you are loading through a different .lvl file each time, you can simply load a specific texture in that .lvl's .req file). What Fiodis said will work too, it just has twice as many objects as you need.
Sounds like a lot more than just hex editing textures, but also sounds much more efficient. I'll have to read through the docs on LVLs and REQs. Which tutorial do you mean?

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:30 pm
by Maveritchell
Null_1138 wrote:Sounds like a lot more than just hex editing textures, but also sounds much more efficient. I'll have to read through the docs on LVLs and REQs. Which tutorial do you mean?
The tutorial I'm speaking of - I believe there's a "random skies" tutorial linked to in the FAQ thread? And I can save you the time of looking through the docs "on .lvls and .reqs." Nothing you read in them will be as helpful as simply looking through how .req files work - all .req files are a prerequisite for a .lvl file to be compiled, and they are essentially a big list of what files, grouped by type, are to be loaded into that .lvl file. You can see that .reqs in your world1 folder traditionally load a number of different types of files, and as long as you have two distinct .lvl files that load two different textures, and as long as they are loaded before the .wld (or layer) containing the model, you should be ok. Play around and if you have problems post a thread.

Re: Changes with Random Skies

Posted: Sat Jan 23, 2010 11:32 pm
by Null_1138
Maveritchell wrote:
Null_1138 wrote:Sounds like a lot more than just hex editing textures, but also sounds much more efficient. I'll have to read through the docs on LVLs and REQs. Which tutorial do you mean?
The tutorial I'm speaking of - I believe there's a "random skies" tutorial linked to in the FAQ thread? And I can save you the time of looking through the docs "on .lvls and .reqs." Nothing you read in them will be as helpful as simply looking through how .req files work - all .req files are a prerequisite for a .lvl file to be compiled, and they are essentially a big list of what files, grouped by type, are to be loaded into that .lvl file. You can see that .reqs in your world1 folder traditionally load a number of different types of files, and as long as you have two distinct .lvl files that load two different textures, and as long as they are loaded before the .wld (or layer) containing the model, you should be ok. Play around and if you have problems post a thread.
Oh, I read the random skies tut. I thought you meant a different one on .lvls and .reqs. Thanks for your help Mav and Fiodis.