Random Skies not working [Solved]

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:

Random Skies not working [Solved]

Post by acryptozoo »

well i had another go at random skies
but instead of crashing this time it just stays the normal sky
dont get any munge errors or bf2log errors related to the skies
not sure where i went wrong
thanks in advance

clip of LUA
Hidden/Spoiler:
function ScriptPostLoad()

WeatherMode = math.random(1,3)
weather()

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}
cp10 = CommandPost:New{name = "cp10"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)
conquest:AddCommandPost(cp10)

conquest:Start()

SetUberMode(1);

EnableSPHeroRules()

end


function weather()
if WeatherMode == 1 then
ReadDataFile("dc:y4p\\sky.lvl", "day")
elseif WeatherMode == 2 then
ReadDataFile("dc:y4p\\sky.lvl", "morning")
elseif WeatherMode == 3 then
ReadDataFile("dc:y4p\\sky.lvl", "night")
end

end
example of .req
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"day"
}
}
sky.req
Hidden/Spoiler:
ucft
{
REQN
{
"lvl"
"morning"
"day"
"night"
}
}
example of a sky file
Hidden/Spoiler:
SkyInfo()
{
FogColor(128, 128, 128);
FogRange(1800.000000, 3000.000000);
NearSceneRange(100.7, 1000.0, 1500.0);
FarSceneRange(3500.0);
AmbientColor(100, 100, 100);
VehicleAmbientColor(80,80,80);
Enable(1);
FogRamp(3);
}

SunInfo()
{
Angle(150.000000, 0.000000);
Color(70, 78, 80);
Texture("");
Degree(0.000000);
BackAngle(210, 0.000000);
BackColor(0, 0, 0);
BackDegree(0.000000);
}

DomeInfo()
{
Texture("morning");
Angle(-90.000000);
Ambient(255.000000, 255.000000, 255.000000);
Filter(1);
Threshold(150);
Intensity(30);

Softness(1);
SoftnessParam(60);

DomeModel()
{
Geometry("sky_yav2");
}
DomeModel()
{
Geometry("sky_yav2_planet");
Offset(50.0);
MovementScale(0.995);
}

DomeModel()
{
Geometry("sky_yav2_mountains");
Offset(100.0);
MovementScale(0.995);
}

LowResTerrain()
{
Texture("yav2");
PatchResolution(2);
FogNear(400.0);
FogFar(800.0);
FogColor(80,80,80, 128);
}


}

//Imp fighters
SkyObject()
{
Geometry("YV-929");
NumObjects(1);
Height(80, 140);
VelocityZ(20, 20);
VelocityY(-10, 10);
Distance(300);
InDirectionFactor(0.5);
}
Last edited by acryptozoo on Sun Mar 06, 2011 5:08 pm, edited 1 time in total.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Random Skies not working

Post by Jendo7 »

Are your sky files called morning.sky, day.sky, and night.sky.
Last edited by Jendo7 on Sun Mar 06, 2011 2:32 pm, edited 3 times in total.
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:

Re: Random Skies not working

Post by acryptozoo »

Jendo7 wrote:Are your sky files called morning.sky, day.sky, and night.sky.
yep
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Random Skies not working

Post by Jendo7 »

Just noticed that your using the sky_yav2.msh skydome model which uses sky_yav2.tga texture, yet you have "morning" as your texture. Unless you hex-edited morning in to the model it won't use that texture.

Also, did you also want to add lighting and effects with your random skies.
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:

Re: Random Skies not working

Post by acryptozoo »

Jendo7 wrote:Just noticed that your using the sky_yav2.msh skydome model which uses sky_yav2.tga texture, yet you have "morning" as your texture. Unless you hex-edited morning in to the model it won't use that texture.

Also, did you also want to add lighting and effects with your random skies.
ah completely forgot about that
ill get 2 different skydomes for that XD
and not yet
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Random Skies not working

Post by Jendo7 »

That could be it then, with a bit of luck.
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:

Re: Random Skies not working

Post by acryptozoo »

Jendo7 wrote:That could be it then, with a bit of luck.
yep that was it :D totally works now thanks :D
now to tackle lighting :S
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Random Skies not working [Solved]

Post by Jendo7 »

That's great! :)
Good luck with the lighting
Post Reply