Load picture based on actor ID

@Kyuukon, that one works perfectly in a blank base, thanks a bunch 😀
Sadly when I add it to Escalia it bugs with Luna Engine, I think I need to hire a scripter to patch that 🙁 but thanks a lot for the hard work!
@Kyuukon, that one works perfectly in a blank base, thanks a bunch 😀
Sadly when I add it to Escalia it bugs with Luna Engine, I think I need to hire a scripter to patch that 🙁 but thanks a lot for the hard work!
What scripts of Luna Engine you use? Show me the bug, maybe I can help you to fix it
What scripts of Luna Engine you use? Show me the bug, maybe I can help you to fix it
+1!
What scripts of Luna Engine you use? Show me the bug, maybe I can help you to fix it

It's actually the main Luna script that's bugging.
cf1881441268befbdd0edc29b2166c71.png


Which is this part:


#--------------------------------------------------------------------------
# new method: create_menu_status
#--------------------------------------------------------------------------
def create_menu_status
@menu_status = LunaMenu_Status.new(@viewport, :skillmenu)
@menu_status.actor_window = @actor_window
@menu_status.update
end

#--------------------------------------------------------------------------
# alias method: update
#--------------------------------------------------------------------------
alias menu_luna_update update
def update
menu_luna_update
@menu_status.update
@current_status.update
end

And more specifically, it's the line: @menu_status.update

