Random Skies not working [Solved]
Posted: Sun Mar 06, 2011 2:04 pm
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
example of .req
sky.req
example of a sky file
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
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
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"day"
}
}
{
REQN
{
"config"
"day"
}
}
Hidden/Spoiler:
ucft
{
REQN
{
"lvl"
"morning"
"day"
"night"
}
}
{
REQN
{
"lvl"
"morning"
"day"
"night"
}
}
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);
}
{
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);
}