Page 1 of 1

Terrain with random skies

Posted: Tue Mar 08, 2011 4:00 pm
by acryptozoo
been trying to get a darker terrain texture to go along with my nighttime lighting
but it wasn't working lighting and skies are working fine tho
i put the textures in my sky folder and named them the same was that right ??
oh and my req
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"night"
}
REQN
{
"light"
"night"
}
REQN
{
"ter"
"Zoo_grassland_1"
"Zoo_grassland_2"
"Zoo_grassland_3"
"Zoo_grassland_4"
"Zoo_plateau_1"
"geo_main_2"
}
}

Re: terrain with random skies

Posted: Tue Mar 08, 2011 9:25 pm
by Jendo7
It's a bit more complicated because you have to create seperate terrain files (.TER files) for each sky your loading. So I wouldn't really advise it unless your only doing two random skies. Any more than that, and your file size will rocket. I can send you details if you would still like to do it though.

Edit: Here you go:

If you only want to darken one terrain for night you just have to make one extra sky folder, and terrain, so you can load two skydomes in one sky folder, and the night/sky in the other sky folder.

Set up the random skies as normal, but make two seperate sky folders, one for day/morning etc, and a seperate one for the night sky. Then copy the ground textures from the world1 one folder, but rename them with the same number of letters/spaces, and place them in the second night sky folder, in a msh folder.

Then copy your terrain file ABC.TER, or whatever your three letter map name is called, and rename the copy TWO.TER, or whatever you want, and leave it in the world1 folder.

Then hex-edit the renamed terrain file to call for the new names of the textures in the sky2/msh folder. Then darken the renamed textures in Gimp to what you want.

Then put this in your sky2.req:
Hidden/Spoiler:
ucft
{
REQN
{
"lvl"
"night"
}

REQN
{
"terrain"
"TWO"
}
}
...and this in your sky.req to load the original terrain file along with the day sky. ABC, or whatever your map name is called.


Hidden/Spoiler:
ucft
{
REQN
{
"lvl"
"day"
"morning"
}

REQN
{
"terrain"
"ABC"
}

}
Then add a terrain ABC.req, and TWO.req in each seperate sky/req folders along with there respective sky req files, in your case day.req, morning.reg, and night.req.

Lastly delete both the LightName and TerrainName from the ABC.wld file:

Hidden/Spoiler:
LightName("ABC.LGT");TerrainName("ABC.ter");
Munge each sky folder seperately both with folders called sky but with seperate .req names sky.req for day/morning, and sky2.req for night, and so on.

Lua code would then look like this:
Hidden/Spoiler:
function weather()
if WeatherMode == 1 then
ReadDataFile("dc:ABC\\sky.lvl", "day")
elseif WeatherMode == 2 then
ReadDataFile("dc:ABC\\sky2.lvl", "night")
elseif WeatherMode == 3 then
ReadDataFile("dc:ABC\\sky.lvl", "morning")
end

end
Edit2: If you want to edit your world in ze afterwards you have to put the terrain name back in the .wld file i.e:
Hidden/Spoiler:
TerrainName("ABC.ter");

Re: terrain with random skies

Posted: Wed Mar 09, 2011 12:17 am
by THEWULFMAN
Actually, there is a better, easier way. Just load up your wolrd in ZE, change your lights, the burn the terrian. Then save, go, rename the .lgt and .ter files like mentioned before. Then back in ZE, change your lights again, burn and repeat for all your weather needs. Like day, night, storm, etc.

No new textures are needed, saving file size.

Re: terrain with random skies

Posted: Wed Mar 09, 2011 8:15 am
by Jendo7
That's a good solution, and a lot easier, although you're still creating extra .TER files which is what adds the extra file size. Textures arn't going to make it that much bigger if your adding one extra terrain file. If you burn the terrain for say three seperate sky files, that's three terrain files.

Edit: Mav also mentioned using a shadow map, which is probably the best solution, and there's no need to burn the terrain. I have no idea how to do it though.

Re: terrain with random skies

Posted: Wed Mar 09, 2011 4:02 pm
by AQT
Jendo7 wrote:Edit: Mav also mentioned using a shadow map, which is probably the best solution, and there's no need to burn the terrain. I have no idea how to do it though.
The stock Endor .fx file has one set up. I guess you would use a patternless solid texture and choose a grayscale color for it depending on how dark you want the terrain to be.

Re: terrain with random skies

Posted: Wed Mar 09, 2011 4:59 pm
by Jendo7
Thanks AQT, I'll have a look.

Re: terrain with random skies

Posted: Wed Mar 09, 2011 8:32 pm
by THEWULFMAN
I tryed out the Shadowmap, it doesnt really look all that great imo, I am hard to please when it comes to random weather.
Oh, and just useing .ter files with burning, each sky.lvl is only 2.5mb

Re: terrain with random skies

Posted: Wed Mar 09, 2011 11:49 pm
by Jendo7
Sorry WULFMAN, I must of misunderstood. I'll have to try it that way next time.