How do I make gradual fade in and fade out?
Here is how to do gradual fade in and fade. Be careful to use the one you need!
Gradual fade in: make light increase
variable (loop) for(loop,-31,0) do( reset palette tweak palette(loop*2,loop*2,loop*2) update palette wait(2) # gradual fade in
Gradual fade out : make light decrease
variable (loop) for(loop,0,-31,-1) do( reset palette tweak palette(loop*2,loop*2,loop*2) update palette wait(2) # gradual fade out
Feel free to include gradual fade in when the game starts, or to make the sun rise in inn scripts.
Feel free to include gradual fade out when the game ends, or to make the night arrive after you paid the Innkeeper in inn scripts.
-31 makes the fade very dark that fits many situations. Feel free to put -35 or -41 if you think it needs to be darker. Be sure that the value is the same in both fades if you need to use them both.
Please note that if you use both gradual fade in and gradual fade out in the same script, you don't have to repeat the line "variable (loop)" Be sure you include the line in your code as you are typing the first gradual fade, else hssed.exe will produce an error message.