I tried putting Kyuukon's script above Luna Menu, but it didn't work (it won't update based on actor ID). When I put it below it does work, but crashes shortly after.
More likely this won't solve it but it doesn't hurt to try. Add this:
Code:
def update
end
in line 17 of my script 😮
Sadly it didn't 🙁 could it be because you added that new window?
Sadly it didn't 🙁 could it be because you added that new window?
No clue. I don't know what the Luna Engine does with the Menu >.<

Oh, well... give this a try. This supposedly should add some compatibility. So move the script below Luna's.
Code:
class Window_Base
  def draw_image(x,y,path)
    bitmap = Bitmap.new(path)
    self.contents.blt(x,y,bitmap,Rect.new(0,0,bitmap.width,bitmap.height))
  end
end
 
#==============================================================================
# ** Window_FancyLayer
#==============================================================================
class Window_FancyLayer < Window_Base
  def initialize(x, y)
    super(x, y, Graphics.width, Graphics.height)
    self.windowskin = nil
    @actor = nil
  end

  def update
  end
 
  def standard_padding
    return 0
  end
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
  end
 
  def draw_actor_layer
      x = 0; y = 0
      case @actor.id
      when 1
          path = "Graphics/Pictures/Actor1_Layer.png"
      when 2
          path = "Graphics/Pictures/Actor2_Layer.png"
      else
          return
      end
      draw_image(x,y,path)
   end
end

class Scene_Skill < Scene_ItemBase
 
  alias fancylayer_start start
  def start
    fancylayer_start
    create_fancylayer_window
  end
  # * Create Fancy Layer Window
  def create_fancylayer_window
    @fancylayer_window = Window_FancyLayer.new(0, 0)
    @fancylayer_window.viewport = @viewport
    @fancylayer_window.actor = @actor
    @fancylayer_window.draw_actor_layer
  end
end

:😴prays in spanish😴:
That one doesn't bug, but when I swap characters with Q/W it won't change the overlay from actor 1 to actor 2. It does work if pick actor 1, I exit the skill menu then pick actor 2.

Think that could be fixed? 😛
That one doesn't bug, but when I swap characters with Q/W it won't change the overlay from actor 1 to actor 2. It does work if pick actor 1, I exit the skill menu then pick actor 2.

Think that could be fixed? 😛
Try this:

Spoiler: Code
Code:
class Window_Base
  def draw_image(x,y,path)
    bitmap = Bitmap.new(path)
    self.contents.blt(x,y,bitmap,Rect.new(0,0,bitmap.width,bitmap.height))
  end
end
 
#==============================================================================
# ** Window_FancyLayer
#==============================================================================
class Window_FancyLayer < Window_Base
  def initialize(x, y)
    super(x, y, Graphics.width, Graphics.height)
    self.windowskin = nil
    @actor = nil
    refresh
  end

  def standard_padding
    return 0
  end
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
  end
 
  def refresh
    contents.clear
    draw_actor_layer
  end

  def draw_actor_layer
    x = 0; y = 0
    case @actor.id
    when 1
      path = "Graphics/Pictures/Actor1_Layer.png"
    when 2
      path = "Graphics/Pictures/Actor2_Layer.png"
    else
      return
    end
    draw_image(x,y,path)
  end
end

class Scene_Skill < Scene_ItemBase
  alias :start_fancylayer :start
  def start
    start_fancylayer
    create_fancylayer_window
  end
  # * Create Fancy Layer Window
  def create_fancylayer_window
    @fancylayer_window = Window_FancyLayer.new(0, 0)
    @fancylayer_window.viewport = @viewport
    @fancylayer_window.actor = @actor
    @fancylayer_window.draw_actor_layer
  end
end
Code:
class Window_Base
  def draw_image(x,y,path)
    bitmap = Bitmap.new(path)
    self.contents.blt(x,y,bitmap,Rect.new(0,0,bitmap.width,bitmap.height))
  end
end
 
#==============================================================================
# ** Window_FancyLayer
#==============================================================================
class Window_FancyLayer < Window_Base
  def initialize(x, y)
    super(x, y, Graphics.width, Graphics.height)
    self.windowskin = nil
    @actor = nil
  end

  def update
  end
 
  def standard_padding
    return 0
  end
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
  end
 
  def draw_actor_layer
      x = 0; y = 0
      case @actor.id
      when 1
          path = "Graphics/Pictures/Actor1_Layer.png"
      when 2
          path = "Graphics/Pictures/Actor2_Layer.png"
      else
          return
      end
      draw_image(x,y,path)
   end
end

class Scene_Skill < Scene_ItemBase
 
  alias fancylayer_start start
  def start
    fancylayer_start
    create_fancylayer_window
  end
 
  # * Create Fancy Layer Window
  def create_fancylayer_window
    @fancylayer_window = Window_FancyLayer.new(0, 0)
    @fancylayer_window.viewport = @viewport
    @fancylayer_window.actor = @actor
    @fancylayer_window.draw_actor_layer
  end
 
  alias fancylayer_on_actor_change on_actor_change
  def on_actor_change
    fancylayer_on_actor_change
    @fancylayer_window.contents.clear
    @fancylayer_window.actor = @actor
    @fancylayer_window.draw_actor_layer
  end
 
end

😂

Edit: Ninja'd LOL! But mine is less laggy 🙂, since it only draws again when you switch actors.
Yes! It works!! 😀 thanks a bunch you two! Is there anything I could do in return?
Yes! It works!! 😀 thanks a bunch you two! Is there anything I could do in return?
No, we are here for helping! ☺️
Yes! It works!! 😀 thanks a bunch you two! Is there anything I could do in return?
No, we are here for helping! ☺️
W-What?! I thought this was classifieds section!




Haha jk 🙏 I might PM you later for BETA test Escalia though :3 I want to see it in action lol.
You are free to be my betatester anytime 😀!

Really thanks a bunch guys, been struggling with this one for weeks!
You are free to be my betatester anytime 😀!

Really thanks a bunch guys, been struggling with this one for weeks!
Me too I want to tested, it will be great hahaha.
You're welcome, If you have any other trouble, don't be shy for ask help, I will help you ever if I can
Don't use a window class for showing a simple image, that's a waste of performance. >.>

Here is a much cleaner version, in case you care about performance:
Spoiler
Code:
class ActorPic

  def initialize(aid)
    @img = Sprite.new
    @img.bitmap = Cache.load_bitmap("Graphics/Pictures/","actor_pic_#{aid}")
    @img.z = 55555
  end
 
  def refresh(aid)
    @img.bitmap.dispose
    @img.bitmap = Cache.load_bitmap("Graphics/Pictures/","actor_pic_#{aid}")
  end
 
  def dispose
    @img.bitmap.dispose
    @img.dispose
  end
 
end
 
class Scene_Skill < Scene_ItemBase
 
  alias add_apics9911 create_command_window
  def create_command_window
    add_apics9911
    @apics = ActorPic.new(@actor.id)
  end
 
  alias add_apics7725 on_actor_change
  def on_actor_change
    add_apics7725
    @apics.refresh(@actor.id)
  end
 
  def dispose_all_windows
    super
    @apics.dispose
  end

end

I have no idea what methods Luna engine overwrites or aliases, but if it directly defines the method dispose_all_windows, you will need to alias it instead of calling super in it, or else this script will overwrite Luna's method.
This should go below the Luna engine scripts.

Change the folder and image name format if you like at the obvious places in the script.
I also set the Z level to something very high, but change it how you want. I tested with very small images, and couldn't see them under the windows, so I put the images above the windows. 😀

And I forgot about that other script change you asked me to do, but will do it now to avoid further forgetfulness. 😀
Oh! Thanks a bunch Sixth 😀 if I can ever help out with anything, let me know!

@kamekache and @Kyuukon I'm planning to have the beta finished in about 2-4 weeks so expect a pm with a dropbox link then 😉

Original thread: https://forums.rpgmakerweb.com/threads/load-picture-based-on-actor-id.74855/