Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Tepe

1
Great! Thank You. It's working. :)
2
RPG Maker Scripts / [XP] Pictures under events on the map
September 15, 2024, 10:52:15 am
Hello like in topic.

Maybe exist script for shownig pictures under event on the map or someone can help me solve a problem with my?

Problem is simple but i don't know what i do wrong.

Usage:

Add comment to event:

PICTURE.Z 150
EVENT.Z 200

If i add picture to the event and graphic for the event then picture is showing still on the event graphic.


Spoiler: ShowHide
class Game_Event < Game_Character
  attr_accessor :picture_z, :event_z

  alias original_refresh refresh
  def refresh
    begin
      original_refresh
      @picture_z = nil
      @event_z = nil

      if @list
        @list.each do |command|
          if command.code == 108 || command.code == 408
            if command.parameters[0] =~ /PICTURE\.Z\s+(\d+)/
              @picture_z = $1.to_i
            elsif command.parameters[0] =~ /EVENT\.Z\s+(\d+)/
              @event_z = $1.to_i
            end
          end
        end
      end
      log_event_debug_info
    rescue => e
      log_error(e)
    end
  end

  def log_event_debug_info
    File.open("event_debug_log.txt", "a") do |file|
      file.puts("Event ID: #{@id} - EVENT.Z: #{@event_z}, PICTURE.Z: #{@picture_z}")
    end
  end

  def log_error(exception)
    File.open("error_log.txt", "a") do |file|
      file.puts("Error in Game_Event: #{exception.message}")
      file.puts(exception.backtrace)
    end
  end
end

class Sprite_Character < RPG::Sprite
  alias original_update update
  def update
    begin
      original_update
      if @character.is_a?(Game_Event)
        self.z = @character.event_z || 100
        log_character_debug_info
      end
    rescue => e
      log_error(e)
    end
  end

  def log_character_debug_info
    File.open("character_debug_log.txt", "a") do |file|
      file.puts("Character ID: #{@character.id} - Z: #{self.z}")
    end
  end

  def log_error(exception)
    File.open("error_log.txt", "a") do |file|
      file.puts("Error in Sprite_Character: #{exception.message}")
      file.puts(exception.backtrace)
    end
  end
end

class Sprite_Picture < Sprite
  alias original_update update
  def update
    begin
      original_update
      update_z
      log_picture_debug_info
    rescue => e
      log_error(e)
    end
  end

  def update_z
    max_event_z = $game_map.events.values.map { |event| event.event_z || 0 }.max
    self.z = (max_event_z || 0) - 1
  end

  def log_picture_debug_info
    File.open("picture_debug_log.txt", "a") do |file|
      file.puts("Picture - Z set to: #{self.z}")
    end
  end

  def log_error(exception)
    File.open("error_log.txt", "a") do |file|
      file.puts("Error in Sprite_Picture: #{exception.message}")
      file.puts(exception.backtrace)
    end
  end
end

class Spriteset_Map
  alias original_initialize initialize
  def initialize
    begin
      original_initialize
      update_picture_z
    rescue => e
      log_error(e)
    end
  end

  alias original_update update
  def update
    begin
      original_update
      update_picture_z
    rescue => e
      log_error(e)
    end
  end

  def update_picture_z
    begin
      max_event_z = $game_map.events.values.map { |event| event.event_z || 0 }.max
      @picture_sprites.each do |sprite|
        sprite.z = (max_event_z || 0) - 1
      end

      # Debug
      File.open("spriteset_debug_log.txt", "a") do |file|
        file.puts("Spriteset update:")
        @picture_sprites.each_with_index do |sprite, index|
          file.puts("Picture Index: #{index} - Z set to: #{sprite.z}")
        end
      end
    rescue => e
      log_error(e)
    end
  end

  def log_error(exception)
    File.open("error_log.txt", "a") do |file|
      file.puts("Error in Spriteset_Map: #{exception.message}")
      file.puts(exception.backtrace)
    end
  end
end
3
RMXP Script Database / Re: [XP] Easy Party Switcher
November 29, 2022, 08:06:44 am
It's working. Thanks for Your advice / support. :)
4
RMXP Script Database / Re: [XP] Easy Party Switcher
November 28, 2022, 09:42:09 pm
I don't wanna remove opacity because it is most important for me.

I wanna only remove window_battlestatus and window_help under windowskin.

KK20

Set in script:

# allows switching the party in battle
BATTLE_SWITCH = true

Find in script:

@current_window = Window_Current.new

Add after:

@current_window.back_opacity = 100

Find

@reserve_window = Window_Reserve.new(@scene)

Add after:

@reserve_window.back_opacity = 100

Find:

@help_window = Window_HelpStatus.new(@reserve_window.getactor(0), @scene)

Add after:

@help_window.back_opacity = 100

I added custom background for this module and I solved this problem with z-index method but it still not exactly what I want.

Before z-index:



After z-index:

5
RMXP Script Database / Re: [XP] Easy Party Switcher
November 28, 2022, 05:23:52 pm
Hello Blizzard.

Do You have idea how to fix bug in this script?
I wanna hidden or remove Window_BattleStatus and Window_Help in Battle Mode when Party Switcher is active.

Image