Terrain with random skies

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
acryptozoo
Master Bounty Hunter
Master Bounty Hunter
Posts: 1642
Joined: Wed Jun 03, 2009 3:14 pm
Projects :: Yavin Mappack
Games I'm Playing :: Homeworld 2
xbox live or psn: acryptozoo
Location: in the jungles of Yavin IV
Contact:

Terrain with random skies

Post 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"
}
}
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: terrain with random skies

Post 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");
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: terrain with random skies

Post 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.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: terrain with random skies

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: terrain with random skies

Post 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.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: terrain with random skies

Post by Jendo7 »

Thanks AQT, I'll have a look.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: terrain with random skies

Post 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
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: terrain with random skies

Post by Jendo7 »

Sorry WULFMAN, I must of misunderstood. I'll have to try it that way next time.
Post Reply