DarkStalker30 Posted Saturday at 09:54 Share Posted Saturday at 09:54 Hi guys, didn't write some time, but now want to return. I have an idea to use different weather on the map, because as you know in single SA different regions have different weather. I find a way to do it - when player changing region (prototype for now, in future will do collision cubes) start setWeatherBlended() and then accelerate game time with setMinuteDuration(), after it return time to the server. But it has problem, because with fast time you will get fast day and night. If in some border time like between 20:00 and 22:00 you can even didn't notice it, then at another time it's too obvious. Is there a way to freeze lighting to create illusion of not changing time? Link to comment
DiSaMe Posted Saturday at 11:40 Share Posted Saturday at 11:40 There are several functions for controlling the relevant properties, such as setSkyGradient, setWorldProperty and setColorFilter. But this seems like such a hacky way to do it that I'm not even sure if it can even be done properly, because lighting is not just time-dependent, it's weather-dependent too. So even if you freeze the lighting, it's going to switch suddenly (from old weather to new weather) when you unfreeze it. A more reliable solution is to take full control of those properties, completely overriding the built-in weather and implementing your own weather system. I've had this idea in the days before it was possible in MTA (because MTA didn't have all those functions), but it may be an overkill, depending on your needs. Link to comment
DarkStalker30 Posted Saturday at 12:02 Author Share Posted Saturday at 12:02 14 minutes ago, DiSaMe said: There are several functions for controlling the relevant properties, such as setSkyGradient, setWorldProperty and setColorFilter. But this seems like such a hacky way to do it that I'm not even sure if it can even be done properly, because lighting is not just time-dependent, it's weather-dependent too. So even if you freeze the lighting, it's going to switch suddenly (from old weather to new weather) when you unfreeze it. A more reliable solution is to take full control of those properties, completely overriding the built-in weather and implementing your own weather system. I've had this idea in the days before it was possible in MTA (because MTA didn't have all those functions), but it may be an overkill, depending on your needs. Well, looks like it can be changed with timer too smooth transition. But it will take time to figure this out. If really, I don't understand how can I freeze lighting. Timer with setSkyGradient()? SetWorldProperty() looks interesting, but many works to do as well. I guess, for now I leave it, because my server on early stage of development. So if I can to do it simple and hacky way - I will do it, if not - then leave it. Link to comment
DiSaMe Posted Saturday at 13:07 Share Posted Saturday at 13:07 16 minutes ago, DarkStalker30 said: If really, I don't understand how can I freeze lighting. Timer with setSkyGradient()? When you set the property, it stays frozen. So for example if you call getWorldProperty and then pass its return value to setWorldProperty, that value will stay until you call resetWorldProperty. But some of those functions (including getSkyGradient) are limited because they can only return the values previously assigned by script - meaning you can't get the unmodified value and assign it to freeze it. It seems that smooth transition is possible for color filter, because getColorFilter has isOriginal argument, allowing you to take the values that would be there if they weren't overridden by script so you can know exactly what values to interpolate to. But it doesn't help much when the same can't be done to other parameters. 1 Link to comment
DarkStalker30 Posted Saturday at 18:48 Author Share Posted Saturday at 18:48 5 hours ago, DiSaMe said: When you set the property, it stays frozen. So for example if you call getWorldProperty and then pass its return value to setWorldProperty, that value will stay until you call resetWorldProperty. But some of those functions (including getSkyGradient) are limited because they can only return the values previously assigned by script - meaning you can't get the unmodified value and assign it to freeze it. It seems that smooth transition is possible for color filter, because getColorFilter has isOriginal argument, allowing you to take the values that would be there if they weren't overridden by script so you can know exactly what values to interpolate to. But it doesn't help much when the same can't be done to other parameters. Okay then, thanks a lot! I will try it later Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now