Fix one thing, break another!
Updated the pastebin, should hopefully tint properly when pausing/unpausing now.
Haha always the way! Will test now and let you know the results.
Edit:
Problem is still there. Here is my setup:
Map 1 (World).
Event 1: Parallel Process
- - - Fadein
- - - Erase Event
Event 2: Player Touch
- - - Fadeout
- - - Transfer player to map 2 (Dungeon)
- - - Call script
GameTime.pause_tint(true)Map 2 (Dungeon)
Event 1: Parallel Process
- - - Call script
s = $game_map.effect_surfaces.change_color(1,0,0,0,80) - - - Fadein
- - - Erase event
Event 2: Player Touch
- - - Fadeout
- - - Call Script
GameTime.pause_tint(false) - - - Transfer player to map 1.
On going back to the World, the tint is still the same as set for in the dungeon.
Edit 2
Thought it might be easier for you to have the system i am working with. Here is a very basic model.
https://www.dropbox.com/s/czquzvfxgemguop/lightTest.rar
Edit 3
Got it working! I looked through the code and had a little play around with printing debug messages to the console to check which functions was being called, and how far through they was getting. Also looking at the variables within the script to see changes (Or no changes for this instance)
Here is the solution for others. (Remember i am using Khas Awesome Lighting)
On line:
503
def use_khas begin temp = $game_map.light_surface.opacity rescue return end self.visible = false $game_map.effect_surface.change_color(1,0,0,0,0) if no_tint return if no_tint $game_map.effect_surface.change_color(1,0,0,0,0) if @old_time min = $game_time.min return if min == @old_time @old_time = min rgba = get_new_tint(min) return if rgba == @old_tint @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) endreplace with:
def use_khas begin temp = $game_map.light_surface.opacity rescue return end self.visible = false $game_map.effect_surface.change_color(1,0,0,0,0) if no_tint return if no_tint min = $game_time.min return if min == @old_time @older_time = @old_time; @old_time = min rgba = get_new_tint(min) if rgba == @old_tint if @older_time = -1 @older_time = 0 @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) end return end @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) end
The differences are
@older_time = @old_time;and
if rgba == @old_tint if @older_time = -1 @older_time = 0 @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) end returnend
Explanation:
I noticed that in the force_update function it was setting
@old_time to
-1. I could see this was to force the script to re-initialize the tint, however this piece of code was stopping it;
@old_time = minrgba = get_new_tint(min)return if rgba == @old_tintrgba and old_tint was still the same, even knowing you set the shade differently before and it was still showing as a different shade. It would keep printing out the old rgba.
So i gathered by pausing the tint process, then setting a new tint through khas had confused this script into thinking it was still the same as before, so i added in another check using the -1 value set earlier. Works perfectly now.