Page 1 of 1

Random skies problem

Posted: Wed May 12, 2010 11:15 am
by Darth_Spiderpig
Well, following Sky's tut I added random light and random skies to my map, light is working, but it seems all 3 different skies have no texture, since the skyobjects are all loaded, but the background is all black.

Here my lua part relevant for the random skies
Hidden/Spoiler:
[code]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"}



--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:Start()

EnableSPHeroRules()

if not ScriptCB_InMultiplayer() then
herosupport = AIHeroSupport:New{AIATTHeroHealth = 4000, AIDEFHeroHealth = 4000, gameMode = "NonConquest",}
herosupport:SetHeroClass(ALL, herostrAll)
herosupport:SetHeroClass(IMP, herostrEmp)
herosupport:AddSpawnCP("CP1","CP1Spawn")
herosupport:AddSpawnCP("CP2","CP2Spawn")
herosupport:AddSpawnCP("CP3","CP3Spawn")
herosupport:AddSpawnCP("CP4","CP4Spawn")
herosupport:AddSpawnCP("CP5","CP5Spawn")
herosupport:AddSpawnCP("CP6","CP6Spawn")
herosupport:Start()
else
end

end

function weather()
if WeatherMode == 1 then
ReadDataFile("dc:DBH\\sky.lvl", "night")
elseif WeatherMode == 2 then
ReadDataFile("dc:DBH\\sky.lvl", "evening")
elseif WeatherMode == 3 then
ReadDataFile("dc:DBH\\sky.lvl", "morning")
end
end[/code]
This is my evening.sky file located in worlds/sky folder
Hidden/Spoiler:
[code]SkyInfo()
{
Enable(1);
PC()
{
NearSceneRange(1800.0, 2500.0, 2000.0, 2700.0);
FarSceneRange(0.0);
}
}

DomeInfo()
{
Texture("night.tga");
Angle(-90.000000);
Ambient(255.000000, 255.000000, 255.000000);
Filter(1);
Threshold(50);
Intensity(50);
Softness(1);
SoftnessParam(60);


DomeModel()
{
Geometry("spa1_sky");
}

DomeModel()
{
Geometry("kas_moon");

}


Stars()
{
RandomSeed(1);
TwinkleFactor(0.5);
TwinkleFrequency(0.1);
Color(255, 255, 255, 255);
EnableBottom(1);
PC()
{
NumStars(8000);
BrightStarPercent(70.0);
AlphaMin(15);
ColorSaturation(.75);
}
}
}[/code]
And this is evening.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"config"
"evening"
}

REQN
{
"light"
"DBH_evening"
}
}[/code]
I also tried this variation of evening.sky
Hidden/Spoiler:
[code]DomeInfo()
{
DomeModel()
{
Geometry("spa1_sky");
rotationspeed(0.0001,0.0,1.0,0);
}
DomeModel()
{
Geometry("kas_moon");

}

Stars()
{
RandomSeed(1);
TwinkleFactor(0.5);
TwinkleFrequency(0.1);
Color(255, 255, 255, 255);
EnableBottom(1);
PC()
{
NumStars(8000);
BrightStarPercent(70.0);
AlphaMin(15);
ColorSaturation(.75);
}
}


}[/code]
Anyone knows what's wrong?