Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Miscellaneous => Topic started by: Valkryst on September 02, 2014, 06:28:59 am
-
Hey,
After working all day with Milly I've finally managed to get a very nice looking night time for an area. Although I've nearly perfected the look, there is one terrible bug. Whenever a weather event begins where it starts raining, snowing, etc... the light, sky, and everything I've set changes from a nice night time look to a bright daytime look.
What I'm wondering is if there is a way to change the look of the weather, have the weather take the look of the light and all that which is already set, or somehow set the weather to only work during daytime.
Any information is appreciated, thanks.
--------------------------------------------------------------
This is being done on WotLK 3.3.5a, Trinity Core.
-
Weather.dbc has a light entry since some version. Not sure which one. There is also a spell effect with time-of-day or light override. Again, not sure since when.
-
No idea if the light setting can be fixed to work with the nights, but you can make it so weather only happens during day.
And may the following snippet helps somebody to prevent the problem with rain/snow/fog destroying the night effect. Just add it in the beginning of Weather::ReGenerate() in weather.cpp. So you will have sun weather in the night. (May adjust the time).
// night cycle if time between 21:00 and 6:00
time_t curTime = time(NULL);
tm localTm;
ACE_OS::localtime_r(&curTime, &localTm);
if (localTm.tm_hour>=21 || localTm.tm_hour<=6)
{
TC_LOG_INFO("weather", "It's night time.");
m_type = WEATHER_TYPE_FINE;
m_grade = 0.0f;
return false;
}
-
No idea if the light setting can be fixed to work with the nights, but you can make it so weather only happens during day.
And may the following snippet helps somebody to prevent the problem with rain/snow/fog destroying the night effect. Just add it in the beginning of Weather::ReGenerate() in weather.cpp. So you will have sun weather in the night. (May adjust the time).
// night cycle if time between 21:00 and 6:00
time_t curTime = time(NULL);
tm localTm;
ACE_OS::localtime_r(&curTime, &localTm);
if (localTm.tm_hour>=21 || localTm.tm_hour<=6)
{
TC_LOG_INFO("weather", "It's night time.");
m_type = WEATHER_TYPE_FINE;
m_grade = 0.0f;
return false;
}
Thanks Schlumpf and Milly. I've looked around the Weather.dbc file and I'll probably do some tests with it when I get a chance. For-now I'll use an edit to Weather.cpp.
Although the code you provided probably worked at some point, it wouldn't compile properly for me. After a minute or two I made the following changes to get it to compile and hopefully work in the same way.
// night cycle if time between 21:00 and 6:00
time_t t;
short hour;
t = time(NULL);
hour = localtime(&t)->tm_hour;
if (hour>=21 || hour<=6)
{
TC_LOG_INFO("weather", "It's night time.");
m_type = WEATHER_TYPE_FINE;
m_grade = 0.0f;
return false;
}
-
Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.
-
Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.
I already quoted Magnus in my post. Check it again :P
-
Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.
I already quoted Magnus in my post. Check it again :P
Why are you telling me? I'm not the one that thanked you. You should direct your post at the other guy.
-
Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.
I already quoted Magnus in my post. Check it again :P
Why are you telling me? I'm not the one that thanked you. You should direct your post at the other guy.
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
-
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.
Reading is hard, eh?
-
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.
Reading is hard, eh?
And in no way did Valkryst ever suggest that I made the code. He thanked me for sharing it.
Reading sure is hard kojak.
-
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.
Reading is hard, eh?
Milly is the one who provided a solution to my problem and Magnus wrote the code. Magnus wasn't one who posted here in response to my questions and so I wont be thanking him here. Problem solved.
-
Such a strange conversation here :D
The code I posted first indeed must be adjusted a litte bit because in the meantime Trinity changed the ACE lib to Boost (http://www.boost.org/)
F. ex. like this (or Valkryst example):
// night cycle if time between 21:00 and 6:00
time_t curTime = time(NULL);
tm localTm;
localtime_r(&curTime, &localTm);
if (localTm.tm_hour>=21 || localTm.tm_hour<=6)
{
TC_LOG_INFO("weather", "It's night time.");
m_type = WEATHER_TYPE_FINE;
m_grade = 0.0f;
return false;
}
-
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.
Reading is hard, eh?
And in no way did Valkryst ever suggest that I made the code. He thanked me for sharing it.
Reading sure is hard kojak.
Holy shit you're dumb. I don't give two fucks what he thanked you for. He didn't thank Magnus. It doesn't matter who posted it here; the creator deserves the thanks.
RIP braincells.
-
Please stop that kind of discussion :shock:
It's not worthy because of 10 lines of code.