[VXA] Update in custom window not being called

Hello!
I'm making a simple window to pop up when your book makes a note. It's just 50x50, invisible background, and sits in the corner sporting nothing but the icon. It's not the first window I've scripted, but it is the first using the function I'm struggling with.

What I want to happen is that after two and a half seconds (150 frames) the icon fades out; I was going to do this via the update function via the Window_Base class. It was my understanding that this function is called every frame, so overwriting it for this specific window would allow me to gradually reduce the contents_opacity before disposing of it.

Ruby:
def update
  @wait_time += 1
  if @wait_time >= 150
    self.contents_opacity -= 2
    dispose if self.contents_opacity <= 0
  end
end

My problem is that the function doesn't run at all; not that it's neccessarily bugged, it's never called. I tried to use Calestian's Achievements script for reference, specifically the achievement notification block (original script link is dead sadly), but they didn't do anything particularly different to me as far as I can tell.
The solution could be really simple but I've had no luck finding it.
Thanks in advance!
So you can easily put in a print command to have something show up on the console and then you will know if the window is actually updating.
p(self.contents_opacity)
Just play test with the console window open.

Also it might seem like it is not working because maybe it needs to refresh.
But instead of refreshing every frame why not refresh when the opacity changes.
Also the icon is a bitmap to you probably need to dispose of the contents when it gets to 0 and set the content opacity to 255 again.
Code:
def update
  super
  @wait_time += 1
  op = self.contents_opacity
  if @wait_time >= 150
    self.contents_opacity -= 2
    dispose if self.contents_opacity <= 0
  end
  p(self.contents_opacity)
  refresh if op != self.contents_opacity
end
Wow I forgot about this thread aha.
I had already tried printing to the console, which is how I found out that the function was never running. I did try your function, though with no change; the icon appears then sits in the corner forever, and there is still nothing being printed to console. I'll hold onto the refresh call though as that may solve a different problem we've not encountered yet.
Thanks for your insight nonetheless.
Then my first thought is that you did not specify any parent class for the window.
class Window_Icon < Nothing here
If you set it to Window_Base then the update should run.
But it should also have a super in there. I'll edit my first post to state that.

1732304998051.png
1732305018493.png
Sorry to say again but it's already under Window_Base.
This is what I've been working with:

1732307733678.png

Your update function is just below.
Furthermore, I added the super and no change. I'm just as confused as you.

Edit; I had also tried moving the script to the bottom of Materials in case update was being overwritten by something that I missed, made no difference though.
send me a pm of the entire notify window script and where it is getting created.
Solved; the way I summoned the window lacked a way to maintain the window's reference.
From Roninator:
When events are finished processing the commands it is essentially deleted. So there would be no reference to the variable you created and the window is just sitting there in limbo.

When it is called by the interpreter (which normally goes to a scene (normally scene map) ) it is running with the reference of the scene or interpreter code. So it's always there.
The completed script works like a charm! Thanks again to Roninator.
Spoiler: Code
Ruby:
# Icon that appears in the corner when a note has been added to Bots.
# Credit to Roninator2 on the forums for helping with the fade

class Game_Interpreter

  def show_botsnotify
    SceneManager.scene.show_botsnotify
  end
end

# Notification
class BotsNotifyWindow < Window_Base
  def initialize
    super(Graphics.width-100,0, 100,100)
    self.opacity = 0
    self.contents_opacity = 255
    @wait_time = 0
    RPG::SE.new("Pen Writing", 85, 90).play
    draw_icon(944, 0 , 0)
    draw_icon(945, 24, 0)
    draw_icon(960, 0 ,24)
    draw_icon(961, 24,24)
  end
 
  def update
    super
    @wait_time += 1
    if @wait_time >= 150
      self.contents_opacity -= 4
    end
  end
end

class Scene_Map < Scene_Base
  def show_botsnotify
    $BotsNotify = BotsNotifyWindow.new
  end
 
  alias :r2_map_bots_update :update
  def update
    r2_map_bots_update
    bot_update
  end
 
  def bot_update
    $BotsNotify.update if $BotsNotify && $BotsNotify.contents_opacity > 0
    if $BotsNotify && $BotsNotify.contents_opacity <= 0
      $BotsNotify.dispose
      $BotsNotify = nil
    end
  end
end
The Game_Interpreter class can hold a reference to that window as an @instance variable. The thing is that such an object should be defined inside the scene instead.

Original thread: https://forums.rpgmakerweb.com/threads/vxa-update-in-custom-window-not-being-called.173080/