Recent posts

Pages1 2 3 ... 10
1
RPG Maker Scripts / Re: [XP] Pictures under events...
Last post by Tepe - September 16, 2024, 06:15:33 am
Great! Thank You. It's working. :)
2
RPG Maker Scripts / Re: [XP] Pictures under events...
Last post by KK20 - September 15, 2024, 04:01:36 pm
Events and Pictures do not reside on the same Viewport. In Spriteset_Map:
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 200
    @viewport3.z = 5000
...
    # Make character sprites
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 1..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
        $game_screen.pictures[i]))
    end
Try making Sprite_Pictures instantiate on @viewport1.
3
RPG Maker Scripts / [XP] Pictures under events on ...
Last post by Tepe - 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
4
RMXP Script Database / Re: [XP] Continuous Maps
Last post by KK20 - September 12, 2024, 01:41:12 am
Resolution is not the issue, it's the fact that XPA completely rewrites how maps are rendered and updated, which is what Continuous Maps does too. Neither Blizz nor I are going to make a compatible fix for this.
5
RMXP Script Database / Re: [XP] Continuous Maps
Last post by Sin86 - September 11, 2024, 05:05:10 pm
I am so sorry to necropost this one too but I found an incompatibility with "[XP] XP Ace Tilemap". Yes, I am aware that it has issues with custom resolution scripts but I thought the incompatibility would be if you actually do change the resolution. For me, I'm just using the default resolution but still, that script will cause this script all kinds of issues such as crashes and an invisible player when trying to travel around the maps.
6
RMXP Script Database / Re: [XP] Disc Changer - If you...
Last post by KK20 - September 09, 2024, 12:02:20 am
It will require an edit to whatever script you're trying to use. There's no easy way to make this 100% compatible with everything out there.
7
RMXP Script Database / Re: [XP] Disc Changer - If you...
Last post by Sin86 - September 08, 2024, 01:18:05 pm
This is a very interesting script and it's great that it can help you bypass the engine's limit but the problem is, some scripts will require you to put in their IDs for certain functions to work. How can I put in the ID for a map on Disc 1 when normally any script that deals with map IDs are based on Disc 0?
8
RMXP Script Database / Re: [XP] Tons of Add-ons
Last post by KK20 - September 04, 2024, 06:58:34 pm
Another bug fix for Multi-Hit (replace Scene_Battle within the script):
Code: ruby
class Scene_Battle

  def rand_hits(value)
    return value if value.is_a?(Integer)
    return (rand(value.max - value.min + 1) + value.min)
  end

  def repeating_action?
    return (@repeat[1] - @repeat[0] > 0)
  end

  alias update_phase4_step1_multi_hit_later update_phase4_step1
  def update_phase4_step1(battler = nil)
    if battler != nil
      update_phase4_step1_multi_hit_later(battler)
      return
    end
    update_phase4_step1_multi_hit_later
    @repeat = [1, 1, 0]
    return if @active_battler == nil || !$game_system.MULTI_HIT
    if @active_battler.current_action.kind == 0
      if @active_battler.current_action.basic == 0
        if @active_battler.is_a?(Game_Actor)
          hits = rand_hits(BlizzCFG.weapon_hits(@active_battler.weapon_id))
        elsif @active_battler.is_a?(Game_Enemy)
          hits = rand_hits(BlizzCFG.enemy_hits(@active_battler.id))
        end
        @repeat = [hits, hits, 2]
      end
    elsif @active_battler.current_action.kind == 1
      @repeat[2] = 3
    elsif @active_battler.current_action.kind == 2
      @repeat[2] = 4
    end
  end
 
  alias update_phase4_step2_multi_hit_later update_phase4_step2
  def update_phase4_step2(battler = nil)
    if battler != nil
      update_phase4_step2_multi_hit_later(battler)
      return
    end
    update_phase4_step2_multi_hit_later
    return if !$game_system.MULTI_HIT
    if @phase4_step != 1
      if @repeat[2] == 3
        hits = rand_hits(BlizzCFG.skill_hits(@skill.id))
        @repeat = [hits, hits, 5]
      elsif @repeat[2] == 4
        hits = rand_hits(BlizzCFG.item_hits(@item.id))
        @repeat = [hits, hits, 5]
      end
    end
    if repeating_action?
      unless BlizzCFG::SHOW_ANIMATION_PER_HIT
        @animation1_id = 0
        @animation2_id = 0
      end
      @help_window.visible = false
    end
  end
 
  alias update_phase4_step3_multi_hit_later update_phase4_step3
  def update_phase4_step3
    update_phase4_step3_multi_hit_later
    @active_battler.white_flash = false if repeating_action?
  end
 
  alias update_phase4_step4_multi_hit_later update_phase4_step4
  def update_phase4_step4
    update_phase4_step4_multi_hit_later
    @wait_count = 0 if repeating_action? && !BlizzCFG::SHOW_ANIMATION_PER_HIT
  end
 
  alias update_phase4_step5_multi_hit_later update_phase4_step5
  def update_phase4_step5(battler = nil)
    if battler != nil
      update_phase4_step5_multi_hit_later(battler)
      return
    end
    update_phase4_step5_multi_hit_later
    return if !$game_system.MULTI_HIT
    if @active_battler.current_action.kind == 1
      if BlizzCFG::SKILL_RANDOM.include?(@skill.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.current_action.kind == 2
      if BlizzCFG::ITEM_RANDOM.include?(@item.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.is_a?(Game_Actor)
      if BlizzCFG::WEAPON_RANDOM.include?(@active_battler.weapon_id)
        @active_battler.current_action.decide_random_target_for_actor
      else
        @active_battler.current_action.decide_last_target_for_actor
      end
    elsif @active_battler.is_a?(Game_Enemy)
      if BlizzCFG::ENEMY_RANDOM.include?(@active_battler.id)
        @active_battler.current_action.decide_random_target_for_enemy
      else
        @active_battler.current_action.decide_last_target_for_enemy
      end
    end
    @phase4_step = 2 if @repeat[0] > 1 && @repeat[2] > 0
    @repeat[0] -= 1
  end
 
  alias make_skill_action_result_multi_hit_later make_skill_action_result
  def make_skill_action_result(battler = nil, plus_id = nil)
    if battler != nil
      if plus_id != nil
        make_skill_action_result_multi_hit_later(battler, plus_id)
      else
        make_skill_action_result_multi_hit_later(battler)
      end
      return
    end
    if @repeat[2] == 5
      sp_cost = @skill.sp_cost
      if $game_system.SP_COST_MOD
        sp_cost = BlizzCFG.get_cost_mod(@active_battler.states, sp_cost)
      end
      @active_battler.sp += sp_cost
      @status_window.refresh
    end
    make_skill_action_result_multi_hit_later
  end
 
  alias make_item_action_result_multi_hit_later make_item_action_result
  def make_item_action_result
    if @repeat[2] == 5
      $game_party.gain_item(@item.id, 1)
      @status_window.refresh
    end
    make_item_action_result_multi_hit_later
  end
 
  # Compatibility fix for LockeZ Sacrifice HP
  if method_defined?(:sacrifice_hp)
    alias sacrifice_hp_if_not_repeating sacrifice_hp
    def sacrifice_hp(battler, action)
      sacrifice_hp_if_not_repeating(battler, action) unless @repeat[2] == 5
    end
  end
 
end
It addresses MP cost issues and consuming items multiple times.
Original thread: https://forums.rpgmakerweb.com/index.php?threads/xp-tons-of-add-ons-multi-hit-bug.171550/
9
RMXP Script Database / Re: [XP] Weapon Charge
Last post by Sin86 - August 25, 2024, 05:22:28 pm
Quote from: Blizzard on August 24, 2024, 03:31:44 am
Quote from: Sin86 on August 22, 2024, 03:23:28 pmIt's a great script and I love it, but I saw some bugs.

You can hold down the attack button during any autorun events, when there is text being displayed, when your character is forced to do a move route. Much of this can be game breaking. Is there any way to disable the script on certain events and then re-enable it when you are ready?

Yes, there is. Check the manual for script calls. There is one that disables all ABS controls.

Tried it while talking to an NPC, it still charges if I hold the attack button. I tried $game_system.blizzabs and $game_system.attack_button and it still thinks it can charge.

Only way this script is ever disabled is if there are no enemy events on the map in the first place.
10
Projects / Games / Re: [XP-RGSS3]Dark Eternal II:...
Last post by Hakuzen - August 24, 2024, 09:24:24 pm
Dark Eternal II v2.0 Open Beta has officially begun.

Please head over to our discord for a download link if interested. (Announcements channel)

https://discord.gg/kX5ECUw2NP

Official release date is estimated to be early 2025.

Thanks for Playing!
Pages1 2 3 ... 10