Script problem

Hello, I'm having problems getting my animation to play over top of my overlay layer. I used the included script (below) to fix this problem, but when the animation is finished a yellow tint screen like effect is left stuck on the screen. How would i remove this? or add another way of displaying the animations higher on the .z layer?

=begin
EST - EVENT ZMOD
made to fulfil request for Daemonium in www.rpgmakervxace.net
first set the new z you want in module estriole
then give comment in the event page
<zmod>
the one checked is the active page. so if you have multiple page you can have
some didn't have z mod. some have z mod.

edit: apparently you will encounter glitch if you use zmod with event that
have priority 'under character'. if you set the z too high then
the actor will be covered by event graphic (like above character priority)
so don't use zmod on event with 'under character' priority.
before i planned make a patch to ignore zmod when 'under character' priority
but i think it's not necessary.
=end


module ESTRIOLE
EVENT_ZMOD = 9
end

class Spriteset_Map
alias est_event_z_mod_create_characters create_characters
def create_characters
est_event_z_mod_create_characters
recreate_event
end
def recreate_event
i = 0
$game_map.events.values.each do |event|
@character_sprites.viewport = @viewport1 if @character_sprites &&
!@character_sprites.disposed? &&
!event.note["<zmod>"]
@character_sprites.viewport = @viewport9 if @character_sprites &&
!@character_sprites.disposed? &&
event.note["<zmod>"]
i = i+1
end
end
alias est_event_z_mod_create_viewports create_viewports
def create_viewports
est_event_z_mod_create_viewports
@viewport9 = Viewport.new
@viewport9.z = ESTRIOLE::EVENT_ZMOD
end
end

class Game_Event < Game_Character

alias est_event_zmod_setup_page_settings setup_page_settings
def setup_page_settings
est_event_zmod_setup_page_settings
return unless SceneManager.scene.is_a?(Scene_Map)
return unless SceneManager.scene.spriteset
SceneManager.scene.spriteset.recreate_event
end
#below taken from victor basic module to grab event note too lazy to write my own. 😀
def note
return "" if !@page || [email protected] || @page.list.size <= 0
comment_list = []
@page.list.each do |item|
next unless item && (item.code == 108 || item.code == 408)
comment_list.push(item.parameters[0])
end
comment_list.join("\r\n")
end
end

class Scene_Map < Scene_Base
attr_reader :spriteset
end



That is the script that is giving me the ability to display the animations above the overlay map. I just need to get rid of the yellow tint effect that gets stuck on after the animation plays
I suppose the animation you play got a screen flash effect, right?
Because the new viewport created by the above script is not updated at all, the flash effect will get stuck on the screen (which is what you see, I guess).

Try to add this snippet below the script you posted:
Spoiler
Code:
class Spriteset_Map
 
  alias upd_view98726 update_viewports
  def update_viewports
    upd_view98726
    @viewport9.ox = $game_map.screen.shake
    @viewport9.update
  end

  alias disp_zmod_view9927 dispose_viewports
  def dispose_viewports
    disp_zmod_view9927
    @viewport9.dispose
  end

end
This should fix your issue.
In addition, this will also properly dispose that new viewport, as well as apply the shake screen effects on your events using this new viewport.

In case you use screen tinting, you could notice that the tone of your events using the new viewport gets a bit odd.
That is because the tint effects won't apply to this new viewport either, so the tint of the events on this viewport won't match with the events using the default viewport.
The fix for this is highly situational, because depending on all of your used viewports on your map and their Z position, the events might need or might not need to be tinted at all. For this reason, I didn't include the fix for this issue (applying the fix may even make it worse in certain situations). You should check if you got any tinting issues on these events, and if so, I can show you how to fix that too.
Well that fixed the issue of the yellow flash being stuck but now it only plays the yellow flash and not the full animation. I'm using Yami overlay mapping script, my friend said he didn't have a problem using galv's overlay script so I'm considering switching to that one. If it is possible to fix without switching scripts though I would prefer that. Thank you for the help though. I don't tint very often, i more use a lighting script but yes I will have to test this all out once i get the animation on top of the overlay.

Edit: Sorry never mind, your snippet worked perfectly...I had just messed up the original animation when I was attempting to make it work myself lol. It also doesn't seem to effect my lighting, tinting or weather system so that is a bonus. Thanks a lot!!

Original thread: https://forums.rpgmakerweb.com/threads/script-problem.76022/