Jump to content

Realistic Night Problem


Recommended Posts

Hello guys,

i wanna make a extrem realistic night effect for my RPG Server but i got a problem i wanna set the skycolor with a timer to black and this not directly because it have to be going slowly to black at 22 o clock it have to be complete to a black sky and at 4 o clock morning it have to be going slowly to the normal sky color. But i poste this problem in other forums but nobody can help me with it :( the problem is with my script: the color of the sky didnt going to black :o only gray and not the full skyarea. I got 0 errors

My script:

setTimer (function()  
    local hour = getTime().hour 
    if hour >= 22 or hour <= 4 then 
        setSkyGradient( 0 , 0 , 0 , 0 , 0 , 0 ) 
    else 
        resetSkyGradient() 
    end 
end, 300000, 0) 

if is this fix it i wanna add a contrast dark effect to make the houses cars and all the things with the same brightness but how??

I hope anybody can help me with it

But sorry for my bad english

I poste the Meta file:

"MrGTAmodsgerman" type="script" name="Realistic Nightsky" version="1.0.0" />   

Link to comment

Thanks but now at 22:04 the sky is black, at 22:03 is the sky dark blue but what is that?

the skycolor has to be change with the time to 22:00 on 21:59 is the sky very dark gray u know what i mean?

like in reallife, it comes darker darker darker and then at 4:00 it change with the timer to the normal color as resetSkyGradient You know?

i add good effects now:

  setTimer (function()  
    local hour, minute = getTime ( ) 
    if hour >= 22 or hour <= 4 then 
        setSkyGradient(0, 0, 0, 5, 5, 5) 
        setFarClipDistance(80) 
    else 
        resetSkyGradient() 
        resetFarClipDistance() 
    end 
end, 300000, 0) 

EDIT: I set the time in the admin panel to 3:58 and get this

9jgbwp.png

:shock: What is that? how i can fix that, it looks good but its to dark i cant drive :lol:

What is the reason of this effect?

At 5:04 the Big Effect turn off

m9nixj.png

Link to comment
You can use interpolateBetween for a nice smooth effect when changing sky color.

like this?

setTimer (function()  
    local hour, minute = getTime ( ) 
    if hour >= 22 or hour <= 4 then 
        interpolateBetween 
        setSkyGradient(0, 0, 0, 5, 5, 5) 
        setFarClipDistance(80) 
    else 
        resetSkyGradient() 
        resetFarClipDistance() 
    end 
end, 300000, 0) 

Link to comment
  • Moderators
Did you read the page abut the function? I don't think so.

https://wiki.multitheftauto.com/wiki/interpolateBetween

I read the function but i dint need a postion coordinates

It's just some maths, you can give the starting gradient and the ending one (of course you need to use 2 interpolate between since you have 6 values to fade nicely).

The function doesn't care if the values you are giving will be then used for sky gradient or to set the position of an object or a gui/dx element. They are just numbers.

That function will just go from the start numbers to the ending ones using the easing function you want.

Link to comment
  • 2 weeks later...
Did you read the page abut the function? I don't think so.

https://wiki.multitheftauto.com/wiki/interpolateBetween

I read the function but i dint need a postion coordinates

It's just some maths, you can give the starting gradient and the ending one (of course you need to use 2 interpolate between since you have 6 values to fade nicely).

The function doesn't care if the values you are giving will be then used for sky gradient or to set the position of an object or a gui/dx element. They are just numbers.

That function will just go from the start numbers to the ending ones using the easing function you want.

Where i can find the coordination of the sky? it is possible to import simple a timycyc.dat file?

Link to comment
  • Moderators
Where i can find the coordination of the sky? it is possible to import simple a timycyc.dat file?

There is no coordinate to get ... Please read again my post. Feel free to use google translate if english isn't your native language.

Link to comment
Where i can find the coordination of the sky? it is possible to import simple a timycyc.dat file?

There is no coordinate to get ... Please read again my post. Feel free to use google translate if english isn't your native language.

Ah i have to set the sky with the easing function it automaticly put a start and a ending in the sky right?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